Created
April 17, 2021 02:55
-
-
Save jvmaia/a54f8709dba31be81cdbe09601730857 to your computer and use it in GitHub Desktop.
unexpected element
This file contains 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
import pretend # pip install pretend | |
from zeep import Client | |
from zeep.transports import Transport | |
client = Client('http://www.dataaccess.com/webservicesserver/numberconversion.wso?WSDL') | |
response = pretend.stub( | |
status_code=200, | |
headers={}, | |
content=""" | |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.dataaccess.com/webservicesserver/"> | |
<soapenv:Header/> | |
<soapenv:Body> | |
<web:NumberToDollarsResponse> | |
<web:NumberToDollarsResult>two dollars</web:NumberToDollarsResult> | |
<web:testing>it will raise an error</web:testing> | |
</web:NumberToDollarsResponse> | |
</soapenv:Body> | |
</soapenv:Envelope> | |
""") | |
operation = client.service._binding._operations['NumberToDollars'] | |
result = client.service._binding.process_reply(client, operation, response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment