Simulation?

Hello everyone,

Here is my question.

I need to make a webservice that can call a url, parses the response and then sends out a form. Example say I have a button that says, for the sake of clarity, <New Gmail>. The request is sent to a servlet that:

1. Calls gmail.com

2. Fills up the username and password and sends it back

3. Open "Compose Mail"

Actually what I need is more complex than this. The URL that my servlet calls returns an xml that I need to parse. After extracting the data I need to call a form, fill out some fields with the data I got from the XML file, then redirect the user to that page.

Can anyone give me an idea on how to do this?

Thank you

Steven

[738 byte] By [javaBuffa] at [2007-10-2 14:32:46]
# 1

1) parsing XML is easy. Use SAX or JDOM. Insert those keywords into the search box at the top of this page, you'll get everything you need.

2) web forms are at the lowest levels HTTP requests. So if you want to mimic what a form does, you'll need to figure out what HTTP requests are being sent to the GMail application when you login and go to a specific page, then have your application mimic this through a socket or possibly URLConnection. For one you'll most likely need some kind of sessionId so you can keep the same session alive, or else google will give you a new session each time and you'll lose your login.

BUT!

google might not approve that you do such a thing. I would seriously think about the legal issues that might be involved.

So I would suggest contacting google (or whatever company you are trying to abuse) and see if they have some kind of web interface that allows you to do what you want.

gimbal2a at 2007-7-13 12:55:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...