Partager via


Message Element (Windows Embedded CE 6.0)

1/6/2010

The <message> element in a Web Services Description Language (WSDL) file describes the logical contents of the messages being communicated.

Each <message> element consists of logical parts described by the <part> child element.

In the sample WSDL file, each <part> element has a name and a type attribute that specify the message part name and its data type, respectively. If a <message> element contains multiple logical parts, it specifies multiple <part> elements.

The following code example shows the <message> elements for the Add operation:

...
<message name='Calc.Add'>
    <part name='A' type='xsd:double'/>
    <part name='B' type='xsd:double'/>
  </message>
  <message name='Calc.AddResponse'>
    <part name='Result' type='xsd:double'/>
  </message>
...

In this example, two <message> elements correspond to the request and response messages for the Add operation:

  • The request message, Add, is the message sent in the SOAP body when the client sends a message to the server requesting the Add operation (the operation name is the wrapper element for the SOAP message).
    This message has two <part> elements. Each of these <part> elements identifies one of the two numbers to be added together ("A" and "B") and specifies that each number is a double integer.
  • The response message, AddResponse, is the message sent from the server back to the client upon completion of the requested operation. (The operation name + "Response" is used as the wrapper element for the message in the SOAP response.) This message has only one <part> element.
    This element represents the return value of the operation. In this example, the return value is the sum of the two numbers sent in the request message.

These message definitions are abstract definitions of the contents of various messages.

The message bindings describe how to map the abstract content into a concrete format. In the Calc application, the abstract definition of the message is the same as the concrete format.

In this case, the bindings provide no additional mapping information. In other applications, the message definition might require extensive mapping information.

See Also

Concepts

About the Calc.wsdl File
Types Element
PortType Element
Binding Element
Service Element