forked from pysimplesoap/pysimplesoap
-
Notifications
You must be signed in to change notification settings - Fork 0
(pull in upstream) #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rtpg
wants to merge
10
commits into
rtpg:master
Choose a base branch
from
pysimplesoap:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
According to the SOAP standard, the 'SOAPAction' HTTP field must be quoted by double quotes unless the URI is empty and 'there is no indication of the intent of the message' [1]. Not having proper quoting leads to gupnp based devices reply with invalid XML. While there is a proposed fix for that to handle unquoted requests more gracefully [2], the real issue in SoapClient implementation. [1] https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528 [2] https://bugzilla.gnome.org/show_bug.cgi?id=793955
Add quotes to SOAPAction header in SoapClient
With the following complex type:
```
<element name="selectedContractList" nillable="true" type="tns1:selectedContractList"/>
[...]
<complexType name="selectedContractList">
<sequence>
<element maxOccurs="25" minOccurs="1" name="selectedContract" type="xsd:string"/>
</sequence>
</complexType>
```
pysimplesoap would generate the following key in the services description:
```
selectedContractList: selectedContractList
```
This does not allow the input of multiple values in any way. I was expecting to
be able to pass this:
```
'selectedContractList': [ {'selectedContract': '...'}, … ]
```
But this would result in "TypeError: unhashable type: 'dict'" in the
wsdl_validate_params() method. See full traceback below.
With this patch, I'm now able to pass the desired structure.
Full traceback of the unexpected error:
```
ERROR: test_do_web_payment (__main__.WebPaymentAPITestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pypayline/tests-soap-services.py", line 101, in test_do_web_payment
cancel_url='http://freexian.com/cancel/',
File "/home/rhertzog/freexian/projets/boutique/python-payline/pypayline/client.py", line 220, in do_web_payment
notificationURL=notification_url
File "/home/rhertzog/freexian/projets/boutique/python-payline/pypayline/backends/soap.py", line 38, in doWebPayment
response = self.soap_client.doWebPayment(**data)
File "/usr/lib/python2.7/dist-packages/pysimplesoap/client.py", line 177, in <lambda>
return lambda *args, **kwargs: self.wsdl_call(attr, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pysimplesoap/client.py", line 351, in wsdl_call
return self.wsdl_call_with_args(method, args, kwargs)
File "/usr/lib/python2.7/dist-packages/pysimplesoap/client.py", line 372, in wsdl_call_with_args
method, params = self.wsdl_call_get_params(method, input, args, kwargs)
File "/usr/lib/python2.7/dist-packages/pysimplesoap/client.py", line 404, in wsdl_call_get_params
valid, errors, warnings = self.wsdl_validate_params(input, all_args)
File "/usr/lib/python2.7/dist-packages/pysimplesoap/client.py", line 474, in wsdl_validate_params
next_valid, next_errors, next_warnings = self.wsdl_validate_params(struct[key], value[key])
File "/usr/lib/python2.7/dist-packages/pysimplesoap/client.py", line 474, in wsdl_validate_params
next_valid, next_errors, next_warnings = self.wsdl_validate_params(struct[key], value[key])
File "/usr/lib/python2.7/dist-packages/pysimplesoap/client.py", line 470, in wsdl_validate_params
if key not in struct:
TypeError: unhashable type: 'dict'
```
Support integer values in maxOccurs attribute
3 instances, supersedes #150
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.