Writing Web Services  Locate

Types of Services  Locate

Overview  Locate

In WSO2 SOA Enablement Server, there are three different types of services, depending on how the services handle the incoming calls:

  1. Java Services: This is the majority of services. They operate on the method call level and map to RPC usage of SOAP.

  2. XML-SOAP Services: A lower level of access to the SOAP message.

  3. Raw Services: A still lower level of access to the SOAP messages themselves, for services that need such low-level access.

Java Services  Locate

In Java services, every incoming request is mapped and deserialized into Java objects and passed as parameters to a method of the service instance as follows:

  1. The appropriate method is selected, based on the WSDL operation name. When methods are overloaded, method selection is based on parameters as well.

  2. When the service method call ends, the return value and the value of all the out parameters (in their respective holder objects) is serialized into the response message.

  3. The response message with the serialized return value and out parameters is returned.

The basics of writing a Java service are covered in Writing Web Services in Jumpstart. Java services using attachments, in/out parameters and remote referencing are covered in the Java Service book.

XML/SOAP Services  Locate

There are two varieties of XML services, each consuming a different type of message, as per the Java API for XML Messaging (JAXM) 1.1 specification. The service instance implements a different interface for each:

Table 1. JAXM Service Types

Type of message consumedInterface implemented by service instance
Request-responsejavax.xml.messaging.ReqRespListener
One-wayjavax.xml.messaging.OnewayListener

Upon receiving an incoming request, the only method of either interface, onMessage(SOAPMessage), is called: the parameter represents the incoming SOAP message. For one-way messages, the method has no return value. For request-response messages, the return value represents the SOAP response message.

Access to incoming SOAP messages is on the XML level, via the SOAP with Attachments API for Java (SAAJ) 1.1.

Please see XML/SOAP Service for more information.

Raw Services  Locate

In raw services, the service instance must implement the interface org.systinet.wasp.webservice.RawService.

Upon an incoming request, the only method of that interface, process(Connection), is called: the parameter represents a connection from which the service instance can access the incoming and outgoing messages. The incoming and outgoing messages are, respectively, extensions of Java's InputStream and OutputStream classes. These classes add support for MIME and DIME meta-data (headers) and for multi-part messages to the functionality of a byte stream.

The transport level, transparent in higher-level services, must be dealt with directly through the transport API. For more information, see Transport Use Cases.