You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Mark Lybarger <ml...@gmail.com> on 2005/09/23 03:05:59 UTC

posting xml as body to servlet

we have some servlets that process xml that they recieve as the body of the
http request. the servlet uses:
BufferedReader br = request.getReader();
to get the data that was posted to it (via an xmlhttprequest object, or
perhaps another servlet). i'd most like to setup cactus testing, since the
servlet calls out to another servlet to get more xml for processing and
ultimately returns xml. it's similar to a session facade where the ejb uses
other ejb's to do the work and just wraps the business logic.

i've used cactus in the past for testing calls to ejb's, and it worked very
nicely, but am new to servlet testing. i've browsed the examples and haven't
seen really something like what we're trying to do. can i use cactus to
"post" xml as the body of servlet request? and if so would there be an
example out there to do this type of thing?

thanks!
~mark

Re: posting xml as body to servlet

Posted by Mark Lybarger <ml...@gmail.com>.
i had not seen the setUserData in the WebRequest. i took a minute to read
further into the docs and such. Looks like i should be good to go.


On 9/22/05, Mark Lybarger <ml...@gmail.com> wrote:
>
> we have some servlets that process xml that they recieve as the body of
> the http request. the servlet uses:
> BufferedReader br = request.getReader();
> to get the data that was posted to it (via an xmlhttprequest object, or
> perhaps another servlet). i'd most like to setup cactus testing, since the
> servlet calls out to another servlet to get more xml for processing and
> ultimately returns xml. it's similar to a session facade where the ejb uses
> other ejb's to do the work and just wraps the business logic.
>
> i've used cactus in the past for testing calls to ejb's, and it worked
> very nicely, but am new to servlet testing. i've browsed the examples and
> haven't seen really something like what we're trying to do. can i use cactus
> to "post" xml as the body of servlet request? and if so would there be an
> example out there to do this type of thing?
>
> thanks!
> ~mark
>