tags:

views:

40

answers:

1

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"/&gt;
</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?

A: 

This should fix your issue.

http://knowledgebaseworld.blogspot.com/2010/06/domain-name-replaced-with-machine-name.html

Imran

IBhadelia
Thanks. I've seen this one before and tried it, but it has several problems. First, it only addresses the Mex endpoint and not my contract endpoint. Second, when I did make the change, it returned an empty WSDL document. Finally, this solution doesn't address the core problem which is that IIS returns a host name instead of my application's domain name.
Joel Rodgers
This should work for chaning contract ref url http://knowledgebaseworld.blogspot.com/2010/06/wsdl-service-soap-address-location.html. I seen that docRef is still pointing to the machine name for that you can try this http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/001c126a-f506-459d-97e9-ff66cc7f129a solution
IBhadelia