Supported Message Formats

Once you chosen a protocol – HTTP or JMS – you can choose which formats to support for the messages that you send and receive over it. The message format describes how the message is prepared to be sent over the protocol. For example, your web service can format data as a SOAP message, the most common format for web services, to send over either HTTP or JMS. Or it can format data in raw XML, to send over either HTTP or JMS.

A web service can support multiple protocols and message formats, as can a method or callback on the web service. To specify which protocols and message formats are supported for a service or for an individual method or callback, select the service, method, or callback in Design view and set the attributes of the protocol property. The attributes of the protocol property are described below:

The various combinations of protocols and message formats available in WebLogic Workshop are described below:

- http-soap: Messages are SOAP-formatted and delivered over HTTP. This is the most common protocol and message format for web services. If your web service supports this protocol, you can also specify whether the soap-style is set to document or RPC. By default http-soap is set to true.

- form-post: To receive data from a form in a web browser, your web service can support form POST over HTTP. Form POST encodes the form data as a set of name-value pairs and transports the data in the body of the HTTP POST request. The HTTP POST request is MIME-encoded; its MIME type is "application/x-url-formencoded". No SOAP headers are sent with form-post. By default form-post is set to true.

- form-get: To receive data from a form in a web browser, your web service can support form GET over HTTP. Form GET encodes the form data as a set of name-value pairs that are transmitted on the URL when the form is submitted. No SOAP headers are sent with form-get. By default form-get is set to true.

- http-xml: Messages are sent as raw XML over HTTP, without SOAP headers. The XML is transmitted over HTTP POST, but in this case the encoding type is set to “text/xml”, which is not form-compatible. By default http-xml is set to false.

- jms-soap: Messages are SOAP-formatted and delivered over a JMS queue. You can specify whether the soap-style is set to document or RPC. By default jms-soap is set to false.

- jms-xml: Messages are sent as raw XML over a JMS queue, without SOAP headers. The MIME type is set to “text/xml”. By default jms-xml is set to false.

- soap-style: SOAP-formatted messages can be formatted according to either of two encoding styles, document or rpc. Document-style encoding is the more flexible style, because the developer can determine the shape of the XML data and how it maps to Java data structures. RPC-style encoding is a stricter style and does not permit the developer to configure XML data. By default, soap-style is set to document.

Notes:

- In order to use Test View to test and debug your web service or an individual method or callback, the service, method, or callback must support HTTP GET; that is, the form-get attribute must be set to true.

- If your web service sends and receives messages through either of the raw XML protocols, http-xml and jms-xml, note that WebLogic Workshop cannot manage conversations for you using these protocols, so callbacks and continue/finish methods will not work automatically.

- If a method using the jms-soap protocol participates in a conversation, any subsequent callbacks that participate in that conversation must be explicitly configured to use the same protocol.

- A service or method that supports the jms-soap protocol can receive a TextMessage object whose body contains the SOAP message. The TextMessage object must have an application-defined property named "URI" that specifies the URI of the target service. For example, to send a message to the service that's at http://myserver:portnumber/myapp/myjws.jws, set the URI property to "/myapp/myjws.jws".

Related Topics

Supported Protocols