OperationFormatStyle 列挙型

定義

サービスの WSDL メタデータの書式設定方法を決定する SOAP スタイルを表します。

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

フィールド

名前 説明
Document 0

WSDL 表現に、操作と交換されるドキュメントを表す 1 つの要素を含めます。

Rpc 1

操作と交換されたメッセージの 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

注釈

既定では、メッセージ本文はスタイルが [ドキュメント] に設定された状態で書式設定されます。 RPCスタイルは、操作と交換されるメッセージの WSDL 表現に、リモート プロシージャ 呼び出しであるかのようにパラメーターが含まれていることを意味します。 以下に例を示します。

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

スタイルを Document に設定すると、WSDL 表現には、次の例に示すように、操作と交換されるドキュメントを表す 1 つの要素が含まれます。

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

この値を設定するには、 System.ServiceModel.XmlSerializerFormatAttribute を使用します。

適用対象