I am trying to use the WCF streaming with Message Contracts, because I need additional parameters beside the stream itself.
Basically I am creating a file upload and
I got the error after using the 'WCF Data Service' template to generate the svc file instead of the 'WCF Service' template. Correcting the service host file the issue was solved.
Do you need streaming (i.e. transfer of humonguous data amounts) both on the request and response? Or just on the response (typically: downloading a file or large data set)?
If you need only on the response, you should try to set the transfermode to "StreamedResponse":
<customBinding>
<binding name="customHttpBindingStream">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport transferMode="StreamedResponse"
maxReceivedMessageSize="2147483647"/>
</binding>
</customBinding>
The "Streamed" setting will stream both ways - both the request going to the server, as well as the response from the server, will be streamed. More often than not, that's not the ideal scenario.
Marc
I finally found out what was the error: it had nothing to do with Soap versions, streams, etc... I just mispelled the name of my own service (!), using FileTransfer
instead of FileTransferService
.
In the end basicHttpBinding was perfectly fine, I didn't need to resort to a custom binding.
Original (bad) version:
<service
behaviorConfiguration="serviceBehavior"
name="Acme.Service.FileTransfer">
<endpoint address=""
name="basicHttpStream"
binding="basicHttpBinding"
bindingConfiguration="httpLargeMessageStream"
contract="Acme.Service.IFileTransferService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
New (fixed) version:
<service
behaviorConfiguration="serviceBehavior"
name="Acme.Service.FileTransferService">
<endpoint address=""
name="basicHttpStream"
binding="basicHttpBinding"
bindingConfiguration="httpLargeMessageStream"
contract="Acme.Service.IFileTransferService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
Still I can't say that the error message was helpful in any way to understand what was going on here....
If you are interested in the whole service, you can find more details on my blog at the following link: File Transfer with WCF