RosesDurden / pysimplesoap

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

WSDL headers not interpreted correctly #122

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
The following code will reproduce the problem:

from pysimplesoap.client import SoapClient
import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)-15s %(name)-5s 
%(levelname)-8s %(message)s')

APIURL = 
"https://ecommercetest.collector.se/v3.0/InvoiceServiceV31.svc?singleWsdl"
client = SoapClient(wsdl=APIURL)

# set headers
client['Username'] = 'user'
client['Password'] = 'pass'
client['ClientIpAddress'] = '127.0.0.1'

variables = {
    "CountryCode": "SE",
    "RegNo": "1234567890",
}
response = client.GetAddress(**variables)

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

The generated SOAP message was:
2013-10-01 17:07:41,049 pysimplesoap.client DEBUG    <?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><ClientIpAddress>127.0.0.1</ClientIpAddress></soap:Header>
<soap:Body>
    <GetAddressRequest xmlns="http://schemas.ecommerce.collector.se/v30/InvoiceService">
    <CountryCode>SE</CountryCode><RegNo>1234567890</RegNo></GetAddressRequest>
</soap:Body>
</soap:Envelope>

Only "ClientIpAddress" parameter is supplied in the header (not Username or 
Password).

What version of the product are you using? On what operating system?
1.10 - Ubuntu 13.04

Please provide any additional information below.

Looking at client.services reveals that the only ClientIpAddress is there:
u'parts': {u'input_body': None,
u'input_header': {u'message': u'tns:GetAddressRequest_Headers',
u'part': u'ClientIpAddress'},
u'output_body': None,
u'output_header': None}},

WDSL definition part (whole WDSL attached to this issue):
<wsdl:message name="GetAddressRequest_Headers">
<wsdl:part name="ClientIpAddress" element="tns:ClientIpAddress"/>
<wsdl:part name="Password" element="tns:Password"/>
<wsdl:part name="Username" element="tns:Username"/>
</wsdl:message>

Original issue reported on code.google.com by inactive...@bokavard.se on 1 Oct 2013 at 3:18

Attachments:

GoogleCodeExporter commented 8 years ago
Can you test the latest changes (1.11) in the repository?

You can download a .zip from:

https://code.google.com/p/pysimplesoap/source/browse/

Instruction to get the source using mercurial:

https://code.google.com/p/pysimplesoap/source/checkout

Original comment by reingart@gmail.com on 1 Oct 2013 at 5:55

GoogleCodeExporter commented 8 years ago
Tested with 1.11, problem is still there unfortunately.

Original comment by inactive...@bokavard.se on 1 Oct 2013 at 6:05

GoogleCodeExporter commented 8 years ago
Could you test the latest developement version 1.12?

Please download and test the latest source code from the repository until the 
release:

https://pysimplesoap.googlecode.com/archive/default.zip

There has been some adjustments in message part processing.

Original comment by reingart@gmail.com on 22 Jan 2014 at 4:51

GoogleCodeExporter commented 8 years ago
I'm sorry I've deleted the code. I'm sure you can easily create a test case for 
my scenario above.

To anyone with same issue as me: I'm using suds now. Works great.

Original comment by inactive...@bokavard.se on 22 Jan 2014 at 7:31

GoogleCodeExporter commented 8 years ago
This issue was closed by revision b5d8a18406d3.

Original comment by reingart@gmail.com on 10 May 2014 at 10:39