Authentication/Login to Netsuite sandbox account through java code using Netsuite WSDL
In order to login to your sandbox Netsuite sandbox account via code, you need to have below files handy:
1. Netsuite sandbox WSDL:
The latest version of wsdl can be downloaded from Netsuite site’s developers’ portal where complete technical documentation about Suite Talk Wsdl is available. Or you may directly access it using below link:
URL of WSDL for the non-sandbox account:
URL of WSDL for sandbox account:
To use this wsdl, we need to generate web service client first which can be done in any Java based IDE using some simple steps.
2. Netsuite API:
After generating Netsuite client files, you would require an API which would use this generated code for accessing Netsuite data. Netsuite API can be downloaded using below link where sample CRM applications are available in Java and C#. These applications are command-line driven that illustrate how to use some of the key features of the netsuite platform.
The Java version of NetSuite API contains three most commonly used files, which are:
NSClient.java file contains various methods using which you may access Netsuite customers’ records based on your requirement or criteria. While running the NSClient file as java application, first of all you will be asked to enter your credentials of Netsuite sandbox account in the console. These credentials can be saved in nsclient.properties file and the data will be picked up from the file automatically each time you run the application. Make sure you keep this property file in the root directory of your project else it would throw FileNotFound exception.
After successful login, you may call any method as per the requirement using the index of that method in a console.