Guest User

Untitled

a guest
Jan 11th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. def get_client():
  2.     t = suds.transport.https.HttpAuthenticated(username=user, password=password)
  3.     try:
  4.         return suds.client.Client(url, transport=t, )
  5.     except Exception, e:
  6.         print e
  7.  
  8. def get_ws_client():
  9.     client = suds.client.Client(url )
  10.     security = suds.wsse.Security()
  11.     token = suds.wsse.UsernameToken(user, password)
  12.     security.tokens.append(token)
  13.    
  14.     client.set_options(wsse=security)
  15.     return client
Add Comment
Please, Sign In to add comment