2
votes

When i publish my WCF 4.0 service to server, the domain name is always converted to IP value in wsdl address. What i mean is; i want the wsdl link to be
http://www.mydomainaddress/svc/service1.svc?wsdl, instead of http://myipaddress/svc/service1.svc?wsdl

1
What do you mean that it's "converted"? Which WSDL Link are you referring to?John Saunders
WSDL link always appears with the ip value, like "121.12.11.33/svc/service1.svc?wsdl", not domain name..SreTDt9hYvpqYB
What is this "WSDL Link" that you're referring to?John Saunders
Oh, sorry.It is the one you see after calling service from a browser, the one on the "you have created a service" page.SreTDt9hYvpqYB
Check your bindings in IIS. That part of the URL comes from IIS. If the application in IIS is set up to bind via the IP address, then that's what you'll get in the help page and in the WSDL.John Saunders

1 Answers

5
votes

You can add the <useRequestHeadersForMetadataAddress/> tag to the serviceBehaviors element in the config so the landing page will show the host header you typed into your browser, rather than the machine name/ip.

See http://msdn.microsoft.com/en-us/library/ee816894.aspx for more.