Last post Jul 31, 2013 10:28 AM by kushalrdalal
Jul 30, 2013 04:12 PM|noobville|LINK
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
Can someon explain to me why this is please?
Jul 30, 2013 06:32 PM|DarrenJMcLeod|LINK
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.
Jul 31, 2013 07:34 AM|noobville|LINK
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.
Jul 31, 2013 10:15 AM|kushalrdalal|LINK
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.
Jul 31, 2013 10:19 AM|noobville|LINK
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.
Jul 31, 2013 10:28 AM|kushalrdalal|LINK
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 -