简体   繁体   中英

Netsuite: Your connection has timed out

I've developed a C# script in Visual Studio to connect to NetSuite webservices. Last week my script worked fine, but today I logged with token authentication, and when I want to do some tests, an exception occurred:

An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in System.Web.Services.dll

Additional information: Your connection has timed out. Please log in again.

I've search in every forum, other people have the same problem, but I still haven't found the answer.

In my experience, the best way for authentication is to use Request Level Credentials like this:

// Create NetSuiteService instance
NetSuiteService _service = new NetSuiteService();

// Do not create CookieContainer as we don't want to keep session informatiom
// _service.CookieContainer = new System.Net.CookieContainer();

// Create Passport and assign it to _service.passport
Passport passport = new Passport();
passport.account = "ACCT12345";
passport.email = "user@domain.com";
passport.password = "password";
_service.passport = passport;

// Create an example reference to Customer ID 100
RecordRef recref = new RecordRef();
recref.type = RecordType.customer;
recref.typeSpecified = true;
recref.internalId = "100";

// Fetch Customer record
ReadResponse response_get = _service.get(recref);

Answer Id: 34545

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM