kartagis / pysimplesoap

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

Problems calling SoapClient.call with both custom headers and a custom body #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

client = SoapClient(
    location = "http://127.0.0.1:8000/webservices/sample/call/soap",
    action = 'http://127.0.0.1:8000/webservices/sample/call/soap', # SOAPAction
    namespace = "uri:addIntegers", 
    trace = True, ns = False)
params = SimpleXMLElement("""<AddIntegers><a>5</a><b>8</b></AddIntegers>""") # 
manually make request msg
headers = SimpleXMLElement("""<Headers><testHeader>test 
value</testHeader></Headers>""")
response = client.call('AddIntegers',params,headers=headers)

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

Should see the custom <testHeader> in the headers. Instead, this is the request 
output:

<?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>
    <AddIntegers xmlns="uri:addIntegers">
    <headers></headers></AddIntegers>
</soap:Body>
</soap:Envelope>

Note that somehow, a blank <headers> winds up in the body of the output.

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

1.05a, OS X 10.7, Python 2.7.1

Original issue reported on code.google.com by jta...@gmail.com on 28 Mar 2012 at 5:39

GoogleCodeExporter commented 8 years ago
Seems that even using the mechanism in the docs doesn't work either:

client.methodname(headers=headers) produces similar output.

Original comment by jta...@gmail.com on 28 Mar 2012 at 5:41

GoogleCodeExporter commented 8 years ago
Pulled down the source. test_issue46 correctly validates this condition. Looks 
like it's fixed in 1.05c (current dev version). This issue can be closed.

Original comment by jta...@gmail.com on 28 Mar 2012 at 6:59

GoogleCodeExporter commented 8 years ago
Sorry jtatum, I have to publish a new version.

Original comment by reingart@gmail.com on 28 Mar 2012 at 8:18