Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bind xml with Http requset

 
krishnath poolo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
prajapati ajay
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic