Communicate with AppFxWebService

Up to this point, the web service communications have been with Business Operations web services. But the primary web service endpoint is AppFxWebService. AppFxWebService is a single endpoint that lets you access just about everything in an Infinity application. But it is slightly harder to craft a message to that endpoint. Here are two reasons:

  1. You have to include an element in your message called ClientAppInfo.

  2. Binding the WSDL for AppFxWebService to Java classes, creating Beans for the WSDL, or generating proxy classes pose difficulties because of the complexity of the AppFxWebService definition.

For more background information about Infinity Web APIs, see:

Introduction to the Infinity Web Service APIs

Or a for a more in depth discussion, see:

API Overview

So we'll take a step back for a minute and demonstrate communicating with the AppFxWebService using the raw technique in Create Connections with URLConnection. In this example, we'll focus on how to configure ClientAppInfo.

Keep in mind that this example is a Java client talking to a locally hosted Infinity application using Integrated (Windows) authentication. No special considerations are necessary for authentication here because the client runs on the same machine as the Infinity application in an environment with Integrated authentication.

ZIP file that contains Java code project for this example: AppFxExample.zip.

Topic that contains commented Java code for this example: AppFxExample.java.

The main differences between this and the BizOps example are:

  1. The endpoint in this example is an AppFxWebService endpoint.

  2. The message contains ClientAppInfo.

So we assign urlString as follows:

        String urlString = 
"http://localhost/bbAppFx/appfxwebservice.asmx";

And we assign the String for the request message as follows:

        String infWebSvcRequestMessage = 
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" +
             "  xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" +
             "  xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\">" +
"  <soap12:Body>" +
"    <CodeTableGetDescriptionRequest xmlns=\"Blackbaud.AppFx.WebService.API.1\">" +
"      <ClientAppInfo REDatabaseToUse=\"BBInfinity\" ClientAppName=\"WebShell\" TimeOutSeconds=\"0\" RunAsUserID=\"00000000-0000-0000-0000-000000000000\" ClientUICulture=\"en-us\" ClientCulture=\"en-us\" />"  +              
"      <CodeTableName>ADDRESSTYPECODE</CodeTableName>" +
"    </CodeTableGetDescriptionRequest>" +
"  </soap12:Body>" +
"</soap12:Envelope>";

Run this example on a properly configured host to show the reply message in the Output window.