wood burning stoves 2.0
The moose likes Other Open Source Projects and the fly likes Send HTTP Response with XML schema?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Send HTTP Response with XML schema?? " Watch "Send HTTP Response with XML schema?? " New topic

Send HTTP Response with XML schema??

Mimi Tam
Ranch Hand

Joined: Mar 05, 2010
Posts: 121

I ran the Petclinic sample project successfully but I am not sure if it has what I was looking for as a sample.

In Petclinic, MVC is in force. The RequestMapping actions map to model and rendered by Views (*.jsp). What I need to do is to 'intercept' the HTTP Request before or after rendering to View to compose a HTTP Response message with a XML scheme of the model and send it to a mobile client.

My mobile client accepts HTTP message with a XML schema of the returned data from my model and display it via an iPhone App.

How can I and where shall I compose this message and send it to my requesting mobile client?

Any help would be greatly appreciated. Any sample code or references that I should read will greatly help as well.

Many Thanks in advance.
David Newton

Joined: Sep 29, 2008
Posts: 12617

Intercept it where? Why not just expose the functionality as a service and return a domain model serialized to XML? Or generate XML via the JSP.
Mimi Tam
Ranch Hand

Joined: Mar 05, 2010
Posts: 121
Dear David,

Thank you for the info. I shall do so as suggested.

However, I am not exactly sure how to do it. Is there sample code base doing this that you can point me to use as template?

I must do this quickly and hope very much to have a template that I can follow.

Any extra info will be greatly appreciated.

Many Thanks...

I agree. Here's the link: http://aspose.com/file-tools
subject: Send HTTP Response with XML schema??
It's not a secret anymore!