Web Service Example 4: Document-Oriented Method with Simple Type Parameters |
First complete Web Service Example 1: RPC-Oriented Method with Simple Type Parameters. This example is an add-on. In this example, you extend the TRAVELSERVICE web service provider with a documented-oriented GETTOURSDocument method that retrieves Tour details for a specified destination and tour type. Functionally, this is equivalent to Web Service Example 1. The difference is that for a documented-oriented method, the body of the SOAP request and response messages must contain one or more XML documents. This has an impact in three places:
So the SELECT clause of the SQL Statement of the method reads: SELECT '<DestinationResponse>'||destination||'</DestinationResponse>', '<TourTypeResponse>'||tour_type||'</TourTypeResponse>', '<NumDaysResponse>'||num_days||'</Num_DaysResponse>', '<DescriptionResponse>'||description||'</DescriptionResponse>' FROM tour
INVOKE TRAVELCOMPONENT.GETTOURSDocument WITH SELECT '<DestinationRequest xmlns="http://MyWebServer/TravelService/TRAVELSERVICE.wsdl"> AUSTRALIA</DestinationRequest>' ,'<TourTypeRequest xmlns="http://MyWebServer/TravelService/TRAVELSERVICE.wsdl"> ISLAND SUNTANNER</TourTypeRequest>'
You can use the internal USXSL component. The WHERE clause of the SQL Statement of the method reads: WHERE destination = USXSL.value(:DestinationRequest ,'/ns:DestinationRequest' ,'xmlns:ns="http://MyWebServer/TravelService/TRAVELSERVICE.wsdl"') AND tour_type = USXSL.value(:TourTypeRequest ,'/ns:TourTypeRequest' ,'xmlns:ns="http://MyWebServer/TravelService/TRAVELSERVICE.wsdl"') For details, refer to See Also topic: The USXSL Component. Next: Web Service Example 4: Step-by-Step Instructions. Related Topics |