Web Service Example 2: RPC-Oriented Method with Simple Type Parameters Based on a Domain |
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 an RPC-oriented GetSchedtoursBetween method that retrieves the number of scheduled tours between two dates. These two input parameters are based on a DATE domain. This ensures that the input parameter values conform to the XML Data Type specified for this parameter. To define an RPC-oriented method that retrieves the number of scheduled tours between two dates:
SELECT count(*) "NumberOfScheduledTours" FROM schedtour st WHERE st.start_date BETWEEN :start_date AND :end_date
Two input parameters and one number_of_scheduled_tours output parameter are generated.
Domain Name: DATE_DOMAIN_IO Data Type: DATE IO Format: YYYY-MM-DD This is the default IO format for representing date values in XML.
The web server publication folder now contains an up-to-date TRAVELSERVICE.xml, TRAVELSERVICE.asp file, and TRAVELSERVICE.inc file.
The web server publication folder now contains an up-to-date TRAVELSERVICE.wsdl file.
A new GETSCHEDTOURSBETWEEN method is added. The Data Type of the input parameters is set to: Date.
INVOKE TRAVELCOMPONENT.GETSCHEDTOURSBETWEEN WITH SELECT sysdate, to_date('01-01-2012','dd-mm-yyyy') The number of scheduled tours is returned. For background information about all SOAP messages sent, refer to: Web Service Example 2: SOAP request and response messages. Related Topics |