[Mono-list] Retrieve SOAP message

Atsushi Eno atsushi at ximian.com
Thu Nov 16 20:12:52 EST 2006


Hi,

Your example shows somewhat unusual ;-) context usage so it is
likely to cause issues. Anyways please file a bug on bugzilla
so that we can keep track of the bug status.

Atsushi Eno

Juan Cristóbal Olivares wrote:
> Sébastien Mosser asked how to retrieve the SOAP message from a web service.
> I have good and bad news. The good news is "it's possible" the bad news is
> "mono bug".
> 
> Ok, this is the explanation. I tried in Microsoft .NET first because of the
> documentation. I did this:
> 
> using System.IO;
> ....
> ....
> [WebMethod]
> public string Test (string argument1, string argument2)
> {
>    using (StreamReader reader = new StreamReader (
> this.Context.Request.InputStream))
>        return reader.ReadToEnd ();
> }
> 
> With POST method it worked OK, I received
> 
> argument1=sometext&argument2=othertext
> 
> but it didn't work with SOAP, so I tried this hack:
> 
> [WebMethod]
> public string Test (string argument1, string argument2)
> {
>    Stream stream = this.Context.Request.InputStream;
>    stream.Seek (0, SeekOrigin.Begin);
>    using (StreamReader reader = new StreamReader (stream))
>        return reader.ReadToEnd ();
> }
> 
> and it worked great:
> 
> <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema"><soap:Body><Test xmlns="
> http://tempuri.org/"><argument1>hola</argument1>
> <argument2>bye</argument2></Test></soap:Body></soap:Envelope>
> 
> But it's not working with my mono installation... anybody else can try?
> 
> Juan C. Olivares
> www.juancri.com
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list



More information about the Mono-list mailing list