Skip navigation

XML-based webservices make use of XML messages for communication. While working with JAX-WS , programmers work with SEI (Service Endpoint Interface) which simplify and hide the details of converting between Java method invocations and their associated XML messages.But if you want to work directly with XML messages you can consider using Dispatch interface. Dispatch client API (javax.xml.ws.Dispatch) is a low level API that requires clients to construct messages or message payloads as XML.
Using Dispatch, the client can send data in either MESSAGE or PAYLOAD mode.

MESSAGE Mode : Using the MESSAGE mode (javax.xml.ws.Service.Mode.MESSAGE), the Dispatch client works directly with the message . The entire SOAP envelope (<soap:Envelope>,<soap:Header>, and <soap:Body>) is provided by the client.

PAYLOAD Mode : Using the PAYLOAD (javax.xml.ws.Service.Mode.PAYLOAD ) mode, the Dispatch client wokrs with the payload of the message . The client is responsible for providing the contents of the . The element is provided by JAX-WS.

The Dispatch client implementations should support following types of objects:

Type of Object

Description

Bindings Supported

javax.xml.transform.Source

Clients can use XML generating and consuming API’s directly

HTTP & SOAP

JAXB Objects

Clients use JAXB generated objects

HTTP & SOAP

javax.xml.soap.SOAPMessage

Clients work with SOAP messsages

SOAP binding in Message mode

javax.activation.DataSource

Clients work with MIME-types messages

HTTP binding in Message mode

Advertisements

One Comment

  1. I find this code very useful. I assume that the purpose of posting a reply to the client is to confirm to the client that the message has indeed been processed?
    Do you mind giving me the sample EAR file that you have tested already? I have JBoss 5 running on my system. I would like to try it on that.
    Thanks very much.
    ilango


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: