Web Service

Cloud_Business.png

Web Service is a method of communication between two electronic devices or software instances. Web Service is defined as a data exchange standard. It uses XML format to tag the data, SOAP protocol is used to transfer the data, and WSDL language is used to describe the available services.

This action connects to a remote Web service and executes the methods on it. Methods can be described as actions that are published on the Web Service. The action sends inbound values to the selected method in the remote Web service, collects the result and saves it in selected variables.

After importing the WSDL and adding a reference to the Web Service, its methods are listed in the Method combo box.

[Note] Note

You can transfer simple types over the Web Service, such as string, integer, boolean, but not the complex types. The WSDL must contain single binding only.

[Note] Note

You plan to print product labels. Your trigger would receive only a segment of the required data. E.g. the trigger receives the value for Product ID and Description variables, but not the Price. The price information is available in a separate database, which is accessible over Web service call. Web service defines the function using a WSDL definition. For example, function input is Product ID and its output is Price. The Web Service action sends Product ID to the Web service. It executes and makes an internal look up in its database and provide the matching Price as the result. The action saves the result in a variable, which can be used on the label.

Web Service Definition group includes the following settings:

[Note] Note

This action supports Internet Protocol version 6 (IPv6).

  • WSDL: location of WSDL definition.

    WSDL is usually provided by the Web service. Typically, you would enter the link to WSDL and click Import to read the definition. If facing troubles while retrieving the WSDL from online resource, save the WSDL to a file and enter the path with file name to load the methods from it. Loftware automatically detects if the remote Web Service uses a document or RPC syntax, and whether it communicates appropriately or not.

  • Address: address at which the Web Service is published.

    Initially, this information is retrieved from the WSDL, but can be updated before the action is executed. This is helpful for split development / test / production environments, where the same list of actions is used, but with different names of servers on which the Web Services run.

    Fixed content, mix of fixed and variable content, or variable content alone are permitted. To enter variable content, click the button with arrow to the right hand side of data area and insert variable from the list. For more information, see section Combining Values in an Object in Loftware user guide.

  • Method: methods (functions) that are available for the selected Web service. The list is automatically populated by the WSDL definition.

  • Parameters: input and output variables for the selected method (function).

    Inbound parameters expect an input. For testing and troubleshooting reasons, you can enter a fixed value and see the preview result on-screen. Typically, you would select a variable for inbound parameter. Value of that variable will be used as input parameter. The outbound parameter provides the result from the function. You must select the variable that will store the result.

  • Timeout: timeout after which the connection to a server is established.

[Note] Note

Web Service action is executed on Web Printing Server and not on the Web Printing Client.

If you use Web Service action in LoftwareWeb Client and you want to execute locally (bypassing the Web Printing Server), add the prefix "LOCAL_" to your action name.

_LOCAL_06.png

Authentication enables basic user authentication. This option defines user credentials that are necessary to establish an outbound call to a remote web service.

  • Enable basic authentication: enables defining the Username and Password that can be entered manually or defined by variable values. Select Data sources to select or create the variables.

  • Show password: uncovers the masked Username and Password characters.

    Details about security concerns, are available in section Securing Access to your Triggers in Loftware Automation user guide.

Data Preview field allows you to perform a test Web service execution.

  • Execute button executes a Web service call.

    It sends values of inbound parameters to the Web service and provides the result in the outbound parameter. Use this functionality to test the execution of a Web service. You can enter values for inbound parameters and see the result on-screen. When satisfied with execution, replace the entered fixed value for inbound parameter with a variable from the list.