• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Return XML/HTTP frm a servlet

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want to design a servlet which will will be invoked from an application residing in a different web server and the second application will get back an XML blob as a return.
The whole connection will be based on HTTP ofcourse(no SOAP etc).
Any suggestions on how to achieve this?

Thanks in advance,
Sunetra.
 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems like you have answered your own question almost.

1. Servlet gets invoked with request
2. Build relevant XML
3. Get response output stream
4. Write content type
5. Dump XML
6. Profit!

Do you have a more specific question?

I'd recommend reading this servlet tutorial.

This code might be a very simple example of what you want. It doen't do any error checking and I make no guarantees to it's correctness!

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic