Hi Paul,
Below are the two cases :
The request that works:
POST /abc/xyz HTTP/1.1
Content-Type: application/xml
Host: localhost:9998
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-Length: 167
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><VSEDHCPConfigResource><a>value1</a><b>valueb</b><c>valuec</c><d>valued</d><e>valuee</e></VSEDHCPConfigResource>
The request that fails : (leading spaces in message body)
POST /abc/xyz HTTP/1.1
Content-Type: application/xml
Host: localhost:9998
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-Length: 169
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?><VSEDHCPConfigResource><a>value1</a><b>valueb</b><c>valuec</c><d>valued</d><e>valuee</e></VSEDHCPConfigResource>
This handling of leading spaces is what is expected to be the default behavior with the apps ? Is there a way to override this?
There is one more observation. The leading spaces are handled if
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> is
removed from the message body. Why this difference in the handling ?
Thanks,
Minjal
________________________________
From: Paul Sandoz <Paul.Sandoz@Sun.COM>
To: Minjal Shah <shahminjal@yahoo.co.in>
Sent: Monday, 3 August, 2009 12:38:34 PM
Subject: Re: [Jersey] Leading Spaces in JAXB
On Aug 3, 2009, at 8:23 AM, Minjal Shah wrote:
Hi Paul,
>
>I had a query.
>When jersey/JAXB handles trailing spaces and spaces in between the tags in the xml body, why does it throw a BAD REQUEST when the xml body has leading spaces ?
>
>
Can you send me an example of the latter as i am not totally sure what you mean?
I suspect the wrapped exception in the bad request is originating from the XML parser because the XML document is not well formed, but i would need to see the stack trace to confirm that or not.
Paul.
Please explain.
>
>Thanks,
>Minjal
>
Love Cricket? Check out live scores, photos, video highlights and more. Click here
http://cricket.yahoo.com