GetLoginKey()

Top  Previous  Next

Use GetLoginKey() where multiple calls to the web service need to be made without re-authenticating.  Typically, the LoginKey is stored locally in Session or ViewState.

 

Example

 

' Get an instance of the LoginWebService.

Dim ws As New WebServices.LoginWebService()

 

Dim ds As DataSet

 

' Get a loginKey from the web service.

ds = ws.GetLoginKey("demo", "smith", "abc123", _

"", "", "", "", "", "", ReturnType.Standard)

 

' Check for errors and invalid logins.

If StdLib.GetErrorNumber(ds) >= 0 Then

Response.Write(StdLib.GetErrorMessage(ds))

End If

 

' Store the LoginKey in Session (or ViewState).

Session("LoginKey") = ds.Tables("Login").Rows(0).Item("LoginKey")

 

See PopulateObjAcctSoapHeader()

 

Remarks

 

The most effecient method of authentication is using GetLoginKey() and PopulateObjAcctSoapHeader().  The LoginKey that is returned can be cached locally and set in the SOAP header using PopulateObjAcctSoapHeader() on each web service call.  The web services do not need to re-authenticate when a LoginKey is used.  Additionally, the web services can be configured to cache the LoginKey at the web service as well, further reducing the amount of processing required on each round-trip.