1

I am having trouble getting a Windows Store App to make calls into a WCF service.

The service is a Duplex service using a netTCP binding. The first time the client (A Windows 8.1 Store Application) uses the service, it throws an exception:

An exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll but was not handled in user code

Additional information: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:09:59.9968452'.

This timeout is near-equal to my max, 10 minutes. The exception, however, happens immediately, and breakpoints in the service function are never hit. The two do seem to be talking at some level because altering the security protocol or the endpoint address cause other exceptions (security and connection as you would expect). I put a breakpoint in the service and the function I am trying to call never gets hit.

I have tried:

  • Ensure feature equivalence between Service and Client NetTcpBinding configurations
  • Raise timeouts, sizes (1-10 minutes for each, 10000000 for max sizes)
  • Ensure all passed object types are DataContracts with default constructors
  • Prayer; Considering a burnt offering

Any help would be greatly appreciated. New to WCF and having trouble finding help for the Windows Store / netTCP / Duplex targeted scenario.

PatrickV
  • 2,057
  • 23
  • 30

1 Answers1

0

If your Windows Store App client and WCF service are on the same computer and you're not running the Windows Store App client from inside Visual Studio, then you need to enable loopback communication. Check out this article:

http://msdn.microsoft.com/en-us/library/windows/apps/dn640582.aspx

At the very bottom it talks about the command line utility: checknetisolation

Also, try making your method call as simple as possible with no return and no arguments. I know you said you checked all of the 'DataContract' attributes. But things can get tricky such as if you're using polymorphism and the base class doesn't have a 'KnownType' for a derived.