brownmatias / pysimplesoap

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

Can't handle SOAP with multiple namespaces (which includes most standards) #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Neither SimpleXMLElement nor the dispatcher appear to be able to parse XML that 
has multiple namespaces in it.

See the attachment for an example

<?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" 
xmlns:xvrev="http://www.nrs.eskom.co.za/xmlvend/revenue/2.1/schema" 
xmlns:xvmeter="http://www.nrs.eskom.co.za/xmlvend/meter/2.1/schema" 
xmlns:xvbase="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema">
 <soap:Body>
  <xvrev:creditVendReq>
    <xvbase:clientID  id="0001" />
    12345
  </xvrev:creditVendReq>
 </soap:Body>
</soap:Envelope>

You can'd find the number through xmlobj.Body.creditVendReq because the inner 
tag is soap:Body, nor can you find it as xmlobj.soap:Body.creditVendReq as the 
":" in the tagname is a syntax error.  There doesn't seem to be an alternative 
way to pass "soap:Body". 

You can't use the nameset and prefix to help with this because their are 
multiple namespaces (in fact this XML snipped above is significantly simplified 
from the SOAP call that is specified in the xmlvend standard.

This bug is also the case with the dispatcher which can't refer to that field 
as an argument. 

The dispatcher also has the problem that there appears to be no way to pass the 
id attribute to the function, but that's a different Issue. 

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by mitra.ar...@gmail.com on 11 Dec 2012 at 10:00

Attachments:

GoogleCodeExporter commented 9 years ago
Missed the last two questions - I don't know what version I'm using, I 
installed it with "pip" yesterday so presume its current, but I dont know how 
to query the version number. 

Its running on OSX but this doesn't appear to be OS dependent.  

Original comment by mitra.ar...@gmail.com on 11 Dec 2012 at 10:02

GoogleCodeExporter commented 9 years ago
yes, this is in my TODO list too
could you provide a wsdl?
what server platform are you usign? (ie. .NET 4.x)

Original comment by reingart@gmail.com on 14 Jan 2013 at 6:47

GoogleCodeExporter commented 9 years ago
Any news about this issue? I have the same problem

Original comment by rocchi....@gmail.com on 26 Jul 2013 at 10:49

GoogleCodeExporter commented 9 years ago
I'm working on it ;-) ASAP I'll submit a new version with support, a 
preliminary fix is partially working.

Could you provide the WSDL url and a test case?
The xml only is not enought to test the SOAP call.

BTW, SimpleXmlElement DOES ALREADY support multiple namespaces, you need to 
specify the prefix or the uri (using the __call__ method):

# using the namespace prefix:
foo = SimpleXMLElement(test_xmlvend_try)
print "creditVendReq=", str(foo("soap:Body")("xvrev:creditVendReq"))

# using the namespace uri:
foo = SimpleXMLElement(test_xmlvend_try)
print "creditVendReq=", str(foo("Body", 
ns="http://schemas.xmlsoap.org/soap/envelope/")("creditVendReq", 
ns="http://www.nrs.eskom.co.za/xmlvend/revenue/2.1/schema"))

Original comment by reingart@gmail.com on 26 Jul 2013 at 11:14

GoogleCodeExporter commented 9 years ago
This seems to be fixed, so I'm closing this issue due inactivity, please reopen 
providing answers and test data (wsdl) if the problem persist.

Original comment by reingart@gmail.com on 22 Jan 2014 at 3:29