I am trying to implement streamed transfers using WCF and VS2008.

I created a new project using the WCF Service Application template in
VS2008. After renaming the Service, changing the wsHttpBinding to
basicHttpBinding and enabling streamed transfers, the resulting Web
Config looks like this:

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="FileTransferServicesBinding"
sendTimeout="00:15:00" transferMode="Streamed" messageEncoding="Mtom"
maxReceivedMessageSize="524288000" maxBufferSize="524288000" />
</basicHttpBinding>
</bindings>

<services>
<service name="TransitCommunicationFramework.FileTransferService"
behaviorConfiguration="TransitCommunicationFramework.FileTransferService
Behavior">
<!-- Service Endpoints -->
<endpoint address="" binding="basicHttpBinding"
bindingConfiguration="FileTransferServicesBinding"
contract="TransitCommunicationFramework.IFileTransferService" >
<!--
Upon deployment, the following identity element should be
removed or replaced to reflect the
identity under which the deployed service runs. If
removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>

</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior
name="TransitCommunicationFramework.FileTransferServiceBehavior">
<!-- To avoid disclosing metadata
information, set the value below to false and remove the metadata
endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in
faults for debugging purposes, set the value below to true. Set to
false before deployment to avoid disclosing exception information -->
<serviceDebug
includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>


Now, from my Client project I use Add Service Reference which I call
FileTransferServiceReference. This produces the following in the
App.config for the client:

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IFileTransferService"
closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Mtom" textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32"
maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint
address="http://localhost:4039/FileTransferService.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IFileTransferService"

contract="FileTransferServiceReference.IFileTransferService"
name="BasicHttpBinding_IFileTransferService" />
</client>
</system.serviceModel>


If I run it, it works fine. However I can see that the transferMode is
set to Buffered in the client config. If I manually change it to
Streamed and try runnning it again, I get the following exception:

System.ServiceModel.ActionNotSupportedException: The message with Action
'' cannot be processed at the receiver, due to a ContractFilter mismatch
at the EndpointDispatcher. This may be because of either a contract
mismatch (mismatched Actions between sender and receiver) or a
binding/security mismatch between the sender and the receiver. Check
that sender and receiver have the same contract and the same binding
(including security requirements, e.g. Message, Transport, None).


For sake of completness.. my contract looks looks like the following:

[ServiceContract]
public interface IFileTransferService
{
[OperationContract]
void UploadFile(UploadFileInfo fileInfo);

}




[MessageContract]
public class UploadFileInfo : IDisposable
{
[MessageHeader(MustUnderstand = true)]
public string Filename;

[MessageHeader(MustUnderstand = true)]
public long Length;

[MessageBodyMember(Order = 1)]
public System.IO.Stream FileStream;
}


What am I doing wrong?

Thanks,

Jeronimo