Suresh Gopi

Ranch Hand
+ Follow
since Mar 08, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Suresh Gopi

To get hands-on expericene you can use the following book..

Developing web services with apache Axis 1.4
13 years ago
Thanks for your reply first Mudit!

i'm using Weblogic 8.1
Hello Friends,

I want to close the db connection after 'n' seconds of idle time.

In my hibernate config file, I'm getting the datasource reference fom JNDI.
Is it possible to set connection timeout value?


It looks like C3P0 connection pool implementation allows use to set the connection timeout?

Can i use both? i.e App server connection pool (datasource from JNDI) and C3P0 connection ppol mechanism?


(It is web app runs on App server.)

Please provide some pointers... Thanks in Advance!..


Hello Friends,

We are planning to develop a web service provider app using Axis 1.4.

I would like to know how the client requests are handled by the Axis.

message style to be used is Document\literal.

Will Axis creates a new thread to handle the each request? (something like struts)

Please provide some info on this.



13 years ago
Hi Guys,

I'm creating a WSDL for my web service and trying to make it as generic one. I'm using document\literal style for the operation.
Input and output for the operation will be XML fragment like below..


Request xml
------------

<message action="add">
<person>.......</person>
</message>

Respone xml
---------------

<message status="1" >
<person-id>123</person-id>
</message>

Please note <message> element is envelope for the input and ouput XML document. ( At service provider end, based on action attribute's value appropriate operation will be performed)


Please suggest me what data type should be appropriate for <message> element's content ? <xsd:string> or <xsd:any/>
which has got more benefits? (Simple/flexible for processing for both client & service provider)


Element definition in WSDL
----------------------------------

<xsd:element name="message">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="xmlDocString" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="action" type="xsd:string" />
</xsd:complexType>
</xsd:element>


<xsd:element name="message">
<xsd:complexType>
<xsd:sequence>
<xsd:any/>
</xsd:sequence>
<xsd:attribute name="action" type="xsd:string" />
</xsd:complexType>
</xsd:element>

Am i making sense? If not please let me know i can provide some more details.


Tool kit used: Axis 1.4

Thanks a lot for reading my message till this point. :-)
13 years ago
Thanks a lot for your input Peer Reynders !!
13 years ago

Hello Friends,


For one of my project I'm thinking of developing Web service using RESTful architecture.

I just wanted to know about JDk 1.4 support for RESTful web service. I can see the some examples in internet but all with Annotations.


I'm yet to dig into the details, before that i would like to know your inputs.


Thanks
13 years ago
Thanks Mike. Thanks a lot for the useful Info.
13 years ago
Hello Friends,

I'm facing this problem when i test my application using Firefox with (Cookies enabled - default option)

I accessed the App using one instance (window) of firefox and it got Session tracking cookie for the opened page from Server App.

When i open my application in another window\tab the Server sends a new session-tracking cookie for this page the new one overwrites the first windows's session cookie.

If my i test my application with multiple instance of firefox simultaneously, switching between windows randomly then application crashes.

It's not happening for IE.

My question is,
Is Firefox designed to store one 'session tracking' cookie per website\domain?

Is there any solution for this.

Please suggest me.

other Info :

Cookie name - JSESSIONID
App server - Weblogic 8.1
Browser Ver - Firefox 2.x

Note: We didn't implement 'single sign on' fuctionality and our Application is a simple App without any login page.
[ December 10, 2008: Message edited by: Suresh Gopi ]
13 years ago
Actually i wanted to differentiate the very first request from subsequent requests which are not part of the existing session to the application.

The problem was i wanted to do this check in class which is a subclass of RequestProcessor.

By 'session-expired request' i meant the request sent to Server App by the browser after the current page's session timeout.

I solved it. i'm justusing request.getServletPath() to know the action path name from that i determine whether the request is for the starting page of application or other pages.

if it is for other pages the request should be associated with session, i'll retrieve the session associated with the request and check for the object that i stored initially after i created my new Session.

If it is present then i assume the request is not STALE otherwise it is expired.

Thanks for your time Tom.
[ December 08, 2008: Message edited by: Suresh Gopi ]
13 years ago
Hello friends,

Any inputs on this?

Thanks.
13 years ago
Hello Friends,

I have few doubts regarding Session management.

I'm planning to extend RequestProcessor class to know whether session is expired or not. (Instead of doing it in every action class)


I want to know how to differentiate the new request from the 'session-expired*' request

'session-expired' request : request that is made after session-timeout.

Because for both type of requests session.getSession(true) will return new Session objects.

I need to display same page for both type of requests but with a message for 'session-expired' request.



Note: My problem is NOT about differentiating new requests from subsequent requests (which is part of the existing session)
I can accomplish it by addding an object to the session intially and look for the object to know whether the request is part of exisitng session or not.


Hope my question is clear. If not, please let me know.

[ December 05, 2008: Message edited by: Suresh Gopi ]
[ December 05, 2008: Message edited by: Suresh Gopi ]
13 years ago
Thanks for you time :-) David.
13 years ago
Thanks a lot for your prompt reply David.

I am not able to imagine a scenario where isNew() call is not guaranteed.
(basically iam new to J2EE/Struts)

Is it depends on how my application is structured OR my Web Server implementation?

Assume after ****session-timeout***, i am submitting the jsp page which triggers the Action class where i've the following code in my execute().

HttpSession session = request.getSession(false);

After the above line execution.

Either session should be null (As per spec) or in case WebServer generates the new Session.

So the following (session == null || session.isNew()) should return true always right?

Please correct me if iam missing anything.
13 years ago
Thanks for the reply David.

Actually i've seen the article you linked before posting my first message.

In my application there is no login page. I can add any object to the session and check it later.Thats fine but Is there any problem with the following solution?

HttpSession session = request.getSession(false);
if (session == null || session.isNew()) {
logger.info("Session expired");
}

Isn't reliable?

Or in other words what makes solution 2 is better than solution 1?

Thanks again for your reply.
13 years ago