本文整理匯總了C#中System.Web.Services.Description.OutputBinding類的典型用法代碼示例。如果您正苦於以下問題:C# OutputBinding類的具體用法?C# OutputBinding怎麽用?C# OutputBinding使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OutputBinding類屬於System.Web.Services.Description命名空間,在下文中一共展示了OutputBinding類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreateOperationBinding
// Used to create OperationBinding instances within 'Binding'.
public static OperationBinding CreateOperationBinding(string operation,
string targetNamespace)
{
// Create OperationBinding 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 an extensibility element for SoapOperationBinding.
SoapOperationBinding mySoapOperationBinding = new SoapOperationBinding();
mySoapOperationBinding.Style = SoapBindingStyle.Document;
mySoapOperationBinding.SoapAction = targetNamespace + operation;
// Add the extensibility element SoapOperationBinding to OperationBinding.
myOperationBinding.Extensions.Add(mySoapOperationBinding);
return myOperationBinding;
}