Quantcast

Reading XML in a request body

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Reading XML in a request body

Kenneth Kousen
I'm trying to make a web service that receives SOAP messages from an existing client.  I know the client sends the message as the body of a POST request.  I'd like to use a groovlet to receive the request and process the body.

This seems like a silly question, but how do I extract the body of the request?  I'm so accustomed to receiving input parameters I'm not sure what to do when the body isn't a map.

I know the HttpServletRequest class has a getReader() method that returns a buffered reader containing the body of the request.  Is that what I should use?  There must be a groovier way.

Thanks,

Ken
--
Kenneth A. Kousen
President
Kousen IT, Inc.

Email: [hidden email]
Site: http://www.kousenit.com
Blog: http://kousenit.wordpress.com
Twitter: @kenkousen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reading XML in a request body

Guillaume Laforge-4
Hi Ken,

I think getting the reader is certainly the way to go, it's simple
enough, isn't it?
Just do a request.reader or request.inputStream, and pass that to a
XmlSlurper, that should do it.

Guillaume

On Fri, Sep 11, 2009 at 00:57, Kenneth Kousen <[hidden email]> wrote:

> I'm trying to make a web service that receives SOAP messages from an
> existing client.  I know the client sends the message as the body of a POST
> request.  I'd like to use a groovlet to receive the request and process the
> body.
> This seems like a silly question, but how do I extract the body of the
> request?  I'm so accustomed to receiving input parameters I'm not sure what
> to do when the body isn't a map.
> I know the HttpServletRequest class has a getReader() method that returns a
> buffered reader containing the body of the request.  Is that what I should
> use?  There must be a groovier way.
> Thanks,
>
> Ken
> --
> Kenneth A. Kousen
> President
> Kousen IT, Inc.
>
> Email: [hidden email]
> Site: http://www.kousenit.com
> Blog: http://kousenit.wordpress.com
> Twitter: @kenkousen
>



--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...