Sunday, October 23, 2011

Calling a WCF service from a Metro application – cross machine scenario

So you have developed your WCF service to be consumed by your Metro client application – you would likely have done the development on your local machine. What is the next step [before we move to Azure ] ? You will probably take your service and deploy it on another machine either for testing cross machine scenario or you are just going with on-premise hosting.

So what is interesting here? Well, start up the metro client and try to connect to the WCF service. Does it work? 

If you are calling the service asynchronously which is how you should be doing it – you will see the metro client just hang waiting for the service to respond. While calling synchronously you will see an Aggregate exception throw almost instantly with the inner exception being – “There was no endpoint listening at /.svc">/.svc">http://<serverName>/<service>.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.".  with innermost exception of – “{"An attempt was made to access a socket in a way forbidden by its access permissions XXX.XXX.XXX.XXX:80"}”

Read more: Forward Thinking
QR: calling-a-wcf-service-from-a-metro-application-cross-machine-scenario.aspx

Posted via email from Jasper-Net