本文整理汇总了C#中System.Web.Services.Description.ServiceDescriptionCollection.GetMessage方法的典型用法代码示例。如果您正苦于以下问题:C# ServiceDescriptionCollection.GetMessage方法的具体用法?C# ServiceDescriptionCollection.GetMessage怎么用?C# ServiceDescriptionCollection.GetMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Services.Description.ServiceDescriptionCollection
的用法示例。
在下文中一共展示了ServiceDescriptionCollection.GetMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AnalyzeBinding
internal static bool AnalyzeBinding(Binding binding, ServiceDescription description, ServiceDescriptionCollection descriptions, BasicProfileViolationCollection violations)
{
bool flag = false;
bool flag2 = false;
SoapBinding binding2 = (SoapBinding) binding.Extensions.Find(typeof(SoapBinding));
if ((binding2 == null) || (binding2.GetType() != typeof(SoapBinding)))
{
return false;
}
SoapBindingStyle style = (binding2.Style == SoapBindingStyle.Default) ? SoapBindingStyle.Document : binding2.Style;
if (binding2.Transport.Length == 0)
{
violations.Add("R2701", System.Web.Services.Res.GetString("BindingMissingAttribute", new object[] { binding.Name, description.TargetNamespace, "transport" }));
}
else if (binding2.Transport != "http://schemas.xmlsoap.org/soap/http")
{
violations.Add("R2702", System.Web.Services.Res.GetString("BindingInvalidAttribute", new object[] { binding.Name, description.TargetNamespace, "transport", binding2.Transport }));
}
PortType portType = descriptions.GetPortType(binding.Type);
Hashtable hashtable = new Hashtable();
if (portType != null)
{
foreach (Operation operation in portType.Operations)
{
if (operation.Messages.Flow == OperationFlow.Notification)
{
violations.Add("R2303", System.Web.Services.Res.GetString("OperationFlowNotification", new object[] { operation.Name, binding.Type.Namespace, binding.Type.Namespace }));
}
if (operation.Messages.Flow == OperationFlow.SolicitResponse)
{
violations.Add("R2303", System.Web.Services.Res.GetString("OperationFlowSolicitResponse", new object[] { operation.Name, binding.Type.Namespace, binding.Type.Namespace }));
}
if (hashtable[operation.Name] != null)
{
violations.Add("R2304", System.Web.Services.Res.GetString("Operation", new object[] { operation.Name, binding.Type.Name, binding.Type.Namespace }));
}
else
{
OperationBinding binding3 = null;
foreach (OperationBinding binding4 in binding.Operations)
{
if (operation.IsBoundBy(binding4))
{
if (binding3 != null)
{
violations.Add("R2304", System.Web.Services.Res.GetString("OperationBinding", new object[] { binding3.Name, binding3.Parent.Name, description.TargetNamespace }));
}
binding3 = binding4;
}
}
if (binding3 == null)
{
violations.Add("R2718", System.Web.Services.Res.GetString("OperationMissingBinding", new object[] { operation.Name, binding.Type.Name, binding.Type.Namespace }));
}
else
{
hashtable.Add(operation.Name, operation);
}
}
}
}
Hashtable wireSignatures = new Hashtable();
SoapBindingStyle style2 = SoapBindingStyle.Default;
foreach (OperationBinding binding5 in binding.Operations)
{
SoapBindingStyle style3 = style;
string name = binding5.Name;
if (name != null)
{
if (hashtable[name] == null)
{
violations.Add("R2718", System.Web.Services.Res.GetString("PortTypeOperationMissing", new object[] { binding5.Name, binding.Name, description.TargetNamespace, binding.Type.Name, binding.Type.Namespace }));
}
Operation operation2 = FindOperation(portType.Operations, binding5);
SoapOperationBinding binding6 = (SoapOperationBinding) binding5.Extensions.Find(typeof(SoapOperationBinding));
if (binding6 != null)
{
if (style2 == SoapBindingStyle.Default)
{
style2 = binding6.Style;
}
flag |= style2 != binding6.Style;
style3 = (binding6.Style != SoapBindingStyle.Default) ? binding6.Style : style;
}
if (binding5.Input != null)
{
SoapBodyBinding binding7 = FindSoapBodyBinding(true, binding5.Input.Extensions, violations, style3 == SoapBindingStyle.Document, binding5.Name, binding.Name, description.TargetNamespace);
if ((binding7 != null) && (binding7.Use != SoapBindingUse.Encoded))
{
Message message = (operation2 == null) ? null : ((operation2.Messages.Input == null) ? null : descriptions.GetMessage(operation2.Messages.Input.Message));
if (style3 == SoapBindingStyle.Rpc)
{
CheckMessageParts(message, binding7.Parts, false, binding5.Name, binding.Name, description.TargetNamespace, wireSignatures, violations);
}
else
{
flag2 = flag2 || ((binding7.Parts != null) && (binding7.Parts.Length > 1));
int num = (binding7.Parts == null) ? 0 : binding7.Parts.Length;
CheckMessageParts(message, binding7.Parts, true, binding5.Name, binding.Name, description.TargetNamespace, wireSignatures, violations);
if (((num == 0) && (message != null)) && (message.Parts.Count > 1))
//.........这里部分代码省略.........
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:101,代码来源:WebServicesInteroperability.cs