當前位置: 首頁>>代碼示例>>C#>>正文


C# ServiceDescriptionCollection.GetMessage方法代碼示例

本文整理匯總了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


注:本文中的System.Web.Services.Description.ServiceDescriptionCollection.GetMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。