WCF REST webHttpBinding - 404 Error

782 Views Asked by At

This service I can see the JSON data while calling methods through browser when hosted on our IIS server but after moving it to client's server.. I can't see the data from browser though I can see through WCF Test CLient only... where I'm going wrong.. Could you suggest what should be done.

 <bindings>
        <wsHttpBinding>
            <binding name="LargeSettings" maxBufferPoolSize="524288"    maxReceivedMessageSize="6553600">
                <readerQuotas maxDepth="32" maxStringContentLength="100000" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
                <security mode="None"/>
            </binding>
        </wsHttpBinding>
    </bindings>

    <behaviors>
        <serviceBehaviors>
            <behavior name="mobserviceBehavior">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="true"/>

            </behavior>
        </serviceBehaviors>
        <endpointBehaviors>
            <behavior name="WebBehavior">
                <webHttp/>
            </behavior>
        </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
    <services>
        <service name="clubconnect.mobservice" behaviorConfiguration="mobserviceBehavior">
            <endpoint address="" binding="wsHttpBinding" contract="clubconnect.imobservice" bindingConfiguration="LargeSettings"/>
            <endpoint address="ws" binding="webHttpBinding" contract="clubconnect.imobservice" behaviorConfiguration="WebBehavior">
                <identity>
                    <dns value="http://domain"/>
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        </service>
    </services>
1

There are 1 best solutions below

0
On

You need to add a base address in there:

        <host>
          <baseAddresses>
            <add baseAddress="http://<URL to the .svc file>" />
          </baseAddresses>
        </host>

Then your relative address for your webHttpBinding endpoint "ws" will resolve to

http://<URL to the .svc file>/ws