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:
1. | In the Web Services (Provider) window, query the TRAVELSERVICE web service provider that you defined in Example 1. |
2. | On the Methods tab page, define a GetSchedtoursBetween method, set the Operation Style to: RPC-oriented, and set the Method Call to: Synchronous. |
SELECT count(*) "NumberOfScheduledTours"
FROM schedtour st
WHERE st.start_date BETWEEN :start_date AND :end_date
4. | Click the Check button, and in the Question dialog, click Yes. |
| 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 IO Format is the default IO format for representing date values in XML. |
6. | For the GetSchedtoursBetween method, change some attributes of the two input parameters: |
7. | Change the Domain to: DATE_DOMAIN_IO. |
8. | Change the XML Data Type to: date. |
10. | Click the Create Web Service button. |
| The web server publication folder now contains an up-to-date TRAVELSERVICE.ashx and web.config files. |
11. | Click the Create WSDL File button. |
| The web server publication folder now contains an up-to-date TRAVELSERVICE.wsdl file. |
12. | Restart the Rules Service for the TRAVEL application that you configured in Example 1. |
14. | Click the Refresh button. |
15. | In the Refresh Web Service Component dialog, select the GetSchedtoursBetween method, and click OK. |
| A new GETSCHEDTOURSBETWEEN method is added. The Data Type of the input parameters is set to: Date. |
16. | Open the application that contains the web service component, and in the SQL command dialog, issue SQL statement: |
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.
See Also
Web Service Example 2: SOAP request and response messages
|