cancel
Showing results for 
Search instead for 
Did you mean: 

Managing session variables in BLS

Former Member
0 Kudos

Hi all,

Is there a way in BLS to:

1. modify an existing session parameter

2. create a new session parameter

3. remove a session parameter

I can do it in javascript with an applet, but would prefer all processing

that is possible on the server, stay on the server.

--Thanks,

--Amy Smith

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member4529
Active Contributor
0 Kudos

Hi,

Execute the PropertyAccessServlet service from BLS (use XML query) to manage the session variables:

/XMII/PropertyAccessServlet?mode=store&PropName=<name>&PropValue=<value>

/XMII/PropertyAccessServlet?mode=retrieve&PropName=<name>

I don't think any mode is available to delete a session variable. Though you can assign a blank value using the store mode.

Thanks,

Dipankar

Former Member
0 Kudos

Thanks Dipankar,

So I don't quite understand.

To set the session parameter within a BLS transaction do the following:

1. Create an XML Query with mode XMLQuery.

2. Then in the URL of the XML Query put

/XMII/PropertyAccessServlet?mode=store&PropName=[Param.1]&PropValue=[Param.2]

3. In my BLS transaction, create an XML Query action block that points to the XML Query

4. Set the two params in BLS and execute the XML Query action block

Is this what you meant? (I'm sure it isn't as the XML Query doesn't work!)

Could you be more specific about how to "Execute the PropertyAccessServlet service from BLS"?

What about using an HTTP Post action block?

Thanks for your help,

--Amy Smith

--Haworth

Former Member
0 Kudos

Amy,

please add "&Content-Type=text/xml" to the end of the URL and try again. Then the XML query should work.

Michael

former_member4529
Active Contributor
0 Kudos

Hi Amy,

Yes you got it correct. Add the Content-type=text/xml at the end of the URL as Michael mentioned, which I missed in my post before. Using this you can save/create or read a session variable in BLS. If you use HTTP Post action you have to provide the server name and port along with the authentication details (username, password) which I think you might not want to hardcode in BLS. Using XML query you don't have to provide any of those as it'll take those from the session itself.

Thanks,

Dipankar

Former Member
0 Kudos

Hi Dipankar,

Thanks... What am I doing wrong?

I do new XMLQuery: Mode is XMLQuery

On the XML Query Details URL:

/XMII/PropertyAccessServlet?mode=store&PropName=[Param.1]&PropValue=[Param.2]&Content-Type=text/xml

On the Parameters tab:

Param.1 value is sessVar

Param.2 value is first

I do a test from the Query editor and get ---> Error: Loaded content is empty

I tried putting values in the URL instead of the params and it gives the same result.

I tried the URL from the browser session and it works.

--Amy Smith

--Haworth

Former Member
0 Kudos

Geez --- the square brackets around the param names turned it into an URL. Got to love the forum!

so the URL has sqBracket Param.1 sqBracket and ditto for Param.2

---Amy

former_member4529
Active Contributor
0 Kudos

Hi,

Check whether the PropertAccessService and PropertAccessServiceWriter security services are assigned to your user role from Security Services -> System Security menu.

Thanks,

Dipankar

Former Member
0 Kudos

Hi, Dipankar/Amy.

This approach almost certainly will not work from within BLS. The "session" that you'd see is not the same session as the user session, which uses a cookie from the user's browser as an identifying mechanism to the web application server/servlet engine.

There's a big difference between a URL request executed from the user's browser (directly or via a Java applet/AJAX) and a URL request executed by BLS. In the latter case, the request is essentially "anonymous", and most likely, has no knowledge of the user session nor ability to pass along the relevant cookie and session identifiers.

Long answer to say that I don't think you can use BLS to manipulate session variables at present, since the servlet context is not directly accessible to BLS actions. It could be added fairly easily, though. Put in an enhancement request!

Rick

Former Member
0 Kudos

Thanks Rick, That explains alot! -- Amy