× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Something like this?
http://www.mssqltips.com/tip.asp?tip=1317


-----Original Message-----
From: systemidotnet-bounces@xxxxxxxxxxxx
[mailto:systemidotnet-bounces@xxxxxxxxxxxx] On Behalf Of Mike Wills
Sent: Wednesday, January 06, 2010 12:02 AM
To: .net use with the System i
Subject: Re: [SystemiDotNet] Web Service Session State

Couldn't you cache the data somehow? I know .NET does some caching when
working with MS SQL Server.

--
Mike Wills
http://mikewills.info
P: (507) 933-0880 | Skype: koldark

On Jan 5, 2010, at 3:37 PM, ibm wrote:

What I am trying to accomplish is to maintain a session for 24hours.
Here is the approach I am trying out:



Expose ASMX web service with a method called GetTicket(). The
AuthExtension SOAP extension expects a SOAP header with a username and
password. This is the only time that the credentials get sent over
the
wire. The SOAP extension matches validates the user against the DB
and
calls GenerateTicket() which returns a GUID to the client. At the
same
time the GUID is saved in the DB along with the username and a
timestamp.



[AuthExtension]

[WebMethod(Description = "get session ticket")]

[SoapHeader("UserAuthen", Direction = SoapHeaderDirection.In)]

public string GetTicket()

{

//TODO validate sessionType

return UserAuthenticator.GenerateTicket(UserAuthen.id1);

}



Once the client has the ticket it can call other methods by passing
the
ticket.



[AuthExtension]

[WebMethod(Description = "get current time")]

[SoapHeader("UserTicket", Direction = SoapHeaderDirection.In)]

public string GetTime()

{

return DateTime.Now.ToString();

}



Again, the SOAP header contains the ticket GUID and the SOAP extension
looks up the ticket GUID in the DB. Also it checks the timestamp time
differnce of 24hrs. If the ticket is over 24hrs old then the ticket
is
invalid and client must obtain a new ticket by calling GetTIcket()
with
his user/pass credentials.



I don't like this approach because the DB is hit every time a method
is
called.

Is there a better way to keep session state for 24hrs, keeping in mind
that I want the client to connect even if IIS resets itself...



chris





--
This is the .net use with the System i (SystemiDotNet) mailing list
To post a message email: SystemiDotNet@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/systemidotnet
or email: SystemiDotNet-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/systemidotnet.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.