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
Fifty billion connected devices and still no winning protocols standards. HTTP, WebSockets, MQTT, and CoAP seem to be leading in the IoT protocol race at the moment but many more protocols are getting introduced on a regular basis. Each protocol has its pros and cons depending on the nature of the communications. Does there really need to be only one protocol to rule them all? Of course not. In his session at @ThingsExpo, Chris Matthieu, co-founder and CTO of Octoblu, walk you through how Oct...
As ridesharing competitors and enhanced services increase, notable changes are occurring in the transportation model. Despite the cost-effective means and flexibility of ridesharing, both drivers and users will need to be aware of the connected environment and how it will impact the ridesharing experience. In his session at @ThingsExpo, Timothy Evavold, Executive Director Automotive at Covisint, will discuss key challenges and solutions to powering a ride sharing and/or multimodal model in the a...
SYS-CON Events announced today that Tintri Inc., a leading producer of VM-aware storage (VAS) for virtualization and cloud environments, will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Tintri VM-aware storage is the simplest for virtualized applications and cloud. Organizations including GE, Toyota, United Healthcare, NASA and 6 of the Fortune 15 have said “No to LUNs.” With Tintri they mana...
More and more companies are looking to microservices as an architectural pattern for breaking apart applications into more manageable pieces so that agile teams can deliver new features quicker and more effectively. What this pattern has done more than anything to date is spark organizational transformations, setting the foundation for future application development. In practice, however, there are a number of considerations to make that go beyond simply “build, ship, and run,” which changes ho...
"My role is working with customers, helping them go through this digital transformation. I spend a lot of time talking to banks, big industries, manufacturers working through how they are integrating and transforming their IT platforms and moving them forward," explained William Morrish, General Manager Product Sales at Interoute, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Kubernetes is a new and revolutionary open-sourced system for managing containers across multiple hosts in a cluster. Ansible is a simple IT automation tool for just about any requirement for reproducible environments. In his session at @DevOpsSummit at 18th Cloud Expo, Patrick Galbraith, a principal engineer at HPE, discussed how to build a fully functional Kubernetes cluster on a number of virtual machines or bare-metal hosts. Also included will be a brief demonstration of running a Galera M...
According to Forrester Research, every business will become either a digital predator or digital prey by 2020. To avoid demise, organizations must rapidly create new sources of value in their end-to-end customer experiences. True digital predators also must break down information and process silos and extend digital transformation initiatives to empower employees with the digital resources needed to win, serve, and retain customers.
If you’re responsible for an application that depends on the data or functionality of various IoT endpoints – either sensors or devices – your brand reputation depends on the security, reliability, and compliance of its many integrated parts. If your application fails to deliver the expected business results, your customers and partners won't care if that failure stems from the code you developed or from a component that you integrated. What can you do to ensure that the endpoints work as expect...
In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lea...
IoT is fundamentally transforming the auto industry, turning the vehicle into a hub for connected services, including safety, infotainment and usage-based insurance. Auto manufacturers – and businesses across all verticals – have built an entire ecosystem around the Connected Car, creating new customer touch points and revenue streams. In his session at @ThingsExpo, Macario Namie, Head of IoT Strategy at Cisco Jasper, will share real-world examples of how IoT transforms the car from a static p...
Cloud computing is being adopted in one form or another by 94% of enterprises today. Tens of billions of new devices are being connected to The Internet of Things. And Big Data is driving this bus. An exponential increase is expected in the amount of information being processed, managed, analyzed, and acted upon by enterprise IT. This amazing is not part of some distant future - it is happening today. One report shows a 650% increase in enterprise data by 2020. Other estimates are even higher....
From wearable activity trackers to fantasy e-sports, data and technology are transforming the way athletes train for the game and fans engage with their teams. In his session at @ThingsExpo, will present key data findings from leading sports organizations San Francisco 49ers, Orlando Magic NBA team. By utilizing data analytics these sports orgs have recognized new revenue streams, doubled its fan base and streamlined costs at its stadiums. John Paul is the CEO and Founder of VenueNext. Prior ...
One of biggest questions about Big Data is “How do we harness all that information for business use quickly and effectively?” Geographic Information Systems (GIS) or spatial technology is about more than making maps, but adding critical context and meaning to data of all types, coming from all different channels – even sensors. In his session at @ThingsExpo, William (Bill) Meehan, director of utility solutions for Esri, will take a closer look at the current state of spatial technology and ar...
The Internet of Things can drive efficiency for airlines and airports. In their session at @ThingsExpo, Shyam Varan Nath, Principal Architect with GE, and Sudip Majumder, senior director of development at Oracle, will discuss the technical details of the connected airline baggage and related social media solutions. These IoT applications will enhance travelers' journey experience and drive efficiency for the airlines and the airports. The session will include a working demo and a technical d...
What happens when the different parts of a vehicle become smarter than the vehicle itself? As we move toward the era of smart everything, hundreds of entities in a vehicle that communicate with each other, the vehicle and external systems create a need for identity orchestration so that all entities work as a conglomerate. Much like an orchestra without a conductor, without the ability to secure, control, and connect the link between a vehicle’s head unit, devices, and systems and to manage the ...