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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
Invalid Session Fault with Token Based Authentication
Should I be receiving an Invalid Session Fault with a message that says "Your connection has time out. Please log in again." when using token based authentication. My webservices were running fine until suddenly the Invalid Session Fault was thrown even though 2 seconds earlier a webservice call was successful.
My only thought is we are calling this immediately before we set the token in the header. Could it be causing a problem?
// setup the headers to ignore read only fields NetSuiteBindingStub stub = (NetSuiteBindingStub) port; stub.clearHeaders(); SOAPHeaderElement prefHeader = new SOAPHeaderElement("urn:messages.platform.webservices.netsuite.com", "Preferences"); Preferences prefs = new Preferences(); prefs.setIgnoreReadOnlyFields(new Boolean(true)); prefHeader.setObjectValue(prefs); stub.setHeader(prefHeader); 0