Web Service Example 2: RPC-Oriented Method with Simple Type Parameters Based on a Domain

Previous Next

See Also

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.

 

3. Define SQL statement:

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.

5. Define a new domain:

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.

6. For the GetSchedtoursBetween method, change some attributes of the two input parameters:
· Change the Domain to: DATE_DOMAIN_IO.

 

· Change the XML Data Type to: date.
7. Save your changes.

 

8. Click the Create Web Service button.

The web server publication folder now contains an up-to-date TRAVELSERVICE.xml, TRAVELSERVICE.asp file, and TRAVELSERVICE.inc file.

9. Click the Create WSDL File button.

The web server publication folder now contains an up-to-date TRAVELSERVICE.wsdl file.

10. Restart the Rules Service for the TRAVEL application that you configured in Example 1.

 

11. From the Definer catalog, open the TRAVELCOMPONENT Web Service Component that you defined in Web Service Example 1: Define a Web Service Component.

 

12. Click the Refresh button.

 

13. 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.

14. 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.

Related Topics

Web Service Example 2: SOAP request and response messages