2006-02-20 22:27:30 +01:00
|
|
|
#!/usr/bin/python
|
2006-03-16 00:19:00 +01:00
|
|
|
import sys
|
2006-02-21 11:42:11 +01:00
|
|
|
import socket
|
2006-03-16 00:19:00 +01:00
|
|
|
from ZSI import ServiceProxy
|
2006-02-20 22:27:30 +01:00
|
|
|
|
|
|
|
class SOAPClient:
|
|
|
|
def __init__(self):
|
2006-03-16 00:19:00 +01:00
|
|
|
url = 'http://localhost:8080/gnuviechadmin'
|
|
|
|
self.service = ServiceProxy(url, use_wsdl=True,
|
|
|
|
tracefile=sys.stdout)
|
|
|
|
print 'service is ', self.service
|
|
|
|
print self.service.__dict__
|
2006-02-20 22:27:30 +01:00
|
|
|
|
2006-03-16 00:19:00 +01:00
|
|
|
def authenticate(self, login, password):
|
2006-02-21 11:42:11 +01:00
|
|
|
try:
|
2006-03-16 00:19:00 +01:00
|
|
|
response = self.service.Authenticate(login=login, password=password)
|
|
|
|
print response
|
2006-02-21 11:42:11 +01:00
|
|
|
except socket.error:
|
|
|
|
return "couldn't connect"
|
|
|
|
|
2006-03-16 00:19:00 +01:00
|
|
|
if __name__ == "__main__":
|
2006-02-21 11:42:11 +01:00
|
|
|
client = SOAPClient()
|
2006-03-16 00:19:00 +01:00
|
|
|
print client.authenticate("jan", "jan")
|