How to solve System.InvalidOperationException: For request in operation Test to be a stream the operation must have a single parameter whose type is Stream

Posted by: hongmeigs WebLog, on 03 Mar 2010 | View original | Bookmarked: 0 time(s)

 You are getting this error because the default WCF stream formatter does not support this. You are probably trying to upload some file stream and transfer some other parameters, such as file name, etc within the same method. For example, [OperationContract]  void Test(string fileName, Stream fileContent); If this is not a REST endpoint, you can work around this issue by using MessageContract wrapping the multiple parameters into one class. If this is a REST endpoint, this programming...

Category: WCF | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 2310 | Hits: 74

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD