本文整理汇总了C#中System.ServiceModel.Description.WsdlEndpointConversionContext.GetOperationDescription方法的典型用法代码示例。如果您正苦于以下问题:C# WsdlEndpointConversionContext.GetOperationDescription方法的具体用法?C# WsdlEndpointConversionContext.GetOperationDescription怎么用?C# WsdlEndpointConversionContext.GetOperationDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ServiceModel.Description.WsdlEndpointConversionContext
的用法示例。
在下文中一共展示了WsdlEndpointConversionContext.GetOperationDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImportMessageBinding
static internal void ImportMessageBinding(WsdlImporter importer, WsdlEndpointConversionContext endpointContext, Type schemaImporterType)
{
// All the work is done in ImportMessageContract call
bool isReferencedContract = IsReferencedContract(importer, endpointContext);
MarkSoapExtensionsAsHandled(endpointContext.WsdlBinding);
foreach (WsdlNS.OperationBinding wsdlOperationBinding in endpointContext.WsdlBinding.Operations)
{
OperationDescription operation = endpointContext.GetOperationDescription(wsdlOperationBinding);
if (isReferencedContract || OperationHasBeenHandled(operation))
{
MarkSoapExtensionsAsHandled(wsdlOperationBinding);
if (wsdlOperationBinding.Input != null)
{
MarkSoapExtensionsAsHandled(wsdlOperationBinding.Input);
}
if (wsdlOperationBinding.Output != null)
{
MarkSoapExtensionsAsHandled(wsdlOperationBinding.Output);
}
foreach (WsdlNS.MessageBinding wsdlMessageBinding in wsdlOperationBinding.Faults)
{
MarkSoapExtensionsAsHandled(wsdlMessageBinding);
}
}
}
}
示例2: GetBindingElements
void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context)
{
if (context == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
#pragma warning suppress 56506 // [....], these properties cannot be null in this context
if (context.Endpoint.Binding == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context.Endpoint.Binding");
}
BindingElementCollection bindingElements = GetBindingElements(context);
MessageEncodingBindingElement messageEncodingBindingElement = bindingElements.Find<MessageEncodingBindingElement>();
TextMessageEncodingBindingElement textEncodingBindingElement = messageEncodingBindingElement as TextMessageEncodingBindingElement;
if (messageEncodingBindingElement != null)
{
Type elementType = messageEncodingBindingElement.GetType();
if (elementType != typeof(TextMessageEncodingBindingElement)
&& elementType != typeof(BinaryMessageEncodingBindingElement)
&& elementType != typeof(MtomMessageEncodingBindingElement))
return;
}
EnsureMessageEncoding(context, messageEncodingBindingElement);
foreach (OperationBinding wsdlOperationBinding in context.WsdlBinding.Operations)
{
OperationDescription operation = context.GetOperationDescription(wsdlOperationBinding);
for (int i = 0; i < operation.Messages.Count; i++)
{
MessageDescription message = operation.Messages[i];
MessageBinding wsdlMessageBinding = context.GetMessageBinding(message);
ImportMessageSoapAction(context.ContractConversionContext, message, wsdlMessageBinding, i != 0 /*isResponse*/);
}
foreach (FaultDescription fault in operation.Faults)
{
FaultBinding wsdlFaultBinding = context.GetFaultBinding(fault);
if (wsdlFaultBinding != null)
{
ImportFaultSoapAction(context.ContractConversionContext, fault, wsdlFaultBinding);
}
}
}
}
示例3: GetBindingElements
void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context)
{
if (context == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
}
if (context.Endpoint.Binding == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context.Endpoint.Binding");
}
MessageEncodingBindingElement encodingBindingElement = GetBindingElements(context).Find<MessageEncodingBindingElement>();
if (encodingBindingElement != null)
{
System.Type type = encodingBindingElement.GetType();
if (((type != typeof(TextMessageEncodingBindingElement)) && (type != typeof(BinaryMessageEncodingBindingElement))) && (type != typeof(MtomMessageEncodingBindingElement)))
{
return;
}
}
EnsureMessageEncoding(context, encodingBindingElement);
foreach (OperationBinding binding in context.WsdlBinding.Operations)
{
OperationDescription operationDescription = context.GetOperationDescription(binding);
for (int i = 0; i < operationDescription.Messages.Count; i++)
{
MessageDescription message = operationDescription.Messages[i];
MessageBinding messageBinding = context.GetMessageBinding(message);
ImportMessageSoapAction(context.ContractConversionContext, message, messageBinding, i != 0);
}
foreach (FaultDescription description3 in operationDescription.Faults)
{
FaultBinding faultBinding = context.GetFaultBinding(description3);
if (faultBinding != null)
{
ImportFaultSoapAction(context.ContractConversionContext, description3, faultBinding);
}
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:39,代码来源:MessageEncodingBindingElementImporter.cs