简体   繁体   English

WCF 自托管 WebService AddresFilter 不匹配

[英]WCF self-hosted WebService AddresFilter mismatch

I migrate my working self-hosted WebService to HTTPS.我将工作中的自托管 WebService 迁移到 HTTPS。 I got this error when I try to make a call to a method:当我尝试调用方法时出现此错误:

  <s:Fault>
     <s:Code>
        <s:Value>s:Sender</s:Value>
        <s:Subcode>
           <s:Value>a:DestinationUnreachable</s:Value>
        </s:Subcode>
     </s:Code>
     <s:Reason>
        <s:Text xml:lang="it-IT">The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver's EndpointAddresses agree.</s:Text>
     </s:Reason>
  </s:Fault>

This is my app.Config:这是我的 app.Config:

<system.serviceModel>
<services>
  <service name="XWebServiceLib.XWebService"  behaviorConfiguration="XWebServiceBehave">
    <host>
      <baseAddresses>
        <add baseAddress="https://xxx.yyy.it/XWebService"/> 
      </baseAddresses>
    </host>
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="MyBinding" contract="XWebServiceLib.IXWebService"/>
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="XWebServiceBehave">
      <serviceMetadata httpsGetEnabled="true"  httpGetEnabled="false" />
      <serviceDebug includeExceptionDetailInFaults="true"/>
      <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <wsHttpBinding>
    <binding name="MyBinding">
      <security mode="Transport">
    <transport clientCredentialType="None"/>
      </security>
    </binding>                 
  </wsHttpBinding>
</bindings>

Before migrating to HTTPS everything was working fine... Any idea?在迁移到 HTTPS 之前,一切正常……知道吗?

On my side, it works well.在我这边,它运作良好。 In addition to trusting the server-side's certificate, we need to add a default wsa:to action.除了信任服务器端的证书,我们还需要添加一个默认的wsa:to操作。
在此处输入图像描述
Namely, below SOAP header is required in the SOAP message.即在 SOAP 消息中需要 SOAP header 以下。
在此处输入图像描述
Afterward, it works properly.之后,它可以正常工作。 Feel free to let me know if the problem still exists.如果问题仍然存在,请随时告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM