Web service example 8: Step-by-step instructions

Previous Next

This topic contains step-by-step instructions to complete Web Service Example 8: Component Table with an Input XSL Transformation.

To extend the GetMultipleTours method of the TRAVELSERVICE web service provider with a SearchXML input parameter that contains a SearchDestination condition:

1.In the Web Service Provider window, query the TRAVELSERVICE web service provider that you defined in Example 7.
2.For the GetMultipleTours method, change the SQL statement to:

INVOKE XML.EXPORT

WITH

SELECT     *

FROM     tour

WHERE     destination =

    USXSL.value(:SearchXML

,'/ns:SearchDestination'

,'xmlns:ns="http://MyWebServer/TravelService/TRAVELSERVICE.wsdl"')

 

3.Click the Check button, and in the Question dialog, click Yes.
A SearchXML input parameter and one output parameter, by default XMLDOCUMENT, is generated.
4.For the GetMultipleTours method of the TRAVELSERVICE web service provider, change some attributes of the output parameter:
Change the parameter name to: Tours.
Change the Namespace Alias to: Tours.
Click the XML Data Type button and select the Tours record.
5.Save your changes.
6.Click the Create Web Service button.
7.Click the Create WSDL File button.
8.Restart the Rules Service for the TRAVEL application.
9.From the Definer catalog, open the TRAVELCOMPONENT Web Service Component.
10.Click the Refresh button.
11.In the Refresh Web Service Component dialog, select the GetMultipleTours method, and click OK.
12.On the Constructor tab page, change the Input XSL transformation (this is the fourth parameter of the Constructor SQL, with current value: NULL) to:

'<?xml version="1.0" encoding="Windows-1252"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:template match="/">

    <SearchDestination xmlns="http://MyWebServer/TravelService/TRAVELSERVICE.wsdl">

    <xsl:value-of select="Table/Row/Field[@Index=''0'']/@Value"/>

    </SearchDestination>

</xsl:template>

</xsl:stylesheet>'

 

13.Check the Constructor SQL.
14.Open the TRAVELCOMPONENT table.
15.In the TRAVELCOMPONENT component table, add a SEARCH_DESTINATION column, with Position: 0.
16.In the application, open the External Tours info window and execute a query with a condition specified in the Search Destination field.