AddressFilter mismatch at the EndpointDispatcher - the msg with To

前端 未结 12 1812
一个人的身影
一个人的身影 2020-12-14 06:21

Any ideas how I correct this.. calling a service via js

The message with To \'http://MySite.svc/GetStateXML\' cannot be processed at the receiver, due

相关标签:
12条回答
  • 2020-12-14 06:51

    The key elements are the webHttp and binding="webHttpBinding" for the Json work in the browser test. However SoapUI still failed to return JSon.

    0 讨论(0)
  • 2020-12-14 06:54

    Look at <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>
    
    0 讨论(0)
  • 2020-12-14 06:54

    Add webHttp attribute to your config:

    endpointBehaviors
            behavior name ="yourServiceContract"
              webHttp  automaticFormatSelectionEnabled ="true "
            behavior
    
    0 讨论(0)
  • 2020-12-14 06:56

    I just ran into this as well while going through an example in the Learning WCF book by Bustamante. I had used the WCF Config Editor to fill out my config on my host and had put the value in the name attribute for my endpoint rather than the address attribute. Once I fixed it things worked. I found another post that suggested using:

    [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)] 
    

    on the implementation class, which worked but wasn't the root cause.

    Bottom line appears to be: make sure your client and server configs match.

    0 讨论(0)
  • 2020-12-14 06:56

    I know it sounds silly but for anyone else that has this error check your address. We were getting this error because we had a double slash where there should have only been one.

    http://localhost//servicename.svc

    The above address caused the problem.

    http://localhost/servicename.svc

    Did not exhibit the problem.

    We were dynamically creating the full address from parts of data read in from windows forms and a database. The user was entering /servicename.svc instead of servicename.svc

    0 讨论(0)
  • 2020-12-14 07:03

    I had this issue in my development environment for a web service hosted in IIS. Solved it by going to 'IIS Manager' and added a binding to the host name complained about in the error message.

    0 讨论(0)
提交回复
热议问题