Closed GoogleCodeExporter closed 8 years ago
This is a feature :-)
The problem is that some webservices need empty the request when no parameters
(ie. jboss), and some other do expect an empty tag (ie. oracle).
That's why this version added an optional parameter to SoapClient constructor:
soap_server.
Specify "oracle" as the server, and it would send the empty Body tag:
SoapClient(..., soap_server="oracle")
Please let me know if this works, and if you can attach the full trace (with
http headers showing what kind of server you are using)
Original comment by reingart@gmail.com
on 9 Feb 2012 at 10:17
With soap_server='oracle' it did work yes, I got this body:
<soap:Body>
<RecuperaEstadoDispositivos xmlns="tns">
</RecuperaEstadoDispositivos>
</soap:Body>
Thanks for the tip !
Original comment by kpo...@gmail.com
on 10 Feb 2012 at 11:50
Original comment by reingart@gmail.com
on 10 Feb 2012 at 10:53
It's still not a empty element, the above has a body of "\n ". Ie in xml these
are not equvalent:
- '<foo> </foo>'
- '<foo></foo>'
The xml string should be something like:
<%(soap_ns)s:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"
xmlns:xsd="http://www.w3.org/2001/xmlschema"
xmlns:%(soap_ns)s="%(soap_uri)s"><%(soap_ns)s:header/><%(soap_ns)s:body><%(method)s xmlns="%(namespace)s"></%(method)s></%(soap_ns)s:body></%(soap_ns)s:envelope>"""
The above works for me.
Also, instead of using an argument of soap_server, use a meaningful name? Ie. i
need the same but it's not an oracle server.
(Poor) example: always_include_element=True
Original comment by Frej.Soya
on 28 Apr 2012 at 2:55
Original issue reported on code.google.com by
kpo...@gmail.com
on 8 Feb 2012 at 6:27Attachments: