I need to address the web service interface of another program. The API is provided in wsdl format and I have already implemented the integration via zeep. One function of the API, which is mandatory, requires a MapAdapter from Java, as passing parameter (in the XML Document "values"). My own program is written in Python. Has anyone had the same problem and has a solution?
Edit: XML Document of the API function:
<soapenv:Envelope >
<soapenv:Header/>
<soapenv:Body>
<v23:write>
<connection>
<handle>?</handle>
</connection>
<channel>?</channel>
<values>
<!--Zero or more repetitions:-->
<entries>
<key>?</key>
<value>?</value>
</entries>
<values>
</v23:write>
</soapenv:Body>
</soapenv:Envelope>
Unless the SOAP web service was really badly written, you don't need to worry about anything Java, even if the service is written in Java. So the web service method probably doesn't require a Java MapAdapter as a parameter and you don't need to look up a Python equivalent.
You are using a SOAP web service that receives XML requests and you already have a WSDL file. That should tell you the structure of the XML that you need to send, with what elements and of what types. Zeep reads the WSDL you passed in and allows you to call the SOAP web service like Python functions and sending in Python data.
Most likely, what's happening is that you are sending in some XML message that's isn't fully what the web service expects and the service does a bad job at dealing with it (you say the API itself sends a positive response although there is no data written on the CAN-Bus).
I suggest you remove your Python code from the equation and use SoapUI to troubleshoot the service call. Feed the WSDL to SoapUI and use it to generate request samples for the particular web service method you are calling. Fill in all the required details of the request and make calls with SoapUI until you get to see the expected result from the service.
Once you have done that, write your Python code using zeep to get the same request sent to the service from your code. You can log the messages zeep sends to see what's going on while you do so.
Hope this is useful. I can only provide a generic answer since you haven't provided many details in your question. Posting the WSDL would have helped, or a link to the web service documentation, to figure out what this mysterious MapAdapter parameter is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With