How to Create DISH Services

SAP Sybase IQ allows you to create DISH services that act as SOAP endpoints for groups of SOAP services. DISH services also automatically construct WSDL (Web Services Description Language) documents that allow SOAP client toolkits to generate the interfaces necessary to interchange data with the SOAP services described by the WSDL.

SOAP services can be added and removed without requiring maintenance to the DISH services because the current working set of SOAP over HTTP services are always exposed.

Example

Execute the following SQL statements in Interactive SQL to create sample SOAP and DISH services in the HTTP web server:

CREATE SERVICE "Samples/TestSoapOp"
    TYPE 'SOAP'
    DATATYPE ON
    USER DBA
    AUTHORIZATION OFF
    AS CALL sp_echo(:i, :f, :s);

CREATE PROCEDURE sp_echo(i INTEGER, f REAL, s LONG VARCHAR)
RESULT( ret_i INTEGER, ret_f REAL, ret_s LONG VARCHAR )
BEGIN
	SELECT i, f, s;
END;

CREATE SERVICE "dnet_endpoint"
    TYPE 'DISH'
    GROUP "Samples"
    FORMAT 'DNET';

The first CREATE SERVICE statement creates a new SOAP service named Samples/TestSoapOp.

The second CREATE SERVICE statement creates a new DISH service named dnet_endpoint. The Samples portion of the GROUP clause identifies the group of SOAP services to expose. You can view the WSDL document generated by the DISH service. When running your SAP Sybase IQ web server on a computer, you can access the service using the http://localhost:port-number/dnet_endpoint URL, where port-number is the port number that the server is running on.

In this example, the SOAP service does not contain a FORMAT clause to indicate a SOAP response format. Therefore, the SOAP response format is dictated by the DISH service, which does not override the FORMAT clause of the SOAP service. This feature allows you to create homogeneous DISH services where each DISH endpoint can serve SOAP clients with varying capabilities.

Creating homogeneous DISH services

When SOAP service definitions defer the specification of the FORMAT clause to the DISH service, a set of SOAP services can be grouped together within a DISH service that defines the format. Multiple DISH services can then expose the same group of SOAP services with a different FORMAT specifications. If you expand on the TestSoapOp example, you can create another DISH service named java_endpoint using the following SQL statement:

CREATE SERVICE "java_endpoint"
    TYPE 'DISH'
    GROUP "Samples"
    FORMAT 'CONCRETE';

In this example, the SOAP client receives a response object named TestSoapOp_Dataset when it makes a web service request for the TestSoapOp operation through the java_endpoint DISH service. The WSDL can be inspected to compare the differences between dnet_endpoint and java_endpoint. Using this technique, a SOAP endpoint can quickly be constructed to meet the needs of a particular SOAP client toolkit.