7 Replies Latest reply on May 12, 2010 12:42 AM by andrej koelewijn

    Problem posting xml content to restlet endpoint

    andrej koelewijn Newbie

      Hi,

       

      I've implemented a route with a restlet consumer and i'm posting xml documents to it. I'm running into a problem when the xml document starts with an xml declaration. (using camel 2.2.0 on the server and jersey client 1.1.5.1 on the client side).

       

      Using tcpmon the following post is ok:

       

      POST /mail/outbox HTTP/1.1

      Content-Type: application/xml

      User-Agent: Java/1.6.0_17

      Host: 127.0.0.1:7676

      Accept: text/html, image/gif, image/jpeg, *; q=.2, /; q=.2

      Connection: keep-alive

      Content-Length: 89

       

       

       

      camel log show the following exchange:

       

      INFO: Exchange[Id:8a2e11b9-6775-4e1d-a3a0-3aaa4399c912, Properties:{CamelToEndpoint=log://outbox.received?showAll=true}, Headers:{org.restlet.startTime=1273524833502, org.restlet.http.headers=[Content-Type: application/xml, User-Agent: Java/1.6.0_17, Host: 127.0.0.1:7676, Accept: text/html, image/gif, image/jpeg, *; q=.2, /; q=.2, Connection: keep-alive, Content-Length: 89], CamelHttpMethod=POST, CamelHttpUri=http://127.0.0.1:7676/mail/outbox, org.restlet.http.version=HTTP/1.1}, BodyType:String, Body:, Out: null]

       

      No problem, works as expected.

       

      However, the following post:

       

      POST /mail/outbox HTTP/1.1

      Content-Type: application/xml

      User-Agent: Java/1.6.0_17

      Host: 127.0.0.1:7676

      Accept: text/html, image/gif, image/jpeg, *; q=.2, /; q=.2

      Connection: keep-alive

      Content-Length: 144

       

      , CamelHttpUri=http://127.0.0.1:7676/mail/outbox, org.restlet.http.headers=[Content-Type: application/xml, User-Agent: Java/1.6.0_17, Host: 127.0.0.1:7676, Accept: text/html, image/gif, image/jpeg, *; q=.2, /; q=.2, Connection: keep-alive, Content-Length: 158]}, BodyType:null, Body:null, Out: null]

       

      The content has become part of the headers, and the Body is empty...

       

      Is this a bug on am i doing something wrong? Any workarounds?

       

      Thanks,

      Andrej

       

      Edited by: andrejk on May 10, 2010 9:08 PM