AddressFilter在EndpointDispatcher上不匹配 - 带有To的消息

Jon*_*Jon 42 wcf

任何想法我如何纠正这个...通过js调用服务

由于EndpointDispatcher上的AddressFilter不匹配,无法在接收方处理带有"http://MySite.svc/GetStateXML"的消息.检查发送方和接收方的EndpointAddresses是否一致

谢谢

Sea*_*n B 41

我在Bustamante 的学习WCF书中通过一个例子时也遇到了这个问题.我曾使用WCF配置编辑器在我的主机上填写我的配置,并将值放在我的端点的name属性而不是address属性中.一旦我修好它就行了起来.我找到了另一篇建议使用的帖子:

[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)] 
Run Code Online (Sandbox Code Playgroud)

在实现类上,它起作用但不是根本原因.

底线似乎是:确保您的客户端和服务器配置匹配.


小智 31

下面列出的错误表明Web Service实现了WS-Addressing.

"由于EndpointDispatcher上的AddressFilter不匹配,无法在接收方处理带有To'的消息.检查发送方和接收方的EndpointAddresses是否一致"

在SOAP Headers中包含以下内容以访问Web Service:

<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:To>http://example.com/service</wsa:To>
</soap:Header>
Run Code Online (Sandbox Code Playgroud)


SNa*_*Nag 10

我在使用时遇到了这个错误webHttpBinding.

我通过添加来解决它

<endpointBehaviors>
  <behavior name="EndPointBehavior">
    <enableWebScript/>
  </behavior>
</endpointBehaviors>
Run Code Online (Sandbox Code Playgroud)

<behaviors>和设置behaviorConfiguration="EndPointBehavior"在我endpointbinding="webHttpBinding".

完整配置:

<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehavior">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="EndPointBehavior">
      <enableWebScript/>
    </behavior>
  </endpointBehaviors>
</behaviors>

<services>
  <service name="WcfService1.Service1" behaviorConfiguration="ServiceBehavior">
    <endpoint address="" 
              binding="webHttpBinding" 
              contract="WcfService1.IService1" 
              behaviorConfiguration="EndPointBehavior">
    </endpoint>
    <endpoint address="mex" 
              binding="mexHttpBinding" 
              contract="IMetadataExchange">
    </endpoint>
  </service>
</services>
Run Code Online (Sandbox Code Playgroud)


小智 8

我知道这听起来很愚蠢,但对于有此错误的其他人,请检查您的地址.我们得到了这个错误,因为我们有一个双斜线,其中应该只有一个.

HTTP://localhost//servicename.svc

上述地址引起了这个问题.

HTTP://localhost/servicename.svc

没有表现出这个问题.

我们从Windows窗体和数据库中读取的数据部分动态创建完整地址.用户输入的是/servicename.svc而不是servicename.svc


Jas*_*wal -3

看着<webHttp />

<services>
      <service name="SimpleService.SimpleService" behaviorConfiguration="serviceBehaviour">
        <endpoint address="" binding="webHttpBinding" contract="SimpleService.ISimpleService" behaviorConfiguration="web">
        </endpoint>
        <endpoint address="mex"
              binding="mexHttpBinding"
              contract="IMetadataExchange">
        </endpoint>
      </service>
    </services>

....
....

<endpointBehaviors>
        <behavior name="web">
          <webHttp />
        </behavior>
</endpointBehaviors>
Run Code Online (Sandbox Code Playgroud)