Skip to Content
0
Jul 02, 2019 at 11:50 AM

how to call a method in SAP Web Service using Python

957 Views

hello,

i am trying to call a web service using python. I'm able to call the service but im not able to call the method in it. how do i call the method?

python:

from suds.client import Client
import json
wsdl_url = "http://192.168.1.10:8000/sap/bc/srt/wsdl/flv_10002A111AD1/srvc_url/sap/bc/srt/rfc/sap/ziot_service/900/ziot_service1/ziot_service1?sap-client=900"
client = Client(url=wsdl_url,username="<username>",password="<password>")
# print(client)
x = client.service[0].Methods[1].ZIOT_SERVICE1()
print(x)

error:

  File "webservice0.py", line 6, in <module>
    x = client.service[0].Methods[1].ZIOT_SERVICE1()
  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'

regards

Siddharth Shaligram