kartagis / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

jboss-specific empty tag removal has side effects. #115

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I use pysimplesoap against a zimbra server soap interface. I'm running latest 
pysimplesoap development from mercurial.

I use a home-made WSDL which seems to work fine, except that with pysimplesoap, 
the body gets removed from the message at this point of pysimplesoap client.py 
: 

{{{
          elif not self.__soap_server in ('oracle',) or self.__soap_server in ('jbossas6',):
        print "XXX jboss oracle"
            # JBossAS-6 requires no empty method parameters!
            delattr(request("Body", ns=list(soap_namespaces.values()),), method)
}}}

If debugging, the request.as_xml() looks like that :

{{{
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header/>
<soap:Body>
    <GetAllAccountsRequest xmlns="urn:zimbraAdmin">
    </GetAllAccountsRequest>
</soap:Body>
</soap:Envelope>

}}}

Till it goes through the `delattr` line of the code-snippet above. It's then 
like that : 

{{{
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header/>
<soap:Body>

</soap:Body>
</soap:Envelope>

}}}
: empty body.

I'm not totally confortable with your code nor WSDL but is that normal that 
this JBOSS-specific fix is applied to all clients except oracle ?

btw, if this is the wanted behaviour, the condition "or self.__soap_server in 
('jbossas6',)"  is unnecessary.

Original issue reported on code.google.com by joce...@crapouillou.net on 17 Sep 2013 at 2:11

GoogleCodeExporter commented 8 years ago
We should review the tests affecting this.
If removing this specific fix doesn't break anything else, I'm ok with it.

Could you propose a patch?

Original comment by reingart@gmail.com on 17 Sep 2013 at 7:44

GoogleCodeExporter commented 8 years ago
I patched it for myself like attached. It seemed consistent to me with the 
comment.

Original comment by joce...@crapouillou.net on 18 Sep 2013 at 8:12

Attachments:

GoogleCodeExporter commented 8 years ago
Any update on this bug ?

Original comment by joce...@crapouillou.net on 4 Nov 2013 at 4:11

GoogleCodeExporter commented 8 years ago
Sorry for the delays.

If you can, please make a pull request on github (that will be faster and 
easier to merge the patch):

https://github.com/pysimplesoap/pysimplesoap

I've made you commiter just in case you want to commit it directly and/or 
update the issues

Thanks for your contribution!

Original comment by reingart@gmail.com on 20 Dec 2013 at 7:55

GoogleCodeExporter commented 8 years ago
Hi,

No prob. But...

Meanwhile, I'm no longer familiar and no longer using pysimplesoap, so I 
will not make a pull request on github. Sorry.

Thanks for your work, regards,

Jocelyn

Original comment by joce...@crapouillou.net on 23 Dec 2013 at 1:02

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 05a981ea3e40.

Original comment by reingart@gmail.com on 25 May 2014 at 5:12