Skip to content

Instantly share code, notes, and snippets.

@ryanfitz
Created December 16, 2009 23:04
Show Gist options
  • Save ryanfitz/258309 to your computer and use it in GitHub Desktop.
Save ryanfitz/258309 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
from suds.client import Client
from suds.wsse import *
USERNAME = '[email protected]'
PASS = 'optimize'
URL = 'http://localhost:20500/ConstantsServiceVersionOne?wsdl'
def main():
client = Client(URL)
client.set_options(wsse=create_security_header())
print client
result = client.service.getAllAdSizes()
print result
def create_security_header():
security = Security()
token = UsernameToken(USERNAME, PASS)
token.setnonce()
token.setcreated()
security.tokens.append(token)
return security
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment