Created
July 18, 2012 04:41
-
-
Save bobspryn/3134212 to your computer and use it in GitHub Desktop.
Echosign Test
This file contains hidden or 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/python | |
| import base64 | |
| import suds | |
| import logging | |
| logging.basicConfig(level=logging.INFO) | |
| logging.getLogger('suds.client').setLevel(logging.DEBUG) | |
| url = "https://secure.echosign.com/services/EchoSignDocumentService14?wsdl" | |
| client = suds.client.Client(url, autoblend=True) | |
| with open('/Users/bobspryn/Desktop/flowers.pdf', 'r') as f: | |
| read_data = f.read() | |
| f.closed | |
| wci = client.factory.create("ns17:WidgetCreationInfo") | |
| fileInfo = client.factory.create("ns1:FileInfo") | |
| fileInfo.fileName = "flowers.pdf" | |
| fileInfo.url = "http://www.lohilabs.com/misc/flowers.pdf" | |
| fileInfo.mimeType = None | |
| # fileInfo.file = base64.b64encode(read_data) | |
| wci.name = "Monkeys2" | |
| wci.fileInfos = [fileInfo] | |
| wci.signatureFlow = "SENDER_SIGNATURE_NOT_REQUIRED" | |
| wci.securityOptions = None | |
| wci.callbackInfo = None | |
| wci.widgetCompletionInfo = None | |
| wci.widgetAuthFailureInfo = None | |
| wci.locale = None | |
| wci.mergeFieldInfo = None | |
| r = client.service.createEmbeddedWidget(apiKey="APIKEYHERE", senderInfo=None, widgetCreationInfo=wci) | |
| print r.javascript | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment