Use the AppFxWebService

The Infinity platform is designed specifically to allow integration scenarios, and as part of that design, every application feature is accessible via standard web services accessible from any programming tool that utilizes XML, HTTP, and SOAP. Global Changes and other Infinity features can be accessed via a call to the primary web service API named AppFxWebService.asmx or one of the other programmatic wrappers.

Both user interface shells (ClickOnce Smart Client and Web Shell) that ship with the product utilize the Blackbaud AppFx Web Service (AppFxWebService.asmx) to communicate with Infinity-based features. Features refer to functionality created using the Infinity SDK such as data forms, data lists, record operations, etc. The AppFxWebService.asmx exposes every application feature including data lists, data forms, query, batch, security, KPIs, business operations and global changes.

Tip: For additional details on Web API, see API Overview and Overview: AppFxWebService.asmx API.

AppFxWebService Global Change Related Endpoint Operations

Tip: If you are unfamiliar with locating the web service, see Locating the AppFxWebService.asmx Endpoint.

Placing the URL to the endpoint in the browser provides a listing of the endpoint's operations with some basic descriptions. Looking at the listing of operations for the endpoint, we see there are several operations that enable you to manage business processes.

And several operations enable you to manage global changes.

Consume the AppFxWebService.asmx

In the .NET world, the first step to consume the AppFxWebService.asmx web service is as simple matter of adding a Web Reference. The process of adding a Web Reference will generate proxy class code based on the .NET Framework 2.0 Web Services technology.

Tip: For detials, see Adding a Web Reference to AppFxWebService.asmx.

Tip: For details on which version of the .NET Framework to target for your integration project, see Which Version of the .NET Framework and Visual Studio?.

In Visual Studio, the URL to the web service is used by Visual Studio to consume the associated WSDL and generate a proxy class on your behalf. As a developer, you can program against this proxy class making calls to the various operations such as BusinessProcessInformation, GlobalChangeInformation, BusinessProcessLaunch, etc. In the code snippet below, we are calling the GlobalChangeInformation operation on the proxy class to retrieve some details on the global change that we defined by our CLR Global Change exercise. In the sample below, the namespace that organizes our classes for our Web Service is named "localhost." Within this namespace, we will find local generated classes that allow us to easily program against the web service. The operations to use, such as GlobalChangeInformation, can be found within the AppFxWebService class organized within the localhost namespace. The following line of code creates a variable named svcclient of type AppFxWebService.

static GlobalChangeConsoleApp.localhost.AppFxWebService svcclient;

After we have a variable that represents the web services, we can structure a call to the appropriate operation. Here is some code that calls the GlobalChangeInformation operation. You can see that a Request-Response pattern is used. An operation is called on the client proxy, such as GlobalChangeInformation. The request is passed to the operation and a reply is received. Each class representing the request and reply is tailored for each type of operation. Therefore, the GlobalChangeInformationRequest class represents the request and GlobalChangeInformationReply represents the reply.

	// Returns information on a given global change definition
        static void GlobalChangeInformation(string GlobalChangeCatalogID)
        {
   	    GlobalChangeConsoleApp.localhost.GlobalChangeInformationRequest request = new GlobalChangeConsoleApp.localhost.GlobalChangeInformationRequest();
            GlobalChangeConsoleApp.localhost.GlobalChangeInformationReply reply;

            request.ClientAppInfo = clientAppInfoHeader;
            // Provide the appropriateID from the BUSINESSPROCESSCATALOG  table for the 'Global Change Process' business process
            // Description: Returns information on a given global change definition
            Guid systemRecordID = new Guid(GlobalChangeCatalogID);
            request.CatalogID = systemRecordID;
           
            //Call the operation passing the request and catching the reply
            try
            {
                reply = svcclient.GlobalChangeInformation(request);

                GlobalChangeConsoleApp.localhost.FormField[] formfieldvalues = reply.FormMetadata.FormFields;

                Console.WriteLine("Displaying GlobalChangeInformation defined within the global change definition (GlobalChangeSpec)...");
                Console.WriteLine("Name: {0} | Value: {1}", "CatalogID", reply.CatalogID.ToString());
                Console.WriteLine("Name: {0} | Value: {1}", "DisplayName", reply.DisplayName.ToString());

                Console.WriteLine("Displaying Some GlobalChangeInformation Form Field Metadata defined within the global change definition...");
                for (int i = 0; i < formfieldvalues.Length; i++)
                {
                    Console.WriteLine("FieldID: {0} | Caption: {1} | Required: {2} | DataType: {3}", formfieldvalues[i].FieldID.ToString(), formfieldvalues[i].Caption.ToString(), formfieldvalues[i].Required.ToString(), formfieldvalues[i].DataType.ToString());        
                }

                Console.WriteLine("Displaying GlobalChangeInformation completed");
                Console.WriteLine("");
                Console.WriteLine("");
            }
            catch (System.Web.Services.Protocols.SoapException exSoap)
            {
                Console.WriteLine("SoapException caught: {0} ", exSoap.Message.ToString());
            }
        }

The code above will produce the following output in a console window: