Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - Streamed Transfers using VS2008

 
 
Old 12-03-2007   #1 (permalink)
Jeronimo Bertran


 
 

Streamed Transfers using VS2008

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

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Upgrading from VS2008 standard to VS2008 Pro? .NET General
upgrade from VS2008 standard to VS2008 pro- options? .NET General
.WMV files will not play either streamed or even downloaded ones.. Vista music pictures video


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46