Hello
I am trying to implement streamed transfers using WCF and VS2008.
The web config file looks like...
<?xml version="1.0"?> <configuration> <system.serviceModel> <serviceHostingEnvironment minFreeMemoryPercentageToActivateService="5" /> <bindings> <basicHttpBinding> <binding name="FileTransferBinding" closeTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00" maxReceivedMessageSize="10067108864" messageEncoding="Mtom" transferMode="Streamed" useDefaultWebProxy="true"> <security mode="None"> <message clientCredentialType="Certificate" /> </security> </binding> </basicHttpBinding> </bindings> <services> <service behaviorConfiguration="MyServiceTypeBehaviors" name="FileTransferLibrary.FileTransfer"> <endpoint address="mex" binding="basicHttpBinding" bindingConfiguration="FileTransferBinding" contract="FileTransferLibrary.IFileTransfer" /> <host> <baseAddresses> <add baseAddress="http://192.168.0.3:8080/FileTranfer" /> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior name="MyServiceTypeBehaviors"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>
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:
[color=#000040][color=#FF0040]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).
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; }
Please give me the solution to solve it......
|
| Author: Sabid.M 18 Oct 2008 | Member Level: Bronze | Rating: Points: 2 |
Hi
At last i resolved this error.
Please follow the link
http://nexegen.net/forum/viewtopic.php?f=2&t=41&p=94#p94
|