Reputation: 23
I'm trying to create a client in Python, which would communicate with the web service(NuSoap). Identification data and the query is sent in XML as encoding string(base64). This XML is:
<CV3Data version="2.0">
<request>
<authenticate>
<user>m*****</user>
<pass>m******</pass>
<serviceID>b*******0</serviceID>
</authenticate>
<requests>
<reqProducts>
<reqProductRange start="9294" end="9296"/>
</reqProducts>
</requests>
</request>
</CV3Data>
This web service has this wsdl:
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="https://service.commercev3.com/CV3Data.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="https://service.commercev3.com/CV3Data.xsd">
<types>
<xsd:schema targetNamespace="https://service.commercev3.com/CV3Data.xsd">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
</xsd:schema>
</types>
<message name="CV3DataRequest">
<part name="data" type="xsd:base64Binary"/>
</message>
<message name="CV3DataResponse">
<part name="return" type="xsd:base64Binary"/>
</message>
<portType name="CV3Data.xsdPortType">
<operation name="CV3Data">
<input message="tns:CV3DataRequest"/>
<output message="tns:CV3DataResponse"/>
</operation>
</portType>
<binding name="CV3Data.xsdBinding" type="tns:CV3Data.xsdPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="CV3Data">
<soap:operation soapAction="http://service.commercev3.com/index.php/CV3Data" style="rpc"/>
<input>
<soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="CV3Data.xsd">
<port name="CV3Data.xsdPort" binding="tns:CV3Data.xsdBinding">
<soap:address location="http://service.commercev3.com/index.php"/>
</port>
</service>
</definitions>
I need to read CV3Data.
Upvotes: 0
Views: 1341
Reputation: 146
To read the "encoded" XML you have to "decode" it. :D
I've got a project using suds with EWS where I need to download attachments. EWS returns attachments in Base64Binary so I just use b64decode from base64 to do it. Something like this should work for you:
from base64 import b64decode
encoded_xml = NuSoapMethodToGetBase64EncodedXMLString()
decoded_xml = b64decode(CV3Data)
Upvotes: 2