OperationFormatStyle 열거형

정의

서비스의 WSDL 메타데이터 형식 지정 방법을 결정하는 SOAP 스타일을 나타냅니다.

public enum class OperationFormatStyle
public enum OperationFormatStyle
type OperationFormatStyle = 
Public Enum OperationFormatStyle
상속
OperationFormatStyle

필드

Document 0

WSDL 표현에 작업에 대해 교환된 문서를 나타내는 요소가 하나 포함되도록 합니다.

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 표현에 작업에 대해 교환되는 문서를 나타내는 단일 요소가 포함됩니다.

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

System.ServiceModel.XmlSerializerFormatAttribute 이 값을 설정하려면 이 값을 사용합니다.

적용 대상