Skip to navigation

Using Docusign WSDLs in the .NET environment

View as Markdown

The WSDL files may be used to generate Web Reference proxy classes for use in the .NET environment. Authentication is provided in the HTTP header for functions that require it. The standard method to accomplish this is to create a Web Reference to the WSDL file and wrap the resulting proxy class to provide the HTTP header.

To create a Web Reference in Visual Studio 2010 for WSDL files:

  1. Create a project.
  2. In Solution Explorer, right-click on the project and select Add Service Reference.
  3. In the Address, type the URL to the WSDL file (for example https://demo.docusign.net/api/3.0/dsapi.asmx).
  4. Type a Namespace (for example DocusignDemo) and click OK.

HTTP Header:

When you make a call to Docusign, you need to add an HTTP header to your code. For example:

String auth = " <DocusignCredentials >
<Username > " + userName + " </Username> <Password > " + password + " </Password><IntegratorKey > " + integratorKey + " </IntegratorKey> </DocusignCredentials>";
DSAPIServiceSoapClient client = new DSAPIServiceSoapClient();
using(OperationContextScope scope = new System.ServiceModel.OperationContextScope(client.InnerChannel)) {
HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty();
httpRequestProperty.Headers.Add("X-Docusign-Authentication", auth);
OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;
EnvelopeStatus status = client.RequestStatusEx("D3151108-FC4C-4D1A-A168-86E5233AACDB");
Console.Out.WriteLine("Subject: " + status.Subject);
}