In this section: |
There are several steps for creating a configuration that will make a configuration Plan or Component available as a Web service.
In this example, you will create a service that verifies the first name and last name of certain individuals and returns their phone number in the output. Assume that you have created the component phonebook.comp.
This component contains an Integration Input Step named phonebook_in, and an Integration Output Step named phonebook_out.
The Input Step has the following columns:
The Output Step has the following columns:
This example consists of four procedures.
The selection SOAP format means that the content of the input and output messages will have a SOAP message structure.
The following image shows the Publish Component as Service dialog box.
In the following image, the name of the online service configuration file is supplied in the File input field.
The phoneService.online file is created and opened in the GUI editor. As you can see by some errors, the configuration is not finished. You can see all the errors in the Properties view. You must supply the namespaces that you want to use in the messages.
The following image shows the errors in the Properties view.
By default, the location of the service is set to the same value as the name of the online service configuration file without the extension. You can change the location.
In the following image, the service location is supplied in the Location input field.
Now the service configuration is ready to be deployed on the server. But first look at another feature.
It is possible to have different column names in the online configuration and in the configuration Plan or Component. You will change the nodeName attribute of the input and output columns.
In the following image, the values for nodeName are supplied in the fields in the input section.
In the following image, the values for nodeName are supplied in the fields in the output section.
Use a sample SOAP input message similar to the following:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://example.com/webservices"> <soap:Body> <ns1:phonebook> <ns1:firstname_in>Ferda</ns1:firstname_in> <ns1:lastname_in>Mravenec</ns1:lastname_in> </ns1:phonebook> </soap:Body> </soap:Envelope>
As a result, you receive a message similar to the following:
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:ns1="http://example.com/webservices" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:serviceResponse> <ns1:phonebookResponse> <ns1:firstname_out>Ferda</ns1:firstname_out> <ns1:lastname_out>Mravenec</ns1:lastname_out> <ns1:phone>+420111222333</ns1:phone> </ns1:phonebookResponse> </ns1:serviceResponse> </soap:Body> </soap:Envelope>
iWay Software |