How to Define a Web Service and its Methods

Previous Next

See Also

The first step when providing a web service is to create its definition in the Definer.

To define a web service and its methods:

1. In the Definer catalog, click Web Services (Provider).

You can also select Web Services from the Define, Web Services Provider menu.

The Web Services (Provider) info window appears.

2. Enter a Service Name for your web service and a description (optional).

The name of the service must be unique (case insensitive), and a web service provider cannot have the same name as an RDMI component.

3. On the Methods tab page, enter a name for a method.

The method name must be unique (case insensitive) within the web service, and must be a valid name for an XML element: it must start with a letter or underscore, and can only contain letters, digits, underscores, hyphens (-), and full stops (.).

4. Choose whether you want the method call to be Synchronous or Asynchronous.

When calling a synchronous method, the client application waits for a response from the web server. When calling an asynchronous method, the client application sends the message and does not wait for a response. The main difference is in error handling. In the case of an error, a synchronous method with no output parameters returns an error message to the client application and an asynchronous method does not.

You are advised to use asynchronous calls only when necessary, because the client application does not receive error messages in the case of an error.

In case of an asynchronous method, if the SQL statement has output expressions and output parameters are created, after checking the method, the service that is generated (WSDL file) has no output parameters.

5. Choose an Operation Style for the method. This can be Document-oriented or RPC-oriented.

For more information, refer to: RPC-oriented methods versus Document-oriented methods.

6. Define a SQL Statement for the method.

This is the actual implementation of the method. Any SQL Statement is allowed (SELECT, INVOKE, UPDATE, DELETE, INSERT). Refer to: SQL Statement Details of a Web Service Provider Method.

Keep in mind the following:

· Document-oriented methods must always receive XML values as input parameters and return XML values as output parameters.

 

· For RPC-oriented methods, the format of the parameters depends on the IO Format of the specified domain.
· If the IO Format is : XML, XML values must be received and returned. Otherwise, there are no restrictions.

For more information, refer to: Rules for Parameter Values.

An input parameter has syntax:

:<input parameter name>

For example, to retrieve a value for the person_name input parameter:

SELECT     age

FROM    person

WHERE    person_name = :person_name