@jws:protocol Tag

Specifies which protocols and message formats a web service can accept or a Service control will send to the service it represents.

# Syntax

    @jws:protocol
    	form-get="true | false"
    	form-post="true | false"
    	http-soap="true | false"
    	http-xml="true | false"
    	jms-soap="true | false"
    	jms-xml="true | false"
    	soap-style="document | rpc"

# Attributes

form-get

Specifies that messages encoded as HTTP GET requests are understood.

Default: true.

form-post

Specifies that messages encoded as HTTP POST requests are understood.

Default: true.

http-soap

Specifies that SOAP messages conveyed over HTTP are understood.

Default: true.

http-xml

Specifies that XML messages conveyed over HTTP are understood. Note: cannot be used with conversational methods or callbacks. See below.

Default: false.

jms-soap

Specifies that SOAP messages conveyed over JMS are understood.

Default: false.

jms-xml

Specifies that XML messages conveyed over JMS are understood. Note: cannot be used with conversational methods or callbacks. See below.

Default: false.

soap-style

Specifies which of the two method call styles specified by SOAP is supported. "document" specifies the style commonly referred to as "document literal". "rpc" specifies the style commonly referred to as "SOAP RPC".

Default: "document".

# Remarks

The following rules apply to this tag's use:

- A single @jws:protocol tag may appear within a single Javadoc comment block.

- Optionally may appear in front of a class in a JWS file.

- Optionally may appear in front of an interface in a CTRL file.

The @jws:protocol tag specifies which network protocols and message formats may be used to communicate with a web service.

##### When Applied to a Class in a JWS File

When applied to a class in a JWS file, @jws:protocol tag specifies which protocols and messages formats the web service is able to receive. The web service will listen for requests on the listed protocols and will understand messages that arrive in the listed formats.

The default behavior for a JWS file is to enable SOAP with "document literal" formatting of method calls, via HTTP POST, and HTTP GET.

##### When Applied to an Interface in a CTRL File

A Service control's CTRL file must specify a single protocol binding.

The Service control represents a web service, referred to as the target service. The target service's WSDL description specifies which protocols and message formats the target service accepts. The Service control's interface in its CTRL file must contain a @jws:protocol tag that selects exactly one of the protocol/message format combinations the target service is capable of receiving.

##### Raw XML Protocols (http-xml and jms-xml) Do Not Support Conversations

WebLogic Workshop uses SOAP headers to convey conversation ID and other conversational information. Raw XML messages don't carry SOAP headers and therefore cannot participate in conversations.

##### Callback Protocol is Inferred

The protocol and message format used for callbacks is always the same as the protocol and message format used by the start method that started the current conversation. It is an error to attempt to override the protocol or message format of a callback.

# Examples

The @jws:location tag is used to control protocol bindings for a web service. Consider the following example:

    /**
     * @jws:protocol http-get="true" http-post="false" http-soap="false"
     */

A web service with this @jws:protocol tag:

- Will not accept HTTP SOAP messages.

- Will accept form-based GET messages.

- Will not accept form-based POST messages.

In the example CTRL file below, the @jws:location tag specifies a URL for the Bank.jws web service that this CTRL file represents, and the @jws:protocol tag specifies that this Service control will communicate with the BankControl using SOAP over HTTP.

    import weblogic.jws.control.ServiceControl;

    /**
     * @jws:location http-url="http://localhost:7001/webapp/Bank.jws"

     * @jws:protocol http-soap="true"
     */
    public interface BankControl extends ServiceControl
    {
    }

Related Topics

@jws:location Tag

WSDL Files: Web Service Descriptions

Service Control: Using Another Web Service