The service enables you to perform a one time login for a quicker response time.
The operation returns a unique token to be used instead of the normal authentication
header for the rest of your session.
After login, you can send the token in a different header called sessionIdentifier, and not send the normal securityHeader.
Parameters:
-
The operation expects no parameters other than the usual authentication header.
Java Code:
//get a reference to the service InwiseWebServices ws = new InwiseWebServices();
InwiseWebServicesSoap inwiseWebServicesSoap = ws.getInwiseWebServicesSoap();
//fill the security header
HeaderHandler hh = new HeaderHandler("myusername", "myPassword");
hh.setHeader(inwiseWebServicesSoap);
Now we can call the "Login" operation for getting the session token.
For setting the new header, please check the code for creating the usual header
here with the following changed:
-
Change the header name from "SecHeader" to "AuthIdentifier"
-
Do not set SOAPElement "username" and SOAPElement "pass"
-
Set a SOAPElement named "identifier" with the value of the token you recieved from the service.
C# Code:
InwiseWebServices.InwiseWebServices ws = new InwiseWebServices.InwiseWebServices();
//fill the security header
InwiseWebServices.SecHeader header = new InwiseWebServices.SecHeader();
header.username = "username";
header.pass = "myPassword";
ws.SecHeaderValue = header;//set credentials
string sessionToken = ws.Login();
//now I can use the new header
ws.SecHeaderValue = null;//clear the old header if you want
//create the new header
InwiseWebServices.AuthIdentifier sessionHeader = new InwiseWebServices.AuthIdentifier();
//set it's value
sessionHeader.identifier = sessionToken;
//set the service with the new header
ws.AuthIdentifierValue = sessionHeader;
//now I can continue the normal activity
VB Code:
Dim ws As New InwiseWebServices.InwiseWebServices()
'fill the security header
Dim header As New InwiseWebServices.SecHeader()
header.username = "username"
header.pass = "myPassword"
'set credentials
ws.SecHeaderValue = header
Dim sessionToken As String = ws.Login()
'now I can use the new header
ws.SecHeaderValue = Nothing 'clear the old header if you want
'create the new header
Dim sessionHeader As New InwiseWebServices.AuthIdentifier()
'set it's value
sessionHeader.identifier = sessionToken
'set the service with the new header
ws.AuthIdentifierValue = sessionHeader
'now I can continue the normal activity