Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

OperationFormatStyle Enumeration

Represents the SOAP style that determines how the WSDL metadata for the service is formatted.

Namespace: System.ServiceModel
Assembly: System.ServiceModel (in system.servicemodel.dll)

public enum OperationFormatStyle
public enum OperationFormatStyle
public enum OperationFormatStyle
 Member nameDescription
DocumentCauses the WSDL representation to contain a single element that represents the document that is exchanged for the operation. 
RpcCauses the WSDL representation of messages exchanged for an operation and contains parameters as if it were a remote procedure call. 

By default, the message body is formatted with the Style set to Document. The style RPC means that the WSDL representation of messages exchanged for an operation contains parameters as if it were a remote procedure call. The following is an example.

  <wsdl:message name="IUseAndStyleCalculator_Add_InputMessage">
    <wsdl:part name="n1" type="xsd:double"/>
    <wsdl:part name="n2" type="xsd:double"/>
  </wsdl:message>

Setting the style to Document means that the WSDL representation contains a single element that represents the document that is exchanged for an operation as shown in the following example.

  <wsdl:message name="IUseAndStyleCalculator_Add_InputMessage">
    <wsdl:part name="parameters" element="tns:Add"/>
  </wsdl:message>

Use the System.ServiceModel.XmlSerializerFormatAttribute to set this value.

The following code shows how to use this enumeration.

[ServiceContract(Namespace="http://Microsoft.ServiceModel.Samples"),
XmlSerializerFormat(Style = OperationFormatStyle.Rpc, 
                                 Use = OperationFormatUse.Encoded)]
public interface IUseAndStyleCalculator
{
    [OperationContract]
    double Add(double n1, double n2);
    [OperationContract]
    double Subtract(double n1, double n2);
    [OperationContract]
    double Multiply(double n1, double n2);
    [OperationContract]
    double Divide(double n1, double n2);
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.