I'm just getting started with the DocuSign SOAP API, and I'm using the examples from their developer site as well as the GitHub site. While the two bits of code don't quite match, neither seems to work. I keep getting a System.ServiceModel.FaultException with the message, "Security requirements are not satisfied because the security header is not present in the incoming message."
I'm using a Service Reference with VS2012 to proxy the service https://demo.docusign.net/api/3.0/dsapi.asmx, and I have verified that my account works by using the online REST API explorer to obtain login information for my demo account.
Anyone run into this or have any suggestions?
I was getting the same error message until I changed the binding element in my web.config to match this:
<binding name="APIServiceSoap" allowCookies="true" maxReceivedMessageSize="50000000">
<security mode="TransportWithMessageCredential" />
</binding>
A Github DocuSign SDK that was a valuable resource for me: https://github.com/docusign/DocuSign-eSignature-SDK
Also, as in the Github link above, I am using 2 Service References (CredentialAPI and DocuSignAPI).
I found that I had to create a Service Reference (and not a Web Reference) pointed to https://demo.docusign.net/api/3.0/dsapi.asmx (and not https://demo.docusign.net/api/3.0/api.asmx as the sample at http://www.docusign.com/p/APIGuide/Content/DocuSignService%20API%20Overview/Code%20Samples.htm suggests).
I also had to make sure that I added the "X-DocuSign-Authentication" to the request headers by using a version of the sample code here http://www.docusign.com/p/APIGuide/APIGuide.htm#Introduction+Changes/Using DocuSign WSDLs in the Net Environment.htm%3FTocPath%3DUsing%20DocuSign%20WSDLs%7C___1
There are two way to pass member credentials using DocuSign's SOAP API:
- SOAP Header via WS-Security UsernameToken
- HTTP Header via a custom field “X-DocuSign-Authentication”
The DocuSign SOAP API has two different end points where everything is identical except for authentation: API.asmx
and DSAPI.asmx
. The API.asmx
end point requires the WS-Security UsernameToken in the SOAP header authentication. The DSAPI.asmx
and AccountManagement.asmx
end points require the HTTP Header authentication method.
See DocuSign's SOAP documentation for more info:
http://www.docusign.com/developer-center/documentation