[Mono-list] Retrieve SOAP message

Juan Cristóbal Olivares juancri at gmail.com
Thu Nov 16 02:21:28 EST 2006

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;
public string Test (string argument1, string argument2)
    using (StreamReader reader = new StreamReader (
        return reader.ReadToEnd ();

With POST method it worked OK, I received


but it didn't work with SOAP, so I tried this hack:

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="

But it's not working with my mono installation... anybody else can try?

Juan C. Olivares

Juan Cristóbal Olivares
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20061116/e60d7b27/attachment.html 

More information about the Mono-list mailing list