-
1. Re: Problem posting xml content to restlet endpoint
njiang May 10, 2010 7:54 PM (in response to andrejk)Hi
It's strange that HTTP body
Are you sure you catch a right request message ?
Willem
-
2. Re: Problem posting xml content to restlet endpoint
andrejk May 11, 2010 4:18 AM (in response to njiang)Good catch, i changed the element name, and i copy/pasted the wrong log, but the problem still stands. Including an xml declaration results in an empty exchange body.
-
3. Re: Problem posting xml content to restlet endpoint
davsclaus May 11, 2010 7:02 AM (in response to andrejk)Just to be clear you are using camel-restlet for the REST stuff?
-
4. Re: Problem posting xml content to restlet endpoint
davsclaus May 11, 2010 7:12 AM (in response to andrejk)I just added an unit test which posts XML to camel-restlet.
See the test here
-
5. Re: Problem posting xml content to restlet endpoint
andrejk May 11, 2010 4:21 PM (in response to davsclaus)I just tried your unit test: when you add a xml declaration before the xml content (like jaxb does), the unit test fails.
public class RestletPostXmlTest extends RestletTestSupport {
@Override
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
// enable POST support
from("restlet:http://localhost:9087/users/?restletMethods=post")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
Object body = exchange.getIn().getBody();
assertNotNull(body);
assertEquals("", s);
}
}
-
6. Re: Problem posting xml content to restlet endpoint
njiang May 11, 2010 10:26 PM (in response to andrejk) -
7. Re: Problem posting xml content to restlet endpoint
andrejk May 12, 2010 12:42 AM (in response to njiang)Thanks.