Answered by:
Service Discovery not using DNS name

Question
-
User2043281626 posted
Hello,
I have WCF service and a web application in the same solution. I am able to add a service to my web application by discovering my service via Discovery. However, I noticed that it only finds it as for example http://localhost:1230/MyService.svc rather than http://MyDnsName/MyService.svc.
Can someon explain to me why this is please?
Tuesday, July 30, 2013 4:12 PM
Answers
-
User-1662538993 posted
If you dont have access to iis then for a test you can host it in console app and then test it with that.
Check this url for hosting in console -
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, July 31, 2013 10:28 AM
All replies
-
User1563932795 posted
In the Add Service Reference dialog the Discover button is for discovering services in your Solution so you can add them as a local reference and host/debug them locally. If you want to reference services hosted outside your solution like http://MyDnsName/MyService.svc put the URL in the Address field and click the Go button.
Tuesday, July 30, 2013 6:32 PM -
User2043281626 posted
You are correct in that I am trying to discovery services that are local; within my solution, but the issue is that I don't understand why the address comes up with localhost rather than the DNS name I gave it. If I try to manually change it to the DNS name it complains and says it cannot find the service. So to be clear, I am not trying to add a service outside of the solution.
Wednesday, July 31, 2013 7:34 AM -
User-1662538993 posted
Have you tried to host the wcf service on your local machine iis and then use that hosted url to add service reference?
Give it a try and it should work.
If you want to use some kind of name then you can add a host entry to your host file and then use that and it should work.
Wednesday, July 31, 2013 10:15 AM -
User2043281626 posted
I don't have access to IIS because of the development environment I am working in. This is why I am trying to host it through Visual Studio. I've already added the name to the host file too. I can debug the service directly and it has no problem with the name I gave, however, adding it as service to another application in the same solution it is. It wants to use "localhost" rather than the name I gave it.
Wednesday, July 31, 2013 10:19 AM -
User-1662538993 posted
If you dont have access to iis then for a test you can host it in console app and then test it with that.
Check this url for hosting in console -
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, July 31, 2013 10:28 AM