Web Services Nodes

From PresenceWiki
Revision as of 12:15, 12 August 2015 by Rob (Talk | contribs)

Jump to: navigation, search

Introduction to Web Services and SOAP

A web service is any piece of software that makes itself available over the internet and uses a standardized XML messaging system.

Web services range from such major services as storage management and customer relationship management (CRM) down to much more limited services such as the furnishing of a currency conversion rate and the checking of bids for an auction item.

The accelerating creation and availability of these services is an important trend in the business world.

XML is used to encode all communications to a web service. For example, a client invokes a web service by sending an XML message, then waits for a corresponding XML response.

Because all communication is in XML, web services are not tied to any one operating system or programming language--Java can talk with Perl; Windows applications can talk with Unix applications.

A WSDL (Web Services Description Language) file describes the public interface to the web service.

This is an XML-based service description, which defines how external parties should communicate with the web service; namely, the protocol bindings and message formats required to interact with the web services listed in its directory.

The supported operations and messages are described abstractly, and then bound to a concrete network protocol and message format.

The Web Service Call can invoke Web Services using SOAP (Simple Object Access Protocol). SOAP is a lightweight XML-based messaging protocol used to encode the information in Web service request and response messages before sending them over a network.

SOAP defines an envelope format and various rules for describing its contents.

The Web Service Call task element allows you to invoke SOAP Web Services from Presence Tasks. The Web Service Call uses WSDL documents to create templates for specifying the request and response message.


Creating a Web Service Call

To create a Web Service Call, drag the icon from the Data Access / Web Services area of the Task Elements list:

http://www.international-presence.com/wikidocs/images/web_service_0.png

The Web Service Element dialog appears:

http://www.international-presence.com/wikidocs/images/web_service_1.png

WSDL Location Tab

Name Name for the Web Service Call.

WSDL Location The location of the WSDL document must be specified here. The WSDL document can be accessed from the internet or from a local file.

The results of a Web Service call are returned in Data Table columns in the Presence Context. The Web Service task element can empty the Presence Context data table before the call or can merge the results of the call with the existing datatable, based on the selection in this panel.

After specifying a WSDL file, an operation (along with any associated service and port) must be selected in the WSDL object tree:

Information window - Additional detail about the selected object and it's usage can be found in the information box.

If an operation is selected, the creation of the input message and querying of the output message can be defined. As the SOAP messages used for input and output are XML messages, the setup of the configuration if the input and output are similar to the XML Document Writer and the XML Query task element. To select an operation, double click it from the SOAP structure tree:

http://www.international-presence.com/wikidocs/images/web_service_2.png

Input Tab

The input tab allows you to specify which nodes in the schema of the input SOAP message should be matched with which values, as well as controlling how those elements should be repeated and the rules that should be applied to determine whether they should be included or omitted.

http://www.international-presence.com/wikidocs/images/web_service_3.png

Text Value Tab

To specify a value for a node, click on the node in the schema, then enter the value into the "Text Value" tab on the right hand pane. Values can be string literals, context variable references or data column references.

Options

  • Enclose text in CDATA section: wraps content in a CDATA section
  • Treat this text as a comment: places comment tags (<!-- ... -->) around the text
  • Include node if empty: Forces writer to include node even if no text is present
  • is NULL: adds a nill="true" attribute to the element.

Element repetition tab

http://www.international-presence.com/wikidocs/images/web_service_6.png This tab allows you to control the repetition of the selected element. Select "Repeat occurrences of this element" to enable repetition. This will display a list of currently available data columns that are produced from the Task that is currently being edited. By checking a column this will result in the selected element to be repeated for each unique value of that element.

Inclusion Rules Tab

http://www.international-presence.com/wikidocs/images/web_service_7.png

It is also possible to specify whether or not to include the element, or attribute, depending on the values of certain variables or columns (or function results).

Options

  • Enclose text in CDATA section: wraps content in a CDATA section
  • Treat this text as a comment: places comment tags (<!-- ... -->) around the text
  • Include node if empty: Forces writer to include node even if no text is present
  • is NULL: adds a nill="true" attribute to the element.

Output Tab

http://www.international-presence.com/wikidocs/images/web_service_4.png

The output tab allows you to specify which elements should be included in the result datatable from the output SOAP message.

To select a Column to be included with you result - First select from the tree an Element or Attribute (Field), then drag this field to the main white space on the right of the screen.

You can do this for as many columns as you need, you could also drag the whole of a root element across if you wanted to report on multiple fields; to do this drag the Root Element instead.

Change Alias Button - Use this button to change the heading of the column when the results are returned.

Clear Alias Button will revertthe alias to the automatically generated Alias.

Move Up Button Use this button to move the currently selected element up the pick list. Field names listed at the top will appear nearer to the left in the column list when your query results are returned.

Move Down Button Use this button to move the currently selected element down the pick list. This has the effect of formatting the column closer to the right when the results are returned.

Remove Column Button Use this button to remove the selected element from the pick list.

As each Element is selected from the tree an Info panel provides details about the element, this is useful for understanding the document structure.

Test tab

Test Button - Press this button to test the Web Service Call. If the call is successful and there are results to be returned you should see them formatted in the table.

The "Input Message" and "Output Message" tabs let you see the SOAP message source, which can be useful for tracking problems.

http://www.international-presence.com/wikidocs/images/web_service_5.png

See Also

Tutorial: Incoming Web Service Requests Tutorial

Task Elements : Data Accesss Task Elements : Web Services Nodes

SQL Statement Nodes | Object Monitor Nodes | XML Query Nodes | Mail Scanner Nodes
Web Services Nodes | LDAP Query Nodes | JSON Node | Flat File Parser | Data Table Nodes | Variable Nodes
Transaction Control Nodes | Context XML Nodes


Task Elements | Resources