0

I don't get any information of my SOAP client when I print it with SUDS.

Code:

url = 'https://website.com/API/AuthenticationService.asmx'
headers = {'Content-Type': 'text/xml; charset=utf-8'}
client = Client(url, headers = headers)
print client

Print result:

Suds ( https://fedorahosted.org/suds/ )  version: 0.6

I should be able to pass username and password with XML:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<Login xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://Iris.net">
<username>Username</username>
<password>Password</password>
</Login>
</s:Body>
</s:Envelope>

If I try to use any service or factory namespaces, I get an error.

With trying to use service:

response = client.service.Login(username)

Error:

Exception: No services defined

And with factory:

    login = client.factory.create('Login')

Error:

Exception: (Login, None, ), must be qref
MMakela
  • 167
  • 2
  • 16

1 Answers1

0

It seems like the web service can't use suds, so I found it work with xml request. Found correct answer here: Python: Making a request with suds

Community
  • 1
  • 1
MMakela
  • 167
  • 2
  • 16