Binding.Operations 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
XML Web services에서 지원하는 작업에 사용되는 데이터 형식 및 메시지 프로토콜에 대한 사양 컬렉션을 가져옵니다.
public:
property System::Web::Services::Description::OperationBindingCollection ^ Operations { System::Web::Services::Description::OperationBindingCollection ^ get(); };
public System.Web.Services.Description.OperationBindingCollection Operations { get; }
member this.Operations : System.Web.Services.Description.OperationBindingCollection
Public ReadOnly Property Operations As OperationBindingCollection
속성 값
XML Web services에서 지원하는 작업에 사용되는 데이터 형식 및 메시지 프로토콜에 대한 사양 컬렉션을 포함하는 OperationBindingCollection 개체입니다.
예제
다음 예제에서는의 일반적인 용도 Operations
속성입니다.
// Create OperationBindings for each of the operations defined in asmx file.
OperationBinding^ addOperationBinding = CreateOperationBinding( "Add", myServiceDescription->TargetNamespace );
myBinding->Operations->Add( addOperationBinding );
OperationBinding^ subtractOperationBinding = CreateOperationBinding( "Subtract", myServiceDescription->TargetNamespace );
myBinding->Operations->Add( subtractOperationBinding );
OperationBinding^ multiplyOperationBinding = CreateOperationBinding( "Multiply", myServiceDescription->TargetNamespace );
myBinding->Operations->Add( multiplyOperationBinding );
OperationBinding^ divideOperationBinding = CreateOperationBinding( "Divide", myServiceDescription->TargetNamespace );
myBinding->Operations->Add( divideOperationBinding );
// Create OperationBindings for each of the operations defined in asmx file.
OperationBinding addOperationBinding = CreateOperationBinding("Add",myServiceDescription.TargetNamespace);
myBinding.Operations.Add(addOperationBinding);
OperationBinding subtractOperationBinding = CreateOperationBinding("Subtract",myServiceDescription.TargetNamespace);
myBinding.Operations.Add(subtractOperationBinding);
OperationBinding multiplyOperationBinding = CreateOperationBinding("Multiply",myServiceDescription.TargetNamespace);
myBinding.Operations.Add(multiplyOperationBinding);
OperationBinding divideOperationBinding = CreateOperationBinding("Divide",myServiceDescription.TargetNamespace);
myBinding.Operations.Add(divideOperationBinding);
' Create OperationBindings for each of the operations defined in asmx file.
Dim addOperationBinding As OperationBinding = CreateOperationBinding("Add", myServiceDescription.TargetNamespace)
myBinding.Operations.Add(addOperationBinding)
Dim subtractOperationBinding As OperationBinding = CreateOperationBinding("Subtract", myServiceDescription.TargetNamespace)
myBinding.Operations.Add(subtractOperationBinding)
Dim multiplyOperationBinding As OperationBinding = CreateOperationBinding("Multiply", myServiceDescription.TargetNamespace)
myBinding.Operations.Add(multiplyOperationBinding)
Dim divideOperationBinding As OperationBinding = CreateOperationBinding("Divide", myServiceDescription.TargetNamespace)
myBinding.Operations.Add(divideOperationBinding)
// Used to create OperationBinding instances within 'Binding'.
public:
static OperationBinding^ CreateOperationBinding( String^ operation, String^ targetNamespace )
{
// Create OperationBinding instance for operation.
OperationBinding^ myOperationBinding = gcnew OperationBinding;
myOperationBinding->Name = operation;
// Create InputBinding for operation.
InputBinding^ myInputBinding = gcnew InputBinding;
SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding;
mySoapBodyBinding->Use = SoapBindingUse::Literal;
myInputBinding->Extensions->Add( mySoapBodyBinding );
// Create OutputBinding for operation.
OutputBinding^ myOutputBinding = gcnew OutputBinding;
myOutputBinding->Extensions->Add( mySoapBodyBinding );
// Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'.
myOperationBinding->Input = myInputBinding;
myOperationBinding->Output = myOutputBinding;
// Create extensibility element for 'SoapOperationBinding'.
SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding;
mySoapOperationBinding->Style = SoapBindingStyle::Document;
mySoapOperationBinding->SoapAction = String::Concat( targetNamespace, operation );
// Add extensibility element 'SoapOperationBinding' to 'OperationBinding'.
myOperationBinding->Extensions->Add( mySoapOperationBinding );
return myOperationBinding;
}
// Used to create OperationBinding instances within 'Binding'.
public static OperationBinding CreateOperationBinding(string operation,string targetNamespace)
{
// Create OperationBinding instance for operation.
OperationBinding myOperationBinding = new OperationBinding();
myOperationBinding.Name = operation;
// Create InputBinding for operation.
InputBinding myInputBinding = new InputBinding();
SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding();
mySoapBodyBinding.Use = SoapBindingUse.Literal;
myInputBinding.Extensions.Add(mySoapBodyBinding);
// Create OutputBinding for operation.
OutputBinding myOutputBinding = new OutputBinding();
myOutputBinding.Extensions.Add(mySoapBodyBinding);
// Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'.
myOperationBinding.Input = myInputBinding;
myOperationBinding.Output = myOutputBinding;
// Create extensibility element for 'SoapOperationBinding'.
SoapOperationBinding mySoapOperationBinding = new SoapOperationBinding();
mySoapOperationBinding.Style = SoapBindingStyle.Document;
mySoapOperationBinding.SoapAction = targetNamespace + operation;
// Add extensibility element 'SoapOperationBinding' to 'OperationBinding'.
myOperationBinding.Extensions.Add(mySoapOperationBinding);
return myOperationBinding;
}
' Used to create OperationBinding instances within 'Binding'.
Public Shared Function CreateOperationBinding(operation As String, targetNamespace As String) As OperationBinding
' Create OperationBinding instance for operation.
Dim myOperationBinding As New OperationBinding()
myOperationBinding.Name = operation
' Create InputBinding for operation.
Dim myInputBinding As New InputBinding()
Dim mySoapBodyBinding As New SoapBodyBinding()
mySoapBodyBinding.Use = SoapBindingUse.Literal
myInputBinding.Extensions.Add(mySoapBodyBinding)
' Create OutputBinding for operation.
Dim myOutputBinding As New OutputBinding()
myOutputBinding.Extensions.Add(mySoapBodyBinding)
' Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'.
myOperationBinding.Input = myInputBinding
myOperationBinding.Output = myOutputBinding
' Create extensibility element for 'SoapOperationBinding'.
Dim mySoapOperationBinding As New SoapOperationBinding()
mySoapOperationBinding.Style = SoapBindingStyle.Document
mySoapOperationBinding.SoapAction = targetNamespace + operation
' Add extensibility element 'SoapOperationBinding' to 'OperationBinding'.
myOperationBinding.Extensions.Add(mySoapOperationBinding)
Return myOperationBinding
End Function 'CreateOperationBinding