首页 > 解决方案 > 协议异常错误

问题描述

我正在尝试在脚本任务中调用肥皂服务,但收到以下错误。我已经通过 wsdl url 添加了一个 serviceReference。我不知道这个错误指的是什么。但是,我能够在 SOAPUI 中获取数据“此消息的接收者不理解来自命名空间‘ http://sap.com/xi/XI/Message/30 ’的标头‘ReliableMessaging’,导致消息不被处理。此错误通常表示此消息的发送方启用了接收方无法处理的通信协议。请确保客户端绑定的配置与服务的绑定一致。

下面是我正在使用的代码

EndpointAddress endPointAddress = new EndpointAddress("https://sapnxcci.intel.com:8220/XISOAPAdapter/MessageServlet?senderParty=&senderService=MC4510&receiverParty=&receiverService=&interface=Segments&interfaceNamespace=http://intel.com/xi/Intel-MDM/Project/Segment");

        SegmentsClient client = new SegmentsClient(BindingUtility.GetInitiativesBinding(), endPointAddress);
        client.ClientCredentials.UserName.UserName = "sys_idwcons";
        client.ClientCredentials.UserName.Password = "abdc";

        SegmentResponse results = client.ListSegments(new SegmentRequest() { SegmentName = "" });

在 GetInitiativesBinding 中包含以下内容。

 public static BasicHttpBinding GetInitiativesBinding()
    {
        BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
        binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
        binding.MaxReceivedMessageSize = 2147483647;
        binding.MaxBufferSize = 2147483647;
        binding.ReceiveTimeout = TimeSpan.FromMinutes(5);
        binding.SendTimeout = TimeSpan.FromMinutes(5);

        return binding;
    }

我的 App.Config 文件看起来像这样

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <system.serviceModel>
     <bindings>
        <basicHttpBinding>
            <binding name="SegmentsBinding" />
            <binding name="SegmentsBinding1">
                <security mode="Transport" />
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://sapnxcci.intel.com:8420/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=MC4510&amp;receiverParty=&amp;receiverService=&amp;interface=Segments&amp;interfaceNamespace=http%3A%2F%2Fintel.com%2Fxi%2FIntel-MDM%2FProject%2FSegment"
          binding="basicHttpBinding" bindingConfiguration="SegmentsBinding"
          contract="ServiceReference1.Segments" name="HTTP_Port" />
      <endpoint address="https://sapnxcci.intel.com:8220/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=MC4510&amp;receiverParty=&amp;receiverService=&amp;interface=Segments&amp;interfaceNamespace=http%3A%2F%2Fintel.com%2Fxi%2FIntel-MDM%2FProject%2FSegment"
           binding="basicHttpBinding" bindingConfiguration="SegmentsBinding1"
           contract="ServiceReference1.Segments" name="HTTPS_Port" />
     </client>
   </system.serviceModel>
</configuration>

标签: c#asp.netsoapssisbasichttpbinding

解决方案


我认为这是因为 PI 的返回消息包含标签。标签仅在您有 PI - PI 连接时才有用。

参考:https ://archive.sap.com/discussions/thread/1839924


推荐阅读