Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Problem with Maintaining Session
I was successfully logging in, adding records, deleting records, searching etc. Everything was working fine. Now all of a sudden things are broken. I now get an error when I try to do anything after logging in (the login itself is fine). I created a simple Java class that just logs in and logs out - just to make it easier to play with this problem. The log out says that I'm not logged in. I was getting the same behavior trying to add a record after logging in. Any ideas?
package com.wjbradley.webservices.netsuite; import java.rmi.RemoteException; import com.netsuite.webservices.platform.core_2008_1.Passport; import com.netsuite.webservices.platform.core_2008_1.RecordRef; import com.netsuite.webservices.platform.faults_2008_1.InsufficientPermissionFault; import com.netsuite.webservices.platform.faults_2008_1.InvalidAccountFault; import com.netsuite.webservices.platform.faults_2008_1.InvalidCredentialsFault; import com.netsuite.webservices.platform.faults_2008_1.InvalidSessionFault; import com.netsuite.webservices.platform.faults_2008_1.InvalidVersionFault; import com.netsuite.webservices.platform.faults_2008_1.UnexpectedErrorFault; import com.netsuite.webservices.platform.messages_2008_1.SessionResponse; import com.netsuite.webservices.platform_2008_1.NetSuitePortType; import com.netsuite.webservices.platform_2008_1.NetSuiteServiceLocator; public class LoginLogout { private static NetSuiteServiceLocator service = new NetSuiteServiceLocator(); private static NetSuitePortType port; public static void main(String[] args) { System.out.println("main"); LoginLogout util = new LoginLogout(); util.login(); util.logout(); } public void login() { service.setMaintainSession(true); Passport passport = new Passport(); passport.setEmail("xxxxxx"); passport.setPassword("xxxxxx"); passport.setAccount("xxxxxx"); RecordRef role = new RecordRef(); role.setExternalId("x"); passport.setRole(role); SessionResponse response; try { port = service.getNetSuitePort(); response = port.login(passport); if (!response.getStatus().isIsSuccess()) { throw new Exception("error"); } } catch (InvalidAccountFault e) { // TODO 0