Web Service Example 3: RPC-Oriented Method with a Complex Type Parameter Based on a Domain with Allowed Values |
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 InsertTour method that inserts a Tour record. One of the inserted column values is a maximum age. The corresponding AGE domain has four allowed values. You have to write an XML Schema (XSD) definition to let the client application know that these restrictions exist. To define an RPC-oriented method that inserts a Tour record:
INSERT INTO TOUR(destination,tour_type, num_days, max_age) VALUES ( :destination, :tour_type, :num_days, :max_age )
Four input parameters are generated.
Namespace Alias: InsertTour Namespace: urn:InsertTour Location: http://MyWebServer/TravelService/InsertTour.xsd
This parameter is based on a domain with an IO Format other than: XML. The parameter name (max_age), is not included in the XML document. USoft automatically handles the parameter name.
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 INSERTTOUR method is added.
INVOKE TRAVELCOMPONENT.INSERTTOUR WITH SELECT 'AUSTRALIA','SCENIC',28,'<max_age>36</max_age>' You will get an error message, because 36 is not an allowed value. If you execute the same statement with value 35, an insert takes place, including a commit by the web service provider. Related Topics Web Service Example 3: XML Schema Definition for an AGE type with Allowed Values |