J2ME : Communication between a client and a J2EE application server

I am working on a wireless application extension to an existing J2EE application.

I am to come up with a"mobile" edition of a use case.
The target device is a IPAQ running SuperWABA JVM.

It has been decided that XML will be the main form of data transfer between the client and the J2EE application.

The floor plan for communication will be as follows :
1) J2ME client makes httpconnection to a Servlet (new) running alongside the exisitng application
2) Servlet calls pre - existing codes to get/process data
3) Servlet generates xml using the reponse.printwriter()
4) Servlet returns.
5) Client receives XML and parses it using a modified version of nano XML.
6) Client process and intakes User input
7) Client writes User input into XML and transfer to Server
8) Server reads XML and processes the input XML
9) Server returns

My question is : how to accomplish (7)?
I know how to write XML to a local file.. but how do i transfer it over (so that its accessable to the servlet) ?

Thanks
ErctheandaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ErctheandaAuthor Commented:
A contingency that i have is to replace Client to Server communication using Strings passed in as request parameters.

why XML was chosen was because the client can return a indefinate number of values.

An analogy:

Server sends client a list of questions from the database (un determined number)
client chooses the answers and sends it back

the server must know which answer is for which question.

If a XML is not possible, i will stick to the below implementation

http://myserver.com/servlet?question1=answer1&question2=answer2


Please do advise.
Mikal613Commented:
ErctheandaAuthor Commented:
Web Services are not considered due to system constraints.

Any other alternatives?
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

ErctheandaAuthor Commented:
No offence,

But i think i have been misunderstood. I have not been clear enough, sorry.

I am having a problem transferring the xml file from client to the server in an efficient way.

Currently, I have no problems writing the XML nor parsing the XML.

My only issue is how to do it cleanly.

The transfer mechanism should be encapsulated and be transparent to anyone who plans to use my library. I have chosen to use nanoXml as my parser but the issue is how to do it "industrial" strength with no worries about performance or memory issues (some data can be quite long).
Mikal613Commented:
do you have wifi?usb ?  whats your communication with the server?
ErctheandaAuthor Commented:
The legacy app runs on a J2EE server.

The medium is the internet. through Wi FI.

I feel like i am having a conversation. Thanks.
OBCTCommented:
Have you looked at kxml?

http://kxml.objectweb.org/index.html
bhprCommented:
same as transfering text file ..
just set the content-type: text/xml


read abt HTTP-POST and HTTP-GET method
You will know how to send/receive.

-bhpr
bhprCommented:
for e.g. sending in response of a req ..

HTTP 200 OK
Content-type: text/xml

<?xml ..>
...
...

ErctheandaAuthor Commented:
Thanks to all for the replies.

I have found the solution to my problems

From the client side, XML will not be used.

Instead i have wrapped up the httpconnection to append in parameters.

that way, it will appear as if there is a form passing in parameters.

This way, the applicatino will not incur additional overhead.
Computer101Commented:
PAQed with points refunded (125)

Computer101
EE Admin

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Wireless Networking

From novice to tech pro — start learning today.