title: How to call a web service function in Python?
body: <p>I am trying to consume a SAP web service using Python. I am able to get the response, but I when calling the method in it I get an error in response.
  How do I call a web service method using Python?</p>
  
  <p><strong>Python code:</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>from suds.client import Client
  import json
  wsdl_url = "&lt;URL&gt;"
  client = Client(url = wsdl_url, username = "&lt;username&gt;", password = "&lt;password&gt;")
  print(client)
  x = client.service[0].Methods[1]
  print(x)
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>Suds ( https://github.com/cackharot/suds-py3 )  version: 1.3.3.0 IN  build: 20170311
  
  Service ( ziot_service1 ) tns="urn:sap-com:document:sap:rfc:functions" Prefixes (1)
        ns0 = "urn:sap-com:document:sap:rfc:functions"    Ports (2):
        (ziot_service1)
           Methods (1):
              ZIOT_SERVICE1()
           Types (3):
              char10
              char4
              date10
        (ziot_service1_soap12)
           Methods (1):
              ZIOT_SERVICE1()
           Types (3):
              char10
              char4
              date10
  --------------------------------------------------------------------------------
  
  Traceback (most recent call last):   File "webservice0.py", line 6, in &lt;module&gt;
      x = client.service[0].Methods[1]   File "C:\Users\Sid-PC\AppData\Local\Programs\Python\Python37\lib\site-packages\suds\client.py", line 511, in __getattr__
      return self[name]   File "C:\Users\Sid-PC\AppData\Local\Programs\Python\Python37\lib\site-packages\suds\client.py", line 524, in __getitem__
      raise MethodNotFound(qn) suds.MethodNotFound: Method not found: 'ziot_service1.ziot_service1.Methods'
  
  </code></pre>
  
  <p>Where am I going wrong and how do I fix it?</p>