WCF/WF - unable to add service refrence - Asked By Shilpa Sharma on 14-Jul-10 10:26 AM

Hi,


When I am trying to add service refrence I am getting the following error:


There was an error downloading 'http://localhost:50639/Service1/Service.svc'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:50639
Metadata contains a reference that cannot be resolved: 'http://localhost:50639/Service1/Service.svc'.
Could not connect to http://localhost:50639/Service1/Service.svc. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:50639.


I am new to WCF, even I have never worked on web service. I am using "http://www.c-sharpcorner.com/UploadFile/prathore/711/Default.aspx" link to make my 1st sample program. Please help me to get rid of this error.


Thanks in advance


Shilpa

Peter Bromberg replied to Shilpa Sharma on 14-Jul-10 10:36 AM

The first thing you want to do is put  http://localhost:50639/Service1/Service.svc into the address bar of your browser and see if anything actually comes back. if not, then there is something wrong with your service.


Additionally if you append ?WSDL to the service url you can see the WSDL document. A complete service reference url would look like:


http://localhost:50639/Service1/Service.svc?WSDL

Shilpa Sharma replied to Peter Bromberg on 14-Jul-10 11:50 AM

Hi Peter,


Entering http://localhost:50639/Service1/Service.svc into the address bar of the browser is returing result (the way step # 4 of http://www.c-sharpcorner.com/UploadFile/prathore/711/Default.aspx is showing)


I am able to see wsdl doc after entering http://localhost:50639/Service1/Service.svc?WSDL into address bar


Even after that I am facing the same problem (mentioned in my initial post). Even if I am giving following command at command prompt I am getting the same error (which I am getting while adding service reference)

svcutil.exe http://localhost:50639/Service1/Service.svc?wsdl 


Thx in adavance

Shilpa

Peter Bromberg replied to Shilpa Sharma on 14-Jul-10 12:07 PM

Your url http://localhost:50639/Service1/Service.svc?wsdl   is obviously one that is designed to run in the Visual Studio WebDev webserver, which is not always running. Better to set the web project to run under IIS with a named virtual directory like


http://localhost/Service1/Service.svc?wsdl 


In this manner, you would not even need Visual Studio to be loaded.

Shilpa Sharma replied to Peter Bromberg on 14-Jul-10 12:17 PM
Right, when the web server is running then only I am getting the result from the url, else not. Let me make the virtual directory and try the idea which you suggested
Shilpa Sharma replied to Peter Bromberg on 14-Jul-10 02:12 PM

Hi Peter,


I am unable to run my application on fixed port.... ie. if i am giving http://localhost/mysevice/service.svc


its giving me access denied


I am clueless how to proceed further