Search code examples
wsdlpython-3.4soap-clientpysimplesoap

PySimpleSoap and wsdl


I'm trying to integrate with the following web service: http://demo.eu.yellowfin.com.au/services/AdministrationService?wsdl

unfortunately I haven't found any information about pysimplesoap that can help me to figure out how I can make a request in my case:

I got so far as this:

from pysimplesoap.client import SoapClient


yellowfin_url = 'http://demo.eu.yellowfin.com.au/services/AdministrationService?wsdl'
c = SoapClient(wsdl=yellowfin_url, soap_ns='soap', trace=False)

req = c.services['AdministrationServiceService']['ports']['AdministrationService']['operations']['remoteAdministrationCall']['input']['remoteAdministrationCallRequest']

req['in0']['loginId'] = '[email protected]'
req['in0']['password'] = 'test'
req['in0']['function'] = 'LOGINUSER'
req['in0']['orgId'] = 1
req['in0']['person']['userId'] = '[email protected]'
req['in0']['person']['password'] = 'reset123'

resp = c.remoteAdministrationCall()

there is no way I can get the complextype to send, so I had a look at the documentation of the object and I thought that overriding the params I needed would have worked but the request I make is always empty.

I tried to pass the "undicted" payload inside as normal keyword args, didn't work... I would use something else but this is the only lib that is compatible with python3 I just want to know if there is something like suds where i can do:

c = Client(yellowfin_url, faults=False)

req = c.factory.create('AdministrationServiceRequest')

and get the xml object

Any thoughts?

Thanks


Solution

  • Try:

    response = c.remoteAdministrationCall(
        loginId='[email protected]',
        password='test',
        function='LOGINUSER',
        orgId=1,
        person={'userId': '[email protected]', 'password': 'reset123'}
    )
    

    I'm not completely sure about the person part.

    You can call c.help('remoteAdministrationCall') to find out which parameters the operation accepts and other things.