A common issue for WCF appears to be how the hostname is resolved within the wsdl for the links to other files. The issue is that the machine name of the computer is placed into the wsdl to link the other wsdl files, so if you visit http://myhost/service.svc it may point to the rest of the wsdl on another location, ie http://mypc/service.svc?wsdl which obviously is something you cannot see externally.

There are a few solutions out there for this already, this being the common one. Where you can setup the host header.

My question is, how can i work around this when using an external IP. I'm connecting to a clients head-office from their website to retrieve data, its not setup with a dns etc and the ip re-routes to a machine internally. Is there any way to force the machine hosting the WCF to present the external address in the wsdl files rather than the machine name?

I'm using SSL for the connection, which may make a difference (as with the host headers).

Accepted Answer

You need to configure the host header for secureBingings of website within IIS.

Here is an article about WCF WSDL & xsd:import schemaLocations link to local machine name not domain name while hosted in IIS

Written by codemeit
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki