Marty Zigman

Conversations with Marty Zigman

Certified Administrator • ERP • SuiteCloud

How to Connect NetSuite Web Services with Java

NetSuite Technical

Tags: , , , , , , , , , , , , , ,

cloud computing
In contrast to other Cloud based ERP systems, NetSuite is a platform for the creation and integration of other applications.  One mainstream programming tool used in business based software development is Java.  And this means we are interested in how to use Java to connect to NetSuite’s Web Services tier.  Java continues to be popular – it is open source, mature, and it has a large development community.  Java exists as a contrast to Microsoft’s .NET development platform.

The way to connect Java to NetSuite is through SuiteTalk, which is in essence the way NetSuite has exposed its system via web services. Web Services is a standard way that modern platforms expose functionality to users in a secure manner to connect up and process logic.  NetSuite is acting as the server, and anything that manipulates it, is the client.  As you may probably already know, Java traditionally exposes itself as a server, and other applications consume Java.  Here, however, we’re going to make Java a client technology that connects with NetSuite services.

Under some assumptions to help illustrate how to connect, we will reference some of the most popular tools for this process. Many others exist.   First download and use the Java implementation on Tomcat, which works with the Apache web server on a Linux system (we like to use Ubuntu).  Next, you will need to install Axis, which is basically a tool that allows for both the creation of server based and  client side web service applications. From there, we will use Axis to connect with NetSuite through their WDSL, which is a URL pointer to a description of how NetSuite exposes all its web services.

With Axis now configured inside Tomcat, when we consume the NetSuite WSDL, it will create the proxy objects, which will be available to the Java environment so that our Java developer can program NetSuite. NetSuite will appear to the Java developer as a set of Java classes that are manipulated like any other object.  Most developers will use Eclipse for their open source integrated software development (IDE) environment.

This will essentially get you hooked up, but there’s now an important step in the process: “how do I manipulate NetSuite effectively?”.  This requires a good understanding of NetSuite’s Web Services library.  Although everyone appreciates more code examples, the documentation is pretty good.  We have developed a number of NetSuite web service applications and the environment works well.

Copyright © Marty Zigman 2011

Marty Zigman LinkedIn

Marty Zigman

Holding three official certifications, Marty is widely recognized as a top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. A former Deloitte & Touche CPA and technology executive with CTO roles, he brings over 35 years of leadership in ERP, CRM, and eCommerce business systems. Contact Marty to engage directly.

BiographyYouTubeLinkedInX (Twitter)

25 thoughts on “How to Connect NetSuite Web Services with Java

  1. […] PHP Toolkit: This API has been perpetually beta.  It is the default connection option but there are some limitations. I have tried to use the toolkit in the past, but not without some challenges.   Those is the PHP Drupal community may find creative new ways to use it.  This method is effectively leveraging NetSuite’s SuiteTalk which I have previously written about. […]

    Reply
  2. this is a weird approach. do you mean i would have to set up a server, separate to NS? i work with a client who uses the documents->file cabinet for their ns relaed websie. is my customers approach all wrong? why are you doing java? i see the difference would be using ready made web services versus writing your own(and plugging the results directly to a web page). BUT since NS is so customizable, how would the ready made web services do what i need to accomplish?

    Reply
  3. Hi
    Sir i am fresher in java and recently joined a company deals in Netsuite so i don’t know about
    NS and how to make connectors or services
    Please refer me a link or guide on which i can learn about it and start my career

    Reply
  4. Hello Sir,

    Greetings!

    I am new in netsuite.Till the date i’am familier with suitelet,user event script,client script.Now i want to use webservices can you help me for the same.

    Thanks in advance.

    Reply
  5. Hello Mr. Zigman, i hope ur’ fine. I’m making an application based on Java and Spring framework and i need to communicate via web service with my netsuite account. Is Apache Axis the only way for do that?
    Please, if you can send me all the posible documentation (and examples) for do my job to best way possible, i’ll be very very grateful.
    i’ll be waiting for your answer, thanks in advance.
    Saludos desde Peru!!!

    Reply
  6. Ok Mr. Zigman, thanks for your response. Maybe my question is not all clear. On NetSuite page (https://www.netsuite.com/portal/developers/resources/suitetalk-sample-applications.shtml) is an example to connect WS with Axis, but this doesn’t work. The WSDL (https://webservices.netsuite.com/wsdl/v2014_2_0/netsuite.wsdl) show me this error when i want to implemment the Java Client: IWAB0399E Error in generating Java from WSDL: java.io.IOException: WSDL2Java emitter timed out (this often means the WSDL at the specified URL is inaccessible)!. Is for that reason that i need a functional example for develop it.
    Thanks in advance, regards.

    Reply
  7. Marty:

    Thanks for this article; I am an independent software developer with a client who wishes integrate their custom Java application with Netsuite.

    I am dismayed to find that apparently Netsuite does not provide a native RESTful api but instead is relying on an out-dated SOAP interface. As I started to read thru the documentation, I am very unhappy to see the Axis1 dependency (last release almost 10 years ago!); this tells me that Netsuite is ‘under investing’ in integration components/tooling for software developers.

    As you seem to be plugged into the Netsuite / Java integration space, perhaps you could help me (and your other readers) understand how best to integrate existing Java applications with Netsuite without building dependencies on a SOAP/Axis api that is clearly out-dated and most certainly be slated for retirement.

    Many thanks

    Reply
  8. Hi sir,

    From Last year when i started with netsuite i am following this. and you are giving hope for the unknown things,

    Here i am using User Event after submit of the Item fulfillment, By using nlapiRequestURL i am sending internalid with url and Json object of the field values of fulfillment to the external site which is taking response, they are getting the id but json object not getting why?
    nlapiRequestURL(JL_ServiceURL,JsonVar,Header,HttpMethod);

    Reply
  9. Hi sir, Really Thankful you for replying,
    here i am sending request as follows to external (out side to netsuite) using asfollows,

    var SO = [{“createdDateSpecified”:false,
    “customForm”:CustomForm,”entity”:Entity,”job”:””, “currency”:Currency,”drAccount”:””,”fxAccount”:””]}

    var JsonVar = JSON.stringify(SO);

    var Header = [];
    Header[‘User-Agent-x’]=”SuiteScript-Call”;
    Header[‘Content-Type’]=”application/json”;

    var HttpMethod = new Array();
    HttpMethod[‘httpMethod’] = “POST”;

    nlapiRequestURL(JL_ServiceURL,JsonVar,Header,HttpMethod);

    Reply
  10. Hi sir,

    I am using User Event then callback parameter will not be there, and what i am doing here is…. Sending the JSON data through the nlapiRequestURL API to out side url(ex: http://www.google.com) which is ready to take request and give response with User Event…is it right?

    Thanks

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *