Configure a SOAP Web Service Data Service
A Data Service Administrator A local administrator who creates and configures data services for use by Designers who configure Database data sources and Alternate data sources. can use this procedure to create a SOAP Web Service data service to communicate with a web service.
A Data Service Administrator can create a data service to interact with a web service by using Simple Object Access Protocol (SOAP). A web service is a platform-independent application that is hosted on a website. A SOAP implementation of web services provides a Web Services Description Language (WSDL), which is an XML-based language for defining an interface. A WSDL describes how a service can be called, what arguments can be used, and what type of data is expected to be returned.
To configure a SOAP Web Service data service, use the following procedure.
Note: You do not have to stop a data service to make changes to its configuration or for those changes to take effect, but you must save your changes.
- Click Data Services
- Click File > New > SOAP Web Service Data Service.
- Click the Configuration panel.
- For WSDL URL, enter a link to the Web Services Description Language (WSDL) that you will use to communicate with a web service.
- For Envelope, click Get WSDL Operations to automatically obtain operations.
- Click the Envelope drop-down list and select an operation envelope template. The XML for the SOAP envelope element is displayed. This is the root element of a SOAP message and defines the XML document as a SOAP message.
- For Web Service Address, enter the URL to use when connecting to the web service. You may be able to obtain this URL automatically by clicking Load From WSDL.
- For Security Header, provide XML including any credentials required for connecting to the web service if needed. You can select one of the header templates provided and then customize it to meet your needs, or copy and paste a header that you have created.
- For Result Name, specify the name of the XML Data business rule component to be used. The default name is WS_RESULT.
- For Result Path, specify the path the subset of data that you want returned from the web service. If you want to define the subset of data by using an XPath expression, select XPath Override.
Example: Result Path and XPath Override
If the configuration of the web service in Data Services
Result Path
/getCountryResponse/country
XPath Override
or
Result Path
/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='getCountryResponse']/*[local-name()='country']
XPath Override
and the SOAP response from the web service is the following:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns2:getCountryResponse xmlns:ns2="http://spring.io/guides/gs-producing-web-service">
<ns2:country>
<ns2:name>Spain</ns2:name>
<ns2:population>46704314</ns2:population>
<ns2:capital>Madrid</ns2:capital>
<ns2:currency>EUR</ns2:currency>
</ns2:country>
</ns2:getCountryResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Then the following data map entries result:
/Body/name/!TEXT! Spain
/Body/population/!TEXT! 46704314
/Body/capital/!TEXT! Madrid
/Body/currency/!TEXT! EUR
For more information about XPath, see "Scripting, Java, and XML" in External Links.
- If you must provide credentials for authentication when connecting to the web service, for Authentication Type select Basic and then enter credentials for User Name and Password.
- For HTTP Headers, enter the names and values that define the operating parameters of the HTTP transaction.
- In the Properties pane, enter a Service Name and optionally a Description.
Characters permitted in names
The following characters are permitted in the name: letters, numbers, parentheses, square brackets, ampersands, plus signs, commas, semi-colons, and tildes. Additionally, the following characters are permitted but cannot begin or end the name: spaces, double quotation marks, single quotation marks, hyphens, underscores, periods, and grave accents. For letters, the case that you specify is displayed, but case is ignored when Loftware Enterprise SP interprets a name. If you will be installing the Loftware Enterprise SP application on a computer running Windows Server, and transferring data between Loftware Enterprise SP instances, see the "Transferring Data in a Compressed File" section of the Loftware Enterprise SP Data Transfer Guide.
- Click File > Save or click the Save
button in the toolbar.
- In the left pane of the Save Data Service dialog box, select the folder in which to save the data service. You can double-click a folder to display subfolders.
- Click OK to save the data service. Creation information is displayed in the Properties pane.
- If the data service has not been started, click Start Data Service.
The data service is updated with the connection information. You can view the status of the data service in the Properties pane. If the data service is stopped, you must start it to make the result available when printing labels.
Important! An administrator must create an XML Data business rule component to be used in conjunction with this data service. You cannot create data sources in Label Design
Important! Whenever you add a new device, data service, integration, or facility, you must ensure that the service is activated on all Loftware Application Servers on which it should be available to run and started on at least one. In an environment with only one Loftware Application Server, these types of services are automatically activated and started when they are created. For more information,
Note: If you want to delete a data service, you must stop it before you can delete it.