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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Web</strong> <strong>Services</strong> SecurityAuthentication78• When sending user credentials in the SOAP header for an integrated application thathas an application ID assigned, users must submit the application ID with everyrequest. Users will also be responsible for handling SOAP faults related to exceededrequest limits, since they are presumably not synchronizing access to the session.• As with any request (sent after login is invoked or sent with user credentials in theSOAP header), only one <strong>Web</strong> services request may be in flight at a time. Any attemptto violate this will result in a SOAP fault.Important: Users who choose to authenticate to <strong>NetSuite</strong> using the login operation donot need to provide their credentials in the SOAP header, and can continueto manage their sessions as they have in the past. For information onauthentication through login, see Authentication Using the Login Operation.The following samples show users credentials as they appear in the SOAP header of a request.Also provided is the Java that generated the SOAP.SOAP Requestjdoe@netsuite.commypassword000034Javaprivate void setRequestLevelCredentials(<strong>NetSuite</strong>PortType aPort, String sEmail, String sPassword,String sAccount, int iRole) throws SOAPException{<strong>NetSuite</strong>BindingStub stub = (<strong>NetSuite</strong>BindingStub)aPort;stub.clearHeaders();org.apache.axis.message.SOAPHeaderElement passportHeader = neworg.apache.axis.message.SOAPHeaderElement("urn:messages_2008_2.platform.webservices.netsuite.com","passport");}// use the Passport object to create credentials and add to soap headerRecordRef role = new RecordRef();role.setInternalId(String.valueOf(iRole));Passport passport = new Passport();passport.setEmail(sEmail);passport.setPassword(sPassword);passport.setAccount(sAccount);passport.setRole( role);passportHeader.setObjectValue(passport);// set header on stub, and disable session managementstub.setHeader(passportHeader);stub.setMaintainSession(false);<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!