OperationFormatUse Enum

Definitie

Bepaalt de indeling van het bericht.

public enum class OperationFormatUse
public enum OperationFormatUse
type OperationFormatUse = 
Public Enum OperationFormatUse
Overname
OperationFormatUse

Velden

Name Waarde Description
Literal 0

Impliceert dat het bericht een letterlijk exemplaar van het schema in de WSDL is.

Encoded 1

Impliceert dat de schema's in de WSDL abstracte specificaties zijn die zijn gecodeerd volgens de regels in SOAP 1.1 sectie 5.

Voorbeelden

De volgende code laat zien hoe u deze opsomming gebruikt.

[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);
}
<ServiceContract(Namespace:="http://Microsoft.ServiceModel.Samples"), _
XmlSerializerFormat(Style:=OperationFormatStyle.Rpc, _
                    Use:=OperationFormatUse.Encoded)> _
Public Interface IUseAndStyleCalculator

    <OperationContract()> _
    Function Add(ByVal n1 As Double, ByVal n2 As Double) As Double

    <OperationContract()> _
    Function Subtract(ByVal n1 As Double, ByVal n2 As Double) As Double

    <OperationContract()> _
    Function Multiply(ByVal n1 As Double, ByVal n2 As Double) As Double

    <OperationContract()> _
    Function Divide(ByVal n1 As Double, ByVal n2 As Double) As Double

End Interface

Opmerkingen

De standaardwaarde is Letterlijk. Letterlijk betekent dat het bericht een letterlijk exemplaar van het schema is in de WSDL, zoals wordt weergegeven in het volgende document-/letterlijke voorbeeld.

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

Gecodeerd betekent dat de schema's in de WSDL abstracte specificaties zijn die zijn gecodeerd volgens de regels in SOAP 1.1 sectie 5. Hier is een RPC/Gecodeerd voorbeeld.

<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>  

Gebruik de System.ServiceModel.XmlSerializerFormatAttribute optie om deze waarde in te stellen.

Van toepassing op