Saturday, 26 January 2013

How to host wcf rest services on IIS

Configuring a WCF service and WCF REST service on IIS differs a little why because,
WCF does not understand the REST address so you need to configure the endpoint behavior as webHttp.

Generally we encounter exceptions when hosting WCF REST services on IIS.


The message with To <address> cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.

Following is a sample of configuration file that should be used to resolve this.

<system.serviceModel>
<behaviors>
<endpointBehaviors>
          <behavior name="WebBehavior">
            <webHttp/>
          </behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="FullName">
<endpoint address="js" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="ServiceContractName"/>
</service>
</services>
</system.serviceModel>

No comments:

Post a Comment