10.07.2015 Views

SuiteTalk (Web Services) Platform Guide - NetSuite

SuiteTalk (Web Services) Platform Guide - NetSuite

SuiteTalk (Web Services) Platform Guide - NetSuite

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Web</strong> <strong>Services</strong> Operationslogin196falseIntranet ManagerfalsefalseSystem AdministratorfalsefalseC#private void login( bool isAuto ){if ( !_isAuthenticated ){// Check whether this is a forced login as part of another operationif ( isAuto )_out.writeLn( "\nYou need to first login before invoking this operation ..." );// Enable client cookie management. This is required._service.CookieContainer = new CookieContainer();// Populate Passport object with all login informationPassport passport = new Passport();RecordRef role = new RecordRef();// Determine whether to get login information from config// file or prompt for itif ( "true".Equals( _dataCollection["promptForLogin"] ) ){_out.writeLn( "\nPlease enter your login information: " );_out.write( "E-mail: " );passport.email = _out.readLn();_out.write( "Password: " );passport.password = _out.readLn();_out.write( "Role nsKey (press enter for default administrator role): " );role.internalId = _out.readLn();passport.role =role;_out.write( "Account: " );passport.account = _out.readLn();}else{passport.email = _dataCollection["login.email"];passport.password = _dataCollection["login.password"];<strong>SuiteTalk</strong> <strong>Platform</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!