When I publish my ASP.NET WCF service, the WSDL uses the machine name instead of the domain name. How to prevent this?
Example:
<wsdl:import namespace="http://ListenerService"
location="http://MACHINE_NAME/ListenerService/service.svc?wsdl=wsdl0"/>
<soap:address location="http://MACHINE_NAME/ListenerService/service.svc"/>
When I really want:
<wsdl:import namespace="http://ListenerService"
location="http://MYDOMAIN.COM/ListenerService/service.svc?wsdl=wsdl0"/>
<soap:address location="http://MYDOMAIN.COM/ListenerService/service.svc"/>
You cannot prevent this from happening – at least not just with a config switch or something like that.
You might be able to fix your problem by looking at this article here – a chap describing the exact problem you encounter and a possible fix to it:
http://www.codemeit.com/wcf/wcf-wsdl-xsdimport-schemalocations-link-to-local-machine-name-not-domain-name-while-hosted-in-iis.html
And another smart gentleman who ran into a few problems with the same issue:
http://www.leastprivilege.com/HostHeadersSSLAndWCFMetadata.aspx
Marc