Examining the ddtek:wscall Function Block

The previous procedure, Creating a ddtek:wscall Function, provided an example Web service (Swanad Mokashi's StockQuote WSDL (http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL), and an example of an operation (GetStockQuotes). This Web service, given a stock ticker value, returns information about that stock, including the company name, a current stock quote, daily high and low values, and related information.

Imagine we chose the GetStockQuotes operation for our wscall. Let's take a closer look at the wscall function block created by Stylus Studio.

As seen in Figure 379, our ddtek:wscall function block was created with two input ports (we could have created a ddtek:wscall function block with three input ports), a flow port, and an output port. (See Parts of a Function Block for general information about function blocks in XQuery Mapper.)

Location Input Port

The location input port for the ddtek:wscall function describes information about the Web service whose operation we selected for the XQuery, including its location (as a URL) and operation (as a SOAP action). This port is on all ddtek:wscall function blocks.

If you double-click the port, Stylus Studio displays a configurable information box, as shown in Figure 380. (The same is true for other input ports and the output port.)

If we right-click the address node and choose Set Text Value, the Value dialog box displays the URL for the Swanand Mokashi Web service WSDL, as shown in Figure 381:

Similarly, we would see GetStockQuotes if we looked into the soapaction node.

Payload Input Port

The payload input port for the ddtek:wscall function describes the data the Web service requires in order to execute the SOAP action. This port is on all ddtek:wscall function blocks. (It is the second input port for functions added to XQuery Mapper using the wscall/2 menu choice. It is the third input port if you used the wscall/3 menu choice.)

The "payload" for the Swanand Mokashi StockQuotes Web service, for example, is a ticker value - PRGS, GOOG, or EBAY, for example.

By default, no text value is defined for the payload port.

Header Input Port

The header port for the ddtek:wscall function appears on function blocks defined using the wscall/3 menu choice. You use the header port to provide authentication and authorization information, like a username and password, for example.

Output Port

The output port for the ddtek:wscall function displays the output of the Web service represented by the ddtek:wscall function. In the case of the Swanand Mokashi StockQuote Web service, available output includes company name, stock quote, change, opening price, and so on, as shown in Figure 381.

Displaying Port Information

To display port information, double-click the port.

Note that you can display information for only one input port at a time.

Moving Port Information

When you move a port information box, the ddtek:wscall function block moves with it, and vice versa.

Free Stylus Studio XML Training:
W3C Member