C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Streamed Transfers using WCF and VS2008


Posted Date: 16 Oct 2008      Total Responses: 1

Posted By: Sabid.M       Member Level: Bronze     Points: 1





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......




Responses

Author: Sabid.M    18 Oct 2008Member Level: BronzeRating:     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


Post Reply
You must Sign In to post a response.
Next : label formatting
Previous : Hosting WCF Service in IIS
Return to Discussion Forum
Post New Message
Category: WCF

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

conference calls

Contact Us    Privacy Policy    Terms Of Use