kartagis / pysimplesoap

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

Response namespace problem #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm creating client/service in pysimplesoap for testing interoperability with 
gsoap framework and found small bug in response processing. By default 
pysimplesoap uses default namespace in Request/Response elements like this:

<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:Body>
    <Resolve xmlns="urn:dns:service:1.0"> <!-- default namespace -->
      <Name>osnews.com</Name>
    </Resolve>
  </soap:Body>
</soap:Envelope>

<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:Body>
   <ResolveResponse xmlns="urn:dns:service:1.0"> <!-- default namespace -->
     <IP>74.86.31.159</IP>
   </ResolveResponse>
  </soap:Body>
</soap:Envelope>

Everything is ok and IP element has correct namespace. But gsoap generates 
request in a different way creating global namespace prefix and qualifying 
every element with prefix. This changes behavior of pysimplesoap which in 
response also creates namespace prefix but qualifies only top response element:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:ds="urn:dns:service:1.0">
  <SOAP-ENV:Body>
    <ds:Resolve>
      <ds:Name>osnews.com</ds:Name>
    </ds:Resolve>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:ds="urn:dns:service:1.0"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Body>
    <ds:ResolveResponse>
      <IP>74.86.31.159</IP>
    </ds:ResolveResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This time IP has default namespace which in this particular message is 
undefined.

Original issue reported on code.google.com by Jan.Palus on 23 Jan 2011 at 7:04

GoogleCodeExporter commented 8 years ago
marshall supports to add a prefix to child elements, although this has caused 
troubles in the past with some SOAP implementations.

I have to find a way to support the different server approaches (now we have 
soap_server to handle that)

Original comment by reingart@gmail.com on 6 Jan 2012 at 5:47