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();

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);
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!


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
In addition to all the benefits, IoT is also bringing new kind of customer experience challenges - cars that unlock themselves, thermostats turning houses into saunas and baby video monitors broadcasting over the internet. This list can only increase because while IoT services should be intuitive and simple to use, the delivery ecosystem is a myriad of potential problems as IoT explodes complexity. So finding a performance issue is like finding the proverbial needle in the haystack.
Machine Learning helps make complex systems more efficient. By applying advanced Machine Learning techniques such as Cognitive Fingerprinting, wind project operators can utilize these tools to learn from collected data, detect regular patterns, and optimize their own operations. In his session at 18th Cloud Expo, Stuart Gillen, Director of Business Development at SparkCognition, discussed how research has demonstrated the value of Machine Learning in delivering next generation analytics to imp...
"We host and fully manage cloud data services, whether we store, the data, move the data, or run analytics on the data," stated Kamal Shannak, Senior Development Manager, Cloud Data Services, IBM, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Large scale deployments present unique planning challenges, system commissioning hurdles between IT and OT and demand careful system hand-off orchestration. In his session at @ThingsExpo, Jeff Smith, Senior Director and a founding member of Incenergy, will discuss some of the key tactics to ensure delivery success based on his experience of the last two years deploying Industrial IoT systems across four continents.
With the proliferation of both SQL and NoSQL databases, organizations can now target specific fit-for-purpose database tools for their different application needs regarding scalability, ease of use, ACID support, etc. Platform as a Service offerings make this even easier now, enabling developers to roll out their own database infrastructure in minutes with minimal management overhead. However, this same amount of flexibility also comes with the challenges of picking the right tool, on the right ...
With over 720 million Internet users and 40–50% CAGR, the Chinese Cloud Computing market has been booming. When talking about cloud computing, what are the Chinese users of cloud thinking about? What is the most powerful force that can push them to make the buying decision? How to tap into them? In his session at 18th Cloud Expo, Yu Hao, CEO and co-founder of SpeedyCloud, answered these questions and discussed the results of SpeedyCloud’s survey.
Organizations planning enterprise data center consolidation and modernization projects are faced with a challenging, costly reality. Requirements to deploy modern, cloud-native applications simultaneously with traditional client/server applications are almost impossible to achieve with hardware-centric enterprise infrastructure. Compute and network infrastructure are fast moving down a software-defined path, but storage has been a laggard. Until now.
"This week we're really focusing on scalability, asset preservation and how do you back up to the cloud and in the cloud with object storage, which is really a new way of attacking dealing with your file, your blocked data, where you put it and how you access it," stated Jeff Greenwald, Senior Director of Market Development at HGST, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
DevOps at Cloud Expo – being held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real results. Am...
The Internet of Things will challenge the status quo of how IT and development organizations operate. Or will it? Certainly the fog layer of IoT requires special insights about data ontology, security and transactional integrity. But the developmental challenges are the same: People, Process and Platform. In his session at @ThingsExpo, Craig Sproule, CEO of Metavine, demonstrated how to move beyond today's coding paradigm and shared the must-have mindsets for removing complexity from the develo...
The 19th International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Digital Transformation, Microservices and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportuni...
“We're a global managed hosting provider. Our core customer set is a U.S.-based customer that is looking to go global,” explained Adam Rogers, Managing Director at ANEXIA, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Predictive analytics tools monitor, report, and troubleshoot in order to make proactive decisions about the health, performance, and utilization of storage. Most enterprises combine cloud and on-premise storage, resulting in blended environments of physical, virtual, cloud, and other platforms, which justifies more sophisticated storage analytics. In his session at 18th Cloud Expo, Peter McCallum, Vice President of Datacenter Solutions at FalconStor, discussed using predictive analytics to mon...
Basho Technologies has announced the latest release of Basho Riak TS, version 1.3. Riak TS is an enterprise-grade NoSQL database optimized for Internet of Things (IoT). The open source version enables developers to download the software for free and use it in production as well as make contributions to the code and develop applications around Riak TS. Enhancements to Riak TS make it quick, easy and cost-effective to spin up an instance to test new ideas and build IoT applications. In addition to...
IoT is rapidly changing the way enterprises are using data to improve business decision-making. In order to derive business value, organizations must unlock insights from the data gathered and then act on these. In their session at @ThingsExpo, Eric Hoffman, Vice President at EastBanc Technologies, and Peter Shashkin, Head of Development Department at EastBanc Technologies, discussed how one organization leveraged IoT, cloud technology and data analysis to improve customer experiences and effi...