1

image1

image2

"Add service reference" is unable to find any service running, which is actually running with the solution "started without debugging". Also running with another instance of visual studio simultaneously not working.

Bahadir Tasdemir
  • 10,325
  • 4
  • 49
  • 61
Navneet
  • 61
  • 7

1 Answers1

0

Instead of the address

http://localhost:9999/mex

try the following address

http://localhost:9999/ProductService/WCFProductService.svc?singleWsdl
Captain Sensible
  • 4,946
  • 4
  • 36
  • 46
  • There was an error downloading 'http://localhost:9999/ProductService/WCFProductService.svc/_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:9999 Metadata contains a reference that cannot be resolved: 'http://localhost:9999/ProductService/WCFProductService.svc'. There was no endpoint listening at http://localhost:9999/ProductService/WCFProductService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. – Navneet Sep 06 '16 at 06:09
  • 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:9999 If the service is defined in the current solution, try building the solution and adding the service reference again. – Navneet Sep 06 '16 at 06:09
  • I tried the same thing by changing the endpoint address to http://localhost:9999/ProductService/WCFProductService.svc , but of no avail. Appreciate your time though – Navneet Sep 06 '16 at 06:11
  • 1
    Try using "netstat -an" and look for "listening" connections on port 9999. If it's not in the list, your WS is not running. – Captain Sensible Sep 06 '16 at 06:51
  • Hi Diego, I tried "netstat -an", "netstat -a -o | findstr 9999" as well as checked the url in my browser, service is running. And to my surprise, finally I could see the WCFService in my "Add service reference" in client code. Looks like some inconsistency in behavior. Thanks a lot for your help. – Navneet Sep 06 '16 at 16:01