# Specifying the Default Protocol and Message Format

When you modify a Web Service control to use a different protocol or message format, you must choose a protocol or message format that the target web service supports. You can determine these protocols and message formats by examining the target service's WSDL file.

## Setting a Web Service Control's Default Protocol

A protocol is a low-level network scheme for passing messages between systems. To better understand protocols, imagine that a message is a conventional letter and the message format defines the possible content and interpretation of the letter. The protocol would describe the nature of an envelope and how to print an address on an envelope.

The standards on which web services are based allow a web service to support a variety of protocols and message formats. For example, a web service may support communication via HTTP (Hyper Text Transport Protocol, the basic protocol of web browsers and servers) and/or JMS (Java Message Service, a J2EE protocol used to pass messages). It may support other protocols as well.

Although a web service may support multiple protocols or message formats, when WebLogic Workshop creates a Web Service control for an application, one protocol and one message format are chosen as the default.

You can modify the protocol that a Web Service control uses to communicate with its target web service using the @jc:protocol annotation. This annotation specifies which protocols and message formats a web service can accept or a Web Service control will send to the service it represents.

To learn more about specifying protocols, see @jc:protocol annotation.

## Choosing a Message Format

The standards that make web services possible allow for multiple formats of the messages that pass between applications. The most frequently used standard for web services messages is SOAP. SOAP defines two formats for messages that represent method invocations: Document Literal and SOAP Remote Procedure Call (RPC).

WebLogic Workshop uses Document Literal as its default message format, but is capable of communicating using SOAP RPC, which other development tools may use as their default message format. When you wish to implement communications between two applications developed using different tools, you need to ensure that both are using the same message format. You can do this in two ways. You can specify what format your application expects and dictate that choice to the developer of the other web service, or you can select an alternative format that allows your application to accept the other web service's default format.

To specify the message format that a web service uses to communicate with the Web Service control, you can set the soap-style attribute of the @jc:protocol annotation to document for the Document Literal message format or rpc for the SOAP RPC format.

## Specifying Per-Service and Per-Method Settings

You can specify protocols and message formats on a Web Service control or on a method of a Web Service control. The settings on the Web Service control apply to all methods and callbacks by default. If a method or callback specifies different protocol or message format settings, those settings override the default settings from the Web Service control.

Related Topics

@jc:protocol Annotation