Customizing a Service Control: Specifying the Default Protocol and Message Format

This topic describes customizations you can make to a Service control's CTRL file to modify the control's default behavior.

To learn more about controls, see Controls: Using Resources from a Web Service.

To learn more about Service controls, see Service Control: Using Another Web Service.

To learn more about customizing Service controls, see Customizing a Service Control: Overview.

# Changing a Service Control's Default Protocol or Message Format

In some situations, you may wish to modify the Service control to use a different protocol or message format. Of course, you must choose a protocol or message format that the target web service supports. You can determine the set of protocols and message formats the web service supports by examining the service's WSDL file.

Note: this topic is narrowly focused on modifications you may make to Service control CTRL files, which will influence the protocol and message format used to communicate with existing web service. When developing a new web service with WebLogic Workshop, you may specify that your web service supports multiple protocols and message formats. Should you do so, clients will be able to choose which formats they wish to use to communicate with your web service.

## Per-Service and Per-Method Settings

Protocols and message formats may be specified on a Service control or on a method of a Service control. The settings on the 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 Service control.

## Protocols

A protocol is a low level network scheme for passing messages between systems. Using an analogy of postal mail, the protocol describes the nature of an envelope and how to print an address on an envelope. The message format defines the possible content and interpretation of the letter inside the 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 SMTP (Simple Mail Transport Protocol, the protocol used by email systems to pass messages). It may support other protocols as well.

While a web service may advertise that it supports multiple protocols or message formats, when WebLogic Workshop creates a Service control for a web service, one protocol and one message format are chosen as the default.

# Setting a Service Control's Default Protocol

You can modify the protocol that a Service control uses to communicate with its target web service using the @jws:protocol tag.

To learn more about specifying protocols, see @jws:protocol Tag.

## Message Formats

The standards that make web services possible allow for multiple formats of the messages that pass between web services. The central standard for web services messages is SOAP. SOAP defines two formats for messages that represent web service method invocations. These are referred to as Document Literal and SOAP RPC (Remote Procedure Call).

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

# Setting a Service Control's Default Message Format

You can modify the message format that a Service control uses to communicate with its target web service using the @jws:location tag.

To learn more about specifying message formats, see @jws:protocol Tag.

Related Topics

@jws:location Tag