<%@ page language="C#" masterpagefile="~/templates/Documentation.master" inherits="Page" pagetitle="Creating a ddtek:wscall Function" keywords="Creating a ddtek:wscall Function"%>

Creating a ddtek:wscall Function

There are two ways to create a ddtek:wscall function in XQuery Mapper:

Use this method when you have created a Web service call using the Stylus Studio Web Service Call Composer. See , , on page 901 for more information on this topic.

Use this method when you want to use Web service operations that have not been exposed using a Stylus Studio Web service call.

To create a ddtek:wscall function automatically:
1. Open an XQuery and click the Mapper tab.
2. Open the Stylus Studio File Explorer or some other tool that allows you to navigate a file system.
3. Locate the Web service call (.wscc file) for the Web service whose operations you want to include in your XQuery code.
4. Drag the .wscc file and drop it on the XQuery Mapper canvas.

Stylus Studio adds the ddtek:wscall function glyph to the Mapper canvas and code for the ddtek:wscall function to your XQuery code.

If the Web service exposes multiple operations, the ddtek:wscall function is created with the operation that was exposed in the Web Service Call Composer when the .wscc file was last saved. You can choose the operation you want your XQuery code to execute by modifying the Web service call in XQuery Mapper:

1. Double-click the ddtek:wscall function glyph.

The Choose the WSDL Operation dialog box (see Figure 378) appears.

2. Click the down arrow in the Operation Name field to display the available Web service operations, as shown here:

Figure 377. Selecting a Web Service Operation

3. Select the operation you want and click OK.
To create a ddtek:wscall function manually:
1. Open an XQuery and click the Mapper tab.
2. Right-click the Mapper canvas and select Function Block > DataDirect XQuery > wscall/2.

Note

 

There are two predefied wscall functions - wscall/2 provides location and payload input ports; wscall/3 also provides a header input ports.

Stylus Studio displays the Choose the WSDL Operation dialog box.

Figure 378. Choose the WSDL Operation Dialog Box

3. Enter the URL of the WSDL whose operation you want your XQuery to execute in the WSDL File field.

Example: http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL

Tip

 

You can use Stylus Studio to help locate WSDL documents. See Obtaining WSDL URLs for more information.

Stylus Studio displays the operations associated with the Web service represented by the WSDL in the Operation Name field.

4. Choose the Web service operation you want your XQuery to execute from the Operation Name field.

Example: GetStockQuotes.

5. Click OK.

Stylus Studio displays the wscall function block on the XQuery Mapper canvas.

Figure 379. wscall Function Block on the XQuery Mapper Canvas

The illustration shown in Figure 379 shows a wscall defined with location and payload input ports.