Auf Englisch lesen

Teilen über


OperationFormatUse Enumeration

Definition

Bestimmt das Format der Nachricht.

C#
public enum OperationFormatUse
Vererbung
OperationFormatUse

Felder

Encoded 1

Bedeutet, dass die Schemen in der WSDL abstrakte Spezifikationen sind, die gemäß den Regeln in SOAP 1.1 Abschnitt 5 codiert werden.

Literal 0

Deutet an, dass die Nachricht eine Literalinstanz des Schemas in der WSDL ist.

Beispiele

Der folgende Code veranschaulicht die Verwendung dieser Enumeration.

C#
[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);
}

Hinweise

Der Standardwert ist Literal. Literal bedeutet, dass die Nachricht eine Literalinstanz des Schemas im WSDL ist, wie im folgenden Dokument/Literal-Beispiel dargestellt.

<Add xmlns="http://Microsoft.ServiceModel.Samples">  
  <n1>100</n1>  
  <n2>15.99</n2>  
 </Add>  

Encoded bedeutet, dass die Schemen in der WSDL abstrakte Spezifikationen sind, die gemäß den Regeln in SOAP 1.1, Abschnitt 5 codiert werden. Es folgt ein RPC/Encoded-Beispiel.

<q1:Add xmlns:q1="http://Microsoft.ServiceModel.Samples">  
  <n1 xsi:type="xsd:double" xmlns="">100</n1>  
  <n2 xsi:type="xsd:double" xmlns="">15.99</n2>  
 </q1:Add>  

Verwenden Sie System.ServiceModel.XmlSerializerFormatAttribute, um diesen Wert festzulegen.

Gilt für

Produkt Versionen
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8