This walkthrough demonstrates how to use pass-through services and operations.

Note:

This walkthrough makes use of some free services provided by the openweathermap.org server and the www.webservicex.net server. Neither of these servers is associated with InterSystems Corporation and these servers may not always be available. If they are not available, you can substitute any other REST or SOAP server available to you. The openweathermap.org server supplies free weather data. If you intend to use it in an application, you should get a application ID. Although the service is free, product support is available for the weather server at a fee. See http://openweathermap.com/ for more information about this server. The www.webservicex.net server is provided by Cloud Computing Technologies Ltd. For more information on the server, contact them at Info@WebserviceX.NET.

This section adds a REST pass-through service and a REST pass-through operation. The service listens on the CSP port and sends the HTTP REST message to the pass-through operation. The pass-through operation sends the HTTP REST message to an external server, api.openweathermap.org, that returns current weather information.

Select or create a namespace and production. In order to use the CSP port, you must define a web application in the namespace and a role. See Configuring an Ensemble System for step-by-step instructions to create a namespace, role, and web application. For this walkthrough, name the web application /restpassthrough (web application name should be lower case) and set the web application Dispatch Class to EnsLib.REST.GenericService.

On the production configuration page, select the plus sign for adding new operations.

Select the Pass-through operation that you created and select the Settings tab.

If you are using the external service registry, set the External Registry ID to identify the registry entry that sets the HTTP Server,HTTP Port, and URL settings and skip to Step 3. Otherwise specify these settings directly as follows:

The last parts of the URL starting with data are identical. The HTTP Server field sets the server in the outgoing call. The | in the URL field instructs the operation to strip the web application name and configuration name from the incoming URL and then include the remainder in the outgoind URL.

The TCP trace should show the HTTP request being sent out by the pass-through operation and the server's response.

Using SOAP Pass-through Services and Operations

This section adds a SOAP pass-through service and a SOAP pass-through operation. The service listens on the CSP port and sends the SOAP message to the pass-through operation. The pass-through operation sends the SOAP message to an external server, www.webservicex.net, which among other services provides a currency conversion service that returns the exchange rate for two specified currencies. In order to call the SOAP passthrough services, you need to use a SOAP toolkiit, such as SOAPUI. For information on the SOAPUI toolkit, see http://www.soapui.org/.

Before creating the pass-through services and operations, use a SOAP toolkit to create a project and call the external server directly. Using your SOAP toolkit, do the following:

Create a new project.

Specify the following as the location of the WSDL file:

http://www.webservicex.net/CurrencyConvertor.asmx?WSDL

Select the request generated for the project. If your toolkit generates a SOAP 1.1 and 1.2 requests, use the SOAP version 1.2 request. The toolkit displays the SOAP message that is sent to the server. For example, SOAPUI displays:

Select the pass-through operation that you created and select the Settings tab.

If you are using the external service registry, set the External Registry ID to identify the registry entry that sets the HTTP Server,HTTP Port, and URL settings and skip to Step 3. Otherwise specify these settings directly as follows: