This topic contains step-by-step instructions to complete Web Service Example 6: RPC-Oriented Method with Complex Type Soap Array Parameters.
To define an RPC-oriented method that retrieves Scheduled Tour details for a specified destination:
1. | In the Definer, in the Web Service Provider window, query the TRAVELSERVICE web service provider that you defined in Example 1. |
2. | On the Methods tab page, define a GetScheduledToursArray method, set the Operation Style to: RPC-oriented, and set the Method Call to: Synchronous. |
INVOKE USXSL.apply
WITH
SELECT
(
INVOKE XML.export
WITH
SELECT tour_type, start_date, return_date, price, max_part, guide
FROM schedtour
WHERE destination=:destination
)
, '<path to file>/att2childelts.xsl'
5. | Click the Check button, and in the Question dialog, click Yes. |
| One input parameter and one output parameter, by default RETURN, are generated. |
7. | From the Definer menu, select: Define, Web Services Provider, Namespaces. Define a Namespace: |
| Location: http://<web server>/TravelService/ScheduledToursArray.xsd |
8. | Define a ScheduledToursArray.xsd XML schema file that describes the structure of the returning XML document. |
9. | For the GetScheduledToursArray method of the TRAVELSERVICE web service provider, change some attributes of the output parameter: |
| Change the parameter name to: Scheduled_Tours. |
| Change the Domain to: XMLDOMAIN. |
| Change the Namespace Alias to: Array. |
10. | Click the XML Data Type button and select the ArrayOfScheduledTours record. Save your changes. |
11. | Click the Create Web Service button. |
| The web server publication folder now contains an up-to-date TRAVELSERVICE.ashx and web.config files. |
12. | Click the Create WSDL File button. |
| The web server publication folder now contains an up-to-date TRAVELSERVICE.wsdl file. |
13. | Restart the Rules Service for the TRAVEL application that you configured in Example 1. |
14. | From the Definer catalog, open the TRAVELCOMPONENT Web Service Component that you defined in Web Service Example 1: Define a Web Service Component. |
15. | Click the Refresh button. |
16. | In the Refresh Web Service Component dialog, select the GetScheduledToursArray method, and click OK. |
| A new GETSCHEDULEDTOURSARRAY method is added. |
17. | Open the application that contains the web service component, and in the SQL command dialog, issue SQL statement: |
INVOKE TRAVELCOMPONENT.GETSCHEDULEDTOURSARRAY
WITH
SELECT 'AUSTRALIA'
| All scheduled tours to this destination are returned in array format. |
|