Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a WCF service by following an example on YouTube. Every was fine until I tried to add a service reference to my client. I got this error message:

CSS
There was an error downloading 'http://localhost:8090/whatever/?wsdl/_vti_bin/ListData.svc/$metadata'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8090
Metadata contains a reference that cannot be resolved: 'http://localhost:8090/whatever/?wsdl'.
There was no endpoint listening at http://localhost:8090/whatever/?wsdl that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8090
If the service is defined in the current solution, try building the solution and adding the service reference again.


Does anyone have any idea where I'm going wrong?

Thanks In Advance
Posted
Comments
virang_21 27-Nov-14 16:25pm    
Make sure your WCF service is running. Did you host it in IIS or is it a self hosted windows service ? What did you specify as endpoint for WCF in web.config/app.config file.

1 solution

CSS
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8090
If the service is defined in the current solution, try building the solution and adding the service reference again.


This exception (and a number of others) can be quite misleading - you will sometimes get this exception if the connection is refused but you may also see it for reasons that have nothing whatsoever to do with the error that is ostensibly being reported.

You need to turn on the tracing options in your WCF configuration editor (both client and server, as applicable), reproduce the exception with the tracing options turned on, then review the trace log that has been generated.


http://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900