Welcome!

Blog Feed Post

The Easiest Way to Get Going with DocuSign API with Java

The Easiest Way to Get Going with DocuSign API with Java

I’ve had my differences with the Java web service implementation for a long time. Though I loved Java from when Duke was going through his terrible twos, I had issues with how complicated things were. Java web services were no exception. Axis1 implementation should have shipped with Advil. Axis2 was a little better but still required me to do breathing exercises. I recently downloaded NetBeans 7.0 and tried out the JAX-WS integration from within the IDE. This turned out to be the easiest way to get going with consuming a SOAP Web Service.

At DocuSign, we have made steps towards simplification as well. Instead of relying on WS-Security with tokens, timestamps and NONCE values, we started offering web service endpoints that rely in pretty simple HTTP header authentication. The combination of both allows you to get up and going with a web service connecting to DocuSign in just a few minutes.

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.

The Easiest Way to Get Going with DocuSign API with Java

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.

The Easiest Way to Get Going with DocuSign API with Java

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 https://demo.docusign.net/api/3.0/dsapi.asmx. Note that unlike our WS-Security endpoint, which ends with api.asmx, the dsapi.asmx uses the DocuSign HTTP security header.

The Easiest Way to Get Going with DocuSign API with Java

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.

The Easiest Way to Get Going with DocuSign API with Java

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.

The Easiest Way to Get Going with DocuSign API with Java

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 www.docusign.com/devcenter

Copy this test setup function:
String auth = new String("<DocuSignCredentials><Username>[email protected]</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();
((BindingProvider)port).getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS,Collections.singletonMap("X-DocuSign-Authentication",Collections.singletonList(auth)));

Now create a simple test. You will need to plug in your account id here to make it work right away.
EnvelopeStatusChangeFilter filter = new EnvelopeStatusChangeFilter();
GregorianCalendar cal = new GregorianCalendar(2011, 04, 01);
filter.setStatusChangedSince(DatatypeFactory.newInstance().newXMLGregorianCalendar(cal));
filter.setAccountId("766e7948-6866-1be3-9ea1-4153613dc14f");
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!

Share/Bookmark

Read the original blog entry...

More Stories By An Bui

Social Media Professional with substantial experience identifying, characterizing and connecting online communities and authors. Strong orientation on actionable recommendations that provide mutually beneficial value for communities and organizations for stakeholders.

Currently, I serve as the social media manager for DocuSign, Inc., the market leader and global standard for electronic signature. DocuSign provides the world’s largest and fastest growing electronic signature platform, empowering businesses to complete transactions online quickly and securely while improving compliance and dramatically reducing costs.

DocuSign is the only cloud computing-based electronic signature platform that entirely replaces slow, expensive paper transactions with a fast, efficient and completely digital solution. Accessible from any Internet-connected device, DocuSign supports virtually any document and form type in simple and complex workflows, and provides broad user authentication options, data collection, secure document/data storage and retrieval, as well as real-time negotiation and collaboration tools.

Latest Stories
SYS-CON Events announced today that Cloud Academy will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Cloud Academy is the industry’s most innovative, vendor-neutral cloud technology training platform. Cloud Academy provides continuous learning solutions for individuals and enterprise teams for Amazon Web Services, Microsoft Azure, Google Cloud Platform, and the most popular cloud computing technologies. Ge...
SYS-CON Events announced today that Juniper Networks (NYSE: JNPR), an industry leader in automated, scalable and secure networks, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Juniper Networks challenges the status quo with products, solutions and services that transform the economics of networking. The company co-innovates with customers and partners to deliver automated, scalable and secure network...
Existing Big Data solutions are mainly focused on the discovery and analysis of data. The solutions are scalable and highly available but tedious when swapping in and swapping out occurs in disarray and thrashing takes place. The resolution for thrashing through machine learning algorithms and support nomenclature is through simple techniques. Organizations that have been collecting large customer data are increasingly seeing the need to use the data for swapping in and out and thrashing occurs ...
SYS-CON Events announced today that Fusion, a leading provider of cloud services, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Fusion, a leading provider of integrated cloud solutions to small, medium and large businesses, is the industry’s single source for the cloud. Fusion’s advanced, proprietary cloud service platform enables the integration of leading edge solutions in the cloud, including cloud...
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.
SYS-CON Events announced today that Interoute has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Interoute is the owner operator of Europe's largest network and a global cloud services platform, which encompasses over 70,000 km of lit fiber, 15 data centers, 17 virtual data centers and 33 colocation centers, with connections to 195 additional partner data centers. Our full-service Unifie...
SYS-CON Events announced today that WineSOFT will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Based in Seoul and Irvine, WineSOFT is an innovative software house focusing on internet infrastructure solutions. The venture started as a bootstrap start-up in 2010 by focusing on making the internet faster and more powerful. WineSOFT’s knowledge is based on the expertise of TCP/IP, VPN, SSL, peer-to-peer, mob...
Detecting internal user threats in the Big Data eco-system is challenging and cumbersome. Many organizations monitor internal usage of the Big Data eco-system using a set of alerts. This is not a scalable process given the increase in the number of alerts with the accelerating growth in data volume and user base. Organizations are increasingly leveraging machine learning to monitor only those data elements that are sensitive and critical, autonomously establish monitoring policies, and to detect...
As enterprise cloud becomes the norm, businesses and government programs must address compounded regulatory compliance related to data privacy and information protection. The most recent, Controlled Unclassified Information and the EU’s GDPR have board level implications and companies still struggle with demonstrating due diligence. Developers and DevOps leaders, as part of the pre-planning process and the associated supply chain, could benefit from updating their code libraries and design by in...
SYS-CON Events announced today that DivvyCloud will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. DivvyCloud software enables organizations to achieve their cloud computing goals by simplifying and automating security, compliance and cost optimization of public and private cloud infrastructure. Using DivvyCloud, customers can leverage programmatic Bots to identify and remediate common cloud problems in rea...
SYS-CON Events announced today that Linux Academy, the foremost online Linux and cloud training platform and community, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Linux Academy was founded on the belief that providing high-quality, in-depth training should be available at an affordable price. Industry leaders in quality training, provided services, and student certification passes, its goal is to c...
SYS-CON Events announced today that HTBase will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. HTBase (Gartner 2016 Cool Vendor) delivers a Composable IT infrastructure solution architected for agility and increased efficiency. It turns compute, storage, and fabric into fluid pools of resources that are easily composed and re-composed to meet each application’s needs. With HTBase, companies can quickly prov...
SYS-CON Events announced today that Systena America will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Systena Group has been in business for various software development and verification in Japan, US, ASEAN, and China by utilizing the knowledge we gained from all types of device development for various industries including smartphones (Android/iOS), wireless communication, security technology and IoT serv...
SYS-CON Events announced today that CollabNet, a global leader in enterprise software development, release automation and DevOps solutions, will be a Bronze Sponsor of SYS-CON's 20th International Cloud Expo®, taking place from June 6-8, 2017, at the Javits Center in New York City, NY. CollabNet offers a broad range of solutions with the mission of helping modern organizations deliver quality software at speed. The company’s latest innovation, the DevOps Lifecycle Manager (DLM), supports Value S...
SYS-CON Events announced today that Infranics will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Since 2000, Infranics has developed SysMaster Suite, which is required for the stable and efficient management of ICT infrastructure. The ICT management solution developed and provided by Infranics continues to add intelligence to the ICT infrastructure through the IMC (Infra Management Cycle) based on mathemat...