1

Trying to work with the echosign SOAP API.

The wsdl is here: https://secure.echosign.com/services/EchoSignDocumentService14?wsdl

When I try to create certain objects, it appears to not be able to find the type, even after listing it in print client

import suds

url = "https://secure.echosign.com/services/EchoSignDocumentService14?wsdl"

client = suds.client.Client(url)
print client


  Service ( EchoSignDocumentService14 ) tns="http://api.echosign"
     Prefixes (10)
        ns0 = "http://api.echosign"
        ns1 = "http://dto.api.echosign"
        ns2 = "http://dto10.api.echosign"
        ns3 = "http://dto11.api.echosign"
        ns4 = "http://dto12.api.echosign"
        ns5 = "http://dto13.api.echosign"
        ns15 = "http://dto14.api.echosign"
        ns16 = "http://dto7.api.echosign"
        ns17 = "http://dto8.api.echosign"
        ns18 = "http://dto9.api.echosign"
     Ports (1):
        (EchoSignDocumentService14HttpPort)
           Methods (45):
                 ...
           Types (146):
              ns1:CallbackInfo
              ns17:WidgetCreationInfo

Trimmed for brevity, but showing the namespaces and the 2 types I'm concerned with right now.

Trying to run WCI = client.factory.create("ns17:WidgetCreationInfo") generates this error:

client.factory.create("ns17:WidgetCreationInfo") Traceback (most recent call last): File "", line 1, in File "build/bdist.macosx-10.7-intel/egg/suds/client.py", line 244, in create suds.BuildError: An error occured while building a instance of (ns17:WidgetCreationInfo). As a result the object you requested could not be constructed. It is recommended that you construct the type manually using a Suds object. Please open a ticket with a description of this error. Reason: Type not found: '(CallbackInfo, http://dto.api.echosign, )'

So it doesn't appear to be able to find the CallbackInfo type. Maybe its because its missing the ns there?

2 Answers 2

5

Again, figured it out 15 min after posting here.

suds has an option to cross-pollinate all the namespaces so they all import each others schemas. autoblend can be set in the constructor or using the set_options method.

suds.client.Client(url, autoblend=True)
Sign up to request clarification or add additional context in comments.

6 Comments

This just saved me! Although I keep getting errorCode = "EXCEPTION" when actually trying to create the embedded widget. Did it work for you?
Yes. They don't exactly provide much information in their errorMessage do they? I got that until I formatted the request exactly right. Here's a working example (I tried both the url and passing the encoded file which is commented out, both work) gist.github.com/3140960
Also, you might not have to explicitly None out all those properties, but I believe you do for some.
Wow, thanks! That did the trick. I was setting fileInfos = [fileInfo] instead of creating the ArrayOfFileInfo
I did the same thing at first. :) They don't have the most graceful API. I mean... SOAP? Its 2012 guys.
|
0

Take a look in the WSDL, it seems lots of definitions in http://*.api.echosign that suds cannot fetch.

Either update your /etc/hosts to make these not well-formed domains can be reached, or save the wsdl locally, modify it, then use Client('file://...', ...) to create your suds client.

1 Comment

I believe its fetching them all fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.