Meaningless Drivel is fun!*
The moose likes Java Micro Edition and the fly likes bind xml with Http requset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "bind xml with Http requset" Watch "bind xml with Http requset" New topic
Author

bind xml with Http requset

krishnath poolo
Greenhorn

Joined: Sep 30, 2008
Posts: 4
hi all
i m newbie for j2me and kxml

i want to generate and bind an xml with http request.
for an example

<user>
<uname>xxxx</uname>
<pword>xxxx</pword>
</user>

i want to generate this xml and send this to server with request by using post method

please help me
thanks in advance
krishnath poolo
Greenhorn

Joined: Sep 30, 2008
Posts: 4
i want to send a http request msg from mobile phone to server like following

HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/xml

<user>
<uname>xxxxxx</uname>
<passowrd>xxxxx</password>
<user>

is it possible to send like this ???
please reply quickly.
its very urgent.
thanks in advance
Rashid Mayes
Ranch Hand

Joined: Jan 11, 2006
Posts: 160
Hello, If you are trying to send the message from the phone to the server you can use HTTP ((HttpConnection) Connector.open). If you servlet returns a XML response you can use kXML to parse the inputstream. In fact you can use an XmlWriter to write to the outputstream.


Rashid Mayes
http://www.hostj2me.com/ - http://www.worlddeveloper.org/
prajapati ajay
Greenhorn

Joined: Dec 16, 2008
Posts: 12
hi krishnath

first declare String buffer and this xml tag and its value in stringbuffer object

by using Post method send this to server by HttpConnection
then get response from servlet or Php script
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: bind xml with Http requset
 
Similar Threads
Unable to connect Oracle Database
Parsing xml
Velocity template - populating with form values
SQL injection?
Velocity template - populating with form values