Consume an external Web Service

You can configure Service Manager to connect to and exchange information with remote Web Services. This functionality allows Service Manage to act as a client to other servers that publish Web Services. Service Manager uses a built-in Web server to send and receive SOAP messages to Web Services, but internally the server uses JavaScript™ to create and format the proper SOAP messages.

If you connect to the internet the through a proxy server, you need to add three Java proxy server settings to the configuration file (sm.ini). The proxy server settings allow your Service Manager server to connect to remote sites and download the WSDL for the remote Web Services.

Note For a production application that needs services that are not available within your corporate intranet (such as postal address verification, email address verification, and currency conversions) We recommend that you investigate offerings from established for-fee Web Services vendors. Although there are a lot of free and demo Web Services, we do not recommend basing a production application on such services, since availability of the service is not guaranteed. Several Web sites such as www.xmethods.net publish lists of available free and fee-based Web Services. (Be sure to click the full list button to see the complete list of Web Services.)

To consume a Web Service from Service Manager, perform the following steps:

  1. Obtain the URL to the Web Service's WSDL file.
  2. Examine the WSDL either as a text file, or using a third-party graphical WSDL analysis tool to determine what functions, inputs, and formats the Web Service expects. Some third-party Web Services tools allow you to experiment interactively with Web Services. We recommend that you familiarize yourself with the Web Service using such a tool before beginning any Service Manager JavaScript work.
  3. Execute the Run WSDL to JS wizard to obtain and convert the Web Service's WSDL into JavaScript.
  4. Write custom JavaScript to call the JavaScript functions generated by the WSDL to JS wizard. These functions will enable you to create and send the SOAP messages required to interact with the Web Service. We recommend that you write a short “standalone” script and invoke it from the Script Library utility to test it prior to implementing the JavaScript call from Format Control, Triggers, or Display Options. After you have determined and debugged the JavaScript code required to invoke the service, you can then integrate the script with your Service Manager application.
  5. Tailor your Service Manager application to invoke your custom JavaScript when you want to connect to a remote Web Service. Usually Web Services are invoked from the Document Engine, Format Control, Links, Display application, or from similar tailoring tools. For testing purposes, the JavaScript code can be called from within the ScriptLibrary record itself before being called from any of the other tailoring tools.