[Mono-aspnet-list] Implement Streamed Parameter using webHttpBinding in Mono
deena
deena.s at wisdomleaf.com
Tue Apr 3 14:23:28 UTC 2012
0 down vote favorite
share [g+] share [fb] share [tw]
My Interface of WCF looks like
*[OperationContract]
[WebInvoke(Method = "POST",
UriTemplate = "/PostSample")]
string PostSampleMethod(System.IO.Stream data);*
My Implementation looks like
* public string PostSampleMethod(System.IO.Stream data)
{
return "Success";
}*
My Web.config Looks like
*<system.serviceModel>
<services>
<service name="EncodingCharacterService.Service1"
behaviorConfiguration="myServiceBehavior">
<endpoint name="webHttpBinding" address="Rest"
binding="webHttpBinding" contract="EncodingCharacterService.IService1"
behaviorConfiguration="webHttp">
</endpoint>
<endpoint name="mexHttpBinding" address="mex"
binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="myServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
<behavior name="a">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webHttp">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
*
The above code works fine in .NET (Windows Platform). When I move the same
code to mono on Linux box, I am unable to consume the WCF service.
I am consuming service through Fiddler.
I am using content type "application/x-www-form-urlencoded".
I got Exception "Expected element 'Stream' in namespace
'http://schemas.datacontract.org/2004/07/System.IO', but found Element node
'anyType' in namespace
'http://schemas.microsoft.com/2003/10/Serialization/'" while loading the SVC
with endpoint name and uri template
Ex: hostname/abc.svc/Rest/PostSample
Could any one let me know where I went wrong or any additional configuration
is required to support Stream Parameters in WCF.
I also tried transferMode in web.config. But no success. I tried all the
samples I found in google. But no success.
If any other method to implement Streamed Parameter, please let me know.
--
View this message in context: http://mono.1490590.n4.nabble.com/Implement-Streamed-Parameter-using-webHttpBinding-in-Mono-tp4528936p4528936.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
More information about the Mono-aspnet-list
mailing list