How to SOAP API Python request with keys

219 views Asked by At

After spending an entire day on trying to make things work (watching tutorials, reading through wikipedia and blogs), I thought it could be a good idea to ask some experts here on stack overflow.

So I am in the following situation:

  • I am trying to extract some information using an SOAP API with python
  • I have access to an URL and the WSDL definition (url ends with .php)
  • A PDF document which says, that when accesing the API I need to provide a NameB object with valid set of identification keys. (HOW DO I DO THIS?)
  • Valid set of keys
  • I have tried both the zeep library and suds.client without any success

Could somebody explain to me what I need to do in order to receive the desired data?

The WSDL definition looks something like this:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">     
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">         
        <NameA>             
            <body>                 
                 <NameB>                     
                             <Guid1>GUID</Guid1>                                                    
                             <Guid2>GUID</Guid2>                 
                 </NameB>     
                 <Include>1</Include>                 
                 <NumberA> Number_A </NumberA>             
            </body>         
         </NameA>     
     </s:Body> 
</s:Envelope>

I assume that I need to enter the keys between elements Guid1 and Guid2, but HOW?

As you might read between the lines I am not an expert with python.

Thank you in advance! I am grateful for any kind of help!

Please let me know if something is unclear.

1

There are 1 answers

1
carla.z On

I am not a python expert but I am also using ZEEP and Python to call SOAP services.

"that when accesing the API I need to provide a NameB object with valid set of identification keys. (HOW DO I DO THIS?)"

try creating an object and pass it to the call. NameB = { 'Guid1': your_value, 'Guid2': your_value }