Question

I have a WCF service running that worked fine before from my client. I have an Azure Compute Emulator running on my other device that's hosting the service. Since that is only meant for local testing, I have added a port redirection for a local port using

netsh interface portproxy add v4tov4 listenport=81 listenaddress=192.168.1.100 connectport=81 connectaddress=127.0.0.1

This works fine as I can import the service reference from the server device. However, when I run my app, initialize my service reference with new ServiceReference1.ServiceClient() and try to call the first method of it, I get an EndpointNotFoundException.

Here are the peculiarities:

  • Locally connecting to 192.168.1.100:81 works and I can use the same client software there.
  • I created a new WinForms (my target for the client is WinRT) project, added the service reference and called the method and it WORKED (from the remote device as well).

So basically, the case now is that only this one instance of service reference (that I tried removing and adding - again, importing the service reference worked!) is not working. Debugger just throws the EndpointNotFoundException (the exception contains correct IP and port 192.168.1.100:81) at the first method call to the service so it is hard for me to debug it further.

The code for calling the method is exactly the same (i.e. initialize with new and call the client method without parameters). Any ideas what could cause this?

Was it helpful?

Solution

Alrighty, I found out what was causing this. Since I had only been developing locally, I had not had this problem before (nor when I deployed to Azure), but apparently running in a local context such as mine, requires "Private Networks (server & client)" capability to work. Of course it would be nicer to get an error corresponding the problem, but at least it's settled now.

Any idea why this capability is separated from the "internet" capability ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top