This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes XML and Related Technologies and the fly likes XML - Java Communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML - Java Communication" Watch "XML - Java Communication" New topic
Author

XML - Java Communication

ramdas pradeep kumar
Ranch Hand

Joined: Aug 27, 2003
Posts: 36
Friends,
How to send XML message from a JAVA application and get response in XML format from a webpage?
Thanks for reading this.
[ August 28, 2003: Message edited by: ramdas pradeep kumar ]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
On the client side:
1) Open an HTTP connection to the web server's IP address
2) Write an HTTP request message having the XML document as body into the connection's output stream
3) Read the HTTP response message from the connection's input stream
There are some libraries for simplifying this to some degree...
On the server side:
Write a HttpServlet and implement its doPost(...) method in such a way that it parses the body as an XML document, performs necessary computation, and writes a response XML message into the response's body.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: XML - Java Communication