views:

502

answers:

2

I'm attempting to transfer some files through WCF, but as soon as the method is called from the client, I get the following message:

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:10:00'.

My method is wrapped in a try...catch, so if there's anything throwing an exception from within the method on the server, it should log it to a console window, but nothing is logged. I've also tried running the server locally and setting breakpoints on the method, and the method simply doesn't seem to be getting called.

Is there a property or something that needs set on the net.tcp connection to allow streaming on the client side?

+2  A: 

Is there a property or something that needs set on the net.tcp connection to allow streaming on the client side?

Yes - of course! You need to set up your client side config to use streaming - either in one direction (StreamedRequest if you want to upload stuff to the server, or StreamedResponse if you want to download from the server, or just plain Streamed if you stream both ways).

<system.serviceModel>
  <bindings>
    <netTcpBinding>
      <binding name="streaming" 
          transferMode="StreamedResponse">
      </binding>
    </netTcpBinding>
  </bindings>
  <client>
    <endpoint name="StreamEndpoint"
              address="..."
              binding="netTcpBinding"
              bindingConfiguration="streaming"
              contract="IYourService" />
  </client>
</system.serviceModel>

You need to define your binding configuration under a name (whatever you like), and then reference that configuration in the <endpoint> by specifying that name in the bindingConfiguration= attribute.

See the MSDN doc pages on How to: Enable Streaming for more detailed information.

marc_s
A: 

you should configure tracing on the server and open the log for a better explanation on what´s going on.
Take a look at the Service Trace Viewer Tool

sebastian