kartagis / pysimplesoap

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

SoapClient.call() strips xmlns #164

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

When provided with a simplexml object, call() will no longer send the request 
with the xmlns attribute on the method tag. This change seemed to be introduced 
with commit 844504759dcf6e20e04528cb8cca3268609bdd94. Now it creates the method 
tag with the xmlns, but the deletes that and recreates it from a variable in 
such a way that the xmlns attribute is no longer present.

What steps will reproduce the problem?

There may be a less noise way to reproduce it, but here is an example:

import pysimplesoap
params = pysimplesoap.simplexml.SimpleXMLElement('<{0} />'.format('test'))
pysimplesoap.client.SoapClient(location = 'http://www.google.com', 
action='http://www.google.com', namespace='urn:testnamespace', 
trace=True).call('test', params)

Run with this command to cut down the SNR to something useful:

python ./test 2>&1 | egrep "<soap:Body>" -B 2 -A 4

What is the expected output? What do you see instead?

Expected output (and confirmed with pysimplesoap prior to that commit):

[shpadoinkle : 6:43PM] zimbrasoap>python ./test 2>&1 | egrep "<soap:Body>" -B 2 
-A 4
DEBUG:pysimplesoap.client:<?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>
    <test xmlns="urn:testnamespace">
    </test>
</soap:Body>
</soap:Envelope>

Output from pysimplesoap after that commit:

[shpadoinkle : 6:44PM] soapgit>python ./test 2>&1 | egrep "<soap:Body>" -B 2 -A 
4
DEBUG:pysimplesoap.client:<?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>

<test/></soap:Body>
</soap:Envelope>
DEBUG:pysimplesoap.client:status: 405

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

I've tested on git commit 81d819b9c5ad6739749f4b6a3a1d7d3fcf885e71 (current) 
and 844504759dcf6e20e04528cb8cca3268609bdd94 (first with issue) as both being 
affected. The 1.13 download in github is my reference above for a working 
version, though the commit immediately before the change also worked fine.

Original issue reported on code.google.com by secreti...@gmail.com on 30 Oct 2014 at 12:49

Attachments: