Skip to content

Accessing DocuSign API from Java using NetBeans

WTP edited this page · 2 revisions

Here are the simple steps. First we are going to start out with a simple Java project. If you already have a project, you do not need to set one up. Step 1

We are going to bypass creating any GUI here and just create a simple JUnit test. This will get us right to the web service call. NetBeans 7.0 allows you to create a JUnit test really easily and will import the correct libraries. Step 2

I tried importing the web service directly from the ASMX endpoint or the ASMX?WSDL url, but that didn’t work so well. What did work well was downloading the WSDL onto my desktop by going to this URL Note that unlike our WS-Security endpoint, which ends with api.asmx, the dsapi.asmx uses the DocuSign HTTP security header. Step 3

Click on the Service Description and save the WSDL file somewhere on your hard drive.

Next step is creating a web service client. This functionality is built into NetBeans as well. Step 4

You will need to navigate to the downloaded WSDL file and specify the package as dsAPI to copy and paste my unit test code below. Step 5

Once you got the web service client set up you can go and fill out the test setup and create a simple test. For this you will need to get your developer account on

Copy this test setup function:


public void setUp() {

String auth = new String("<DocuSignCredentials><Username></Username><Password>*****</Password><IntegratorKey>B111-c81ec71a-cba7-4aa1-b1aa-9513115caf02</IntegratorKey></DocuSignCredentials>");

net.docusign.api._3.DSAPIService service = new net.docusign.api._3.DSAPIService();

port = service.getDSAPIServiceSoap();




Now create a simple test. You will need to plug in your account id here to make it work right away.


public void requestStatusChanges() throws DatatypeConfigurationException {

EnvelopeStatusChangeFilter filter = new EnvelopeStatusChangeFilter();

GregorianCalendar cal = new GregorianCalendar(2011, Calendar.APRIL, 1);



FilteredEnvelopeStatusChanges changes = port.requestStatusChanges(filter);

System.out.println( "Changed envelopes: " + changes.getEnvelopeStatusChanges().getEnvelopeStatusChange().size() );


Fix the references and run the test -- it should pass. Now you are successfully getting statuses of everything that was changed since April Fools day in 2011.

Finally using DocuSign API is as easy from Java as it is from Visual Studio. Great work NetBeans team!


Something went wrong with that request. Please try again.