Created
December 16, 2009 23:04
-
-
Save ryanfitz/258309 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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