Question

I have a WCF Service and client using nettcpBinding (framework 4.0). The client requests an image, the server goes and looks up that image and sends it back to the client via a callback.

The WCF Service is hosted inside a Windows Forms application. I have it logging all activities to screen for testing.

On my dev machine, the system works flawlessly. I can request an image from the Service app deployed on a test server and it is returned and displayed in my client.

As soon as I copy the client to another computer (accessing the same server), the image is not received. Watching the output on the server, the client connects, requests, and the server gets the image. The server then has a number of log messages when the callback is initiated and the image is serialized and sent. These are all logged normally, just as they are on the working Dev computer. It is just that the image is never displayed on the client. The client is still connected to the server, because if I close the client, I get a "disconnected" message appear on the server.

I placed a messagebox on the first line of the callback method on the client side, for testing, but the method is never called. There are no firewalls involved. I tried running the client under the Admin account, no difference. I literally have the client app in a folder, I run it on the dev box, it works, copy it onto the other computer, nothing.

How do I diagnoses what the problem is here? Any common causes?

Edit: I should mention. The service app is running on a computer inside the domain, the non-working client is also inside the domain. My dev machine is outside the domain, I have security currently set to "none" in the binding.

Was it helpful?

Solution

I finally figured it out.

On the callback method, I was using the attribute IsOneWay=True which was masking the exception on the server when it was writing to the client.

The client was actually causing an exception because the ReaderQuote.MaxArrayLength property was too small for the image data. I still don't understand why it worked on the Dev machine but not on the other workstations though.

I then just added a new property to my custom binding to increase the 'MaxArrayLength' to something suitable and it worked.

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