[Mono-devel-list] Re: SOAP problem

Sebastian Böhm seb at exse.net
Mon May 16 09:25:28 EDT 2005


Hi,

I was able to fix this problem by makeing a change to WebServiceHelper.cs

I dont know whether this patch is 100% correct, but now I am able to 
call the Google Adwords Api with mono.

If I read the soap spec correctly there should only be one "Header" 
element in the soap envelope.

/sebastian

-----------------------------------------------------------------------------------------------------------------------------
diff -Nur 
mono-1.1.7/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHelper.cs 
mono-1.1.7-soap-fix/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHelper.cs
--- 
mono-1.1.7/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHelper.cs  
2004-07-01 16:11:28.000000000 +0200
+++ 
mono-1.1.7-soap-fix/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHelper.cs 
2005-05-16 15:11:24.000000000 +0200
@@ -109,13 +109,13 @@
            // Serialize headers
            if (headers != null)
            {
+               xtw.WriteStartElement ("soap", "Header", 
WebServiceHelper.SoapEnvelopeNamespace);
                foreach (SoapHeader header in headers)
                {
                    XmlSerializer ser = info.GetHeaderSerializer 
(header.GetType(), methodUse);
-                   xtw.WriteStartElement ("soap", "Header", 
WebServiceHelper.SoapEnvelopeNamespace);
                    ser.Serialize (xtw, header);
-                   xtw.WriteEndElement ();
                }
+               xtw.WriteEndElement ();
            }

            // Serialize body



Sebastian Böhm schrieb:

> Hi,
>
> I tracked down the SOAP problem I have with the Google AdWords Api.
>
> I compared the content of the Soap POST-Data of .Net and of mono an I 
> found the following:
>
> mono:
> --------------
> <soap:Header><useragent >test</useragent></soap:Header>
> <soap:Header><token>qaswedfrtghzujkiolkiuj</token></soap:Header>
> <soap:Header><password>xxxxyyyy</password></soap:Header>
> <soap:Header><email>google at test.com</email></soap:Header>
> --------------
>
> .Net:
> -------------
> <soap:Header>
>    <useragent >test</useragent>
>    <token>qaswedfrtghzujkiolkiuj</token>
>    <password>xxxxyyyy</password>
>    <email>google at test.com</email>
> </soap:Header>
> --------------
>
> And this really makes a difference for google, as the call fails with 
> mono.
>
> (I ensured this by making Soap call from a perl script, first with all 
> headers in one soap-header element, and then in multiple soap-header 
> elements, and it fails with the later)
>
> Is there a way to put all soap headers in one single "Header" Element 
> under mono ?
>
>
> Thank you very much
>
> /sebastian
>




More information about the Mono-devel-list mailing list