OperationFormatUse 列挙型

定義

メッセージの形式を決定します。

public enum class OperationFormatUse
public enum OperationFormatUse
type OperationFormatUse = 
Public Enum OperationFormatUse
継承
OperationFormatUse

フィールド

Encoded 1

WSDL 内のスキーマが、SOAP 1.1 のセクション 5 に規定されているルールに従ってエンコードされる抽象仕様であることを意味します。

Literal 0

メッセージが、WSDL 内のスキーマのリテラル インスタンスであることを意味します。

この列挙体の使用方法を次のコード例に示します。

[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

注釈

既定値は Literal です。 Literal は、次の Document/Literal の例に示すように、メッセージが WSDL 内のスキーマのリテラル インスタンスであることを意味します。

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

Encoded は、WSDL 内のスキーマが、SOAP 1.1 のセクション 5 に規定されているルールに従ってエンコードされる抽象仕様であることを意味します。 RPC/Encoded の例を次に示します。

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

System.ServiceModel.XmlSerializerFormatAttribute を使用してこの値を設定します。

適用対象