I created a WCF service that works beautifully on my dev box, but when I move the code over to the web server, it gives me the following error:
There was no channel actively listening at 'http://live01.farm02.webhost.com/webservice/service.svc'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening.; There was no channel actively listening at 'http://live01.farm02.xxxxxx.lan/webservice/service.svc'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening.
When I go to www.domain.com/services/service.svc?disco, it displays the following:
<discovery>
<contractRef ref="http://live01.farm02.xxxxxx.lan/webservice/Service.svc?wsdl" docRef="http://live01.farm02.xxxxxx.lan/webservice/Service.svc"/>
</discovery>
Obviously, both the contractRef and docRef URLs are using the server's internet unreachable hostname instead of one of the host header names assigned to the site.
Here's a minimalist version of my config file, I removed the mex endpoint for simplicity and clarity:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
</serviceHostingEnvironment>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="MyServiceBehavior" name="MyServices">
<endpoint binding="wsHttpContextBinding" name="MyEndpoint" contract="IMyServices" address="" />
</service>
</services>
</system.serviceModel>
How do I get my service to use the host header name or ip address of the site instead of the server's unreachable host name?