Win a copy of Head First Android this week in the Android forum!

Nate Leech

Ranch Hand
+ Follow
since Feb 07, 2005
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 Nate Leech

Hi all,
I am creating a web service client in Java that hits a WSDL with a very long list of methods. I have an idea with what I can do to implement it, but it seems there should be a cleaner more Object Oriented way of doing it.

I used WSDL2Java in Axis to get the serviceStub and serviceLocator and here is an example of what I am currently doing in the client.



The other methods would be implemented in much the same way. Although this might work, I was hoping there would be a more dynamic way to implement this to avoid a bunch of methods with the same names and ALMOST the same parameter list that just return the webservice methods.

Can anyone help me with this? I'm trying to become a bit more "elegant" in my coding and figured this would be the best place to ask!

Thanks, and please let me know if I need to elaborate.

-Nate
14 years ago
Hello all,

I use WSAD on my local machine for development and after small unit testing by myself, I upload the EAR file of the application to a file on a QA server and the Websphere Administrators deploy the app to the Websphere Application Server which is clustered.

The app I am currently working on uses a vendor's webservice wrapped in a java API. The application works fine on my local workstation. After a lot of testing and log checking on the QA server, we have determined that the application works fine if the user is load balanced to node 2, but it will fail on a webservice call if the user is load balanced to node 1.

Has anyone seen anything like this or know what might be going on?

Thanks in advance,

Nate
15 years ago
Got it working, thanks for the help, everyone!!!

-Nate
Yuyiy,

Thanks for the advice. I'll give your suggestions a try to see if I can get this to work.

Thanks!

-Nate
Not quite yet, only because I can't figure out how to get my validate method to return a value easily.

I'm actually using the Ajax methods from Eric's book for validation. Here is basically what I'm doing for the validation part:

On the .jsp I have a dynamic form that lets the user add text fields so they can add users to their object. (Similar to how gmail adds attachments) So these fields can vary in number. So I have a servlet that takes a username and verifies their certification and verifies if they even exist at our institution. If anyone in the list fails this validation, I display an error message on the page and let the user know which users don't exist and which users still require certification in order to be added to the object they wish to create.

So the validation is like this:



So from Eric's book, what the net.ContentLoader is doing is passing the url in and running the servlet to get the xml back. Then the "certify" method is called. My certify method pretty much just prints out an error message to the page.
What I'd like to do is have the certify method return a boolean value as well to tell whether or not validation passed, that way I can use the local bSubmit variable that was suggested. But because the "certify" method is called from within the "ajaxValidateUser" from the net.ContentLoader constructor as a parameter instead of just calling it directly, I'm not sure how to cascade the return value up from the "certify" method to the "ajaxValidateUser" method to the "validate" method.

This is why I was originaly using the global variable "submit". I would just set it to false if validation failed within "certify".

I hope this makes sense. Any more help would be great. Lemme know if i should clarify anything. Thanks again for the help so far.

-Nate
[ May 31, 2006: Message edited by: Nate Leech ]
Thanks for the help!

Out of curiosity, do you know what exactly the problem was with the way I was doing it?
Was it something specific with Javascript that made the validation work with an alert between the for and the if but not work without it?
Hi all. I am using a button that calls a method to validate. If all validations pass, then I call the form.submit() to send the information to the server.

so for example, the button calls validate which is something like this:



For some reason, the variable submit doesn't seem to change. It's default value is "true", and if anything is validated as false, then the submit variable is "supposed" to change from true to false in the for loop. It does not however, and still submits even when it should not.

Here's the weird part. If I put an "alert" in between the for loop and the if statement, it works fine!!! It's almost as if the alert gives the javascript time to actually change the variable value before it gets to the if statement. I'm really new to javascript and very frustrated right now. Any help would be greatly appreciated.

Thanks!

-Nate

[ May 30, 2006: Message edited by: Nate Leech ]
[ May 30, 2006: Message edited by: Bear Bibeault ]
David,
Yes we are using LPTA. So there really isn't a solution to this then? Besides bugging the server admins to make the timeout longer?

Will setting the session timeout to be less than the LPTA timeout help at all?

Thanks!

-Nate
[ August 22, 2005: Message edited by: Nate Leech ]
16 years ago
Nope, not yet. Thanks for the link. I'll check that out!
16 years ago
I don't think so. The app is running on a Production server that only gets the reboot on Wednesday nights. The reports on having to log back in occurred during the day. We also confirmed with the application server admins that no server reboot occurred at the time of the reports.
16 years ago
Okay, i've been googling around and think i have narrowed it down.

Our server has an Authentication mechanism that has Timeout set at 120 minutes. My new question is this:

Does the timeout in this field start over when a user sends a request to the server? Or does the timeout start when the user logs in, and ticks down no matter how much activity is going on?

Thanks!

-Nate
16 years ago
Hello all,

I have an application running on a websphere server and sometimes users have reporting being in the middle of working on something in the app and then being brought back to the login page. I know this has nothing to do with the session, because the session won't timeout while requests are being made. Is something set in Websphere that will time you out of your application even if you are actively using an app?

Thanks!

-Nate
16 years ago
Haven't worked with webservices directly at all unfortunately.
I'm calling the webservice from an API supplied from the vendor.
It is an HTTPS connection. I pass in the webservice URL and the login and password from whoever logs into the application and then it gives me back a "Session Virtual Object".
From the object I call methods which supply user credentials, user assets etc...
When I am done with the service, I call a logout method and it will disconnect the user from the session.

Sorry for any confusion

-Nate
16 years ago
Indeed...

I know where that website is, in fact I did visit it, just didn't care to look at it too hard until I have an answer to question #1. Perhaps you have a website for that question as well?

Thanks for any help!

-Nate
16 years ago
2 questions:

I'm writing a web application and am making a webservice call for authentication to another application that my web app is integrating with.

Here are my options:
1) I store the webservice connection in the session. That way, I can call methods on the connection to get user assets all through the application lifecycle.
2) I get the assets I need from the original webservice connection and then close the webservice connection. However I need to store the assets in the session. (The assets aren't that big, it will be no more than 10 java beans with only 2 instance variables each) The application is designed to be a 3 step process, it should only take a user about 1 minute to use, once they have completed the steps, the session will automatically be invalidated. If for some reason they decide to open the application where the session is created adnt ehy dont complete the process, I'm only going to have the session stay alive for 5 minutes.

So now my questions:

Which of these is desirable?

If number 1 is desirable, how do I call the webservice disconnection method when the session invalidates? I think it may have something to do with Listeners, but I haven't dug that deep into Google yet

Thanks for any help!

-Nate
16 years ago