Hello,
I have a service including the (simplified) following method:
@soap(String _returns=String)
)
def UploadResponse(self, xml_string):
do_stuff(xml_string)
Content is suppoed to be an XML literal sent from a 3rd party on which I
have no control on.
Unfortunalty, if "xml_string" contains any XML string in the SOAP
envelop, the "xml_string" parameter will be emtpy.
Now it make sense because etree parse it and when soaplib extract text
from it, there is no text node in the parameter node (since it full of
XML nodes), so it returns an empty string.
The problem is that __it does the same with an escaped XML string__
because in core._base.py happens this:
def parse_xml_string(self, xml_string, charset=None):
from xml.sax.saxutils import unescape, escape
x = unescape(xml_string, {"'": "'", """: '"'})
return _parse_xml_string(x, charset)
The entire SOAP envelop is unescaped, including the content of each
parameter, turning it into valid XML, which is then parsed by etree.
I'm not sure why this is needed, nor why this is apply to the entire
document.
Is there a way to bypass that ? I can't force my 3rd party to use CDATA.
Best regards,
Kevin Samuel
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap