im having problem whith a POST request. I have to receive an XML message and im parsing it with JAXB. Everithing works fine but when special chars are included in the message like
<?xml version="1.0" encoding="UTF-8"?>
<sending>
<sms>
<message>España</message>
</sms>
</sending>
it throws a Bad Request Error (400)
The request sent by the client was syntactically incorrect (Bad Request).
This is my code to process the xml message
@POST
@Path("smsSendPost")
@Produces(MediaType.APPLICATION_XML)
public Response smsSendPost(JAXBElement<Sending> xml){
Sending sending = xml.getValue();
//Process the message
}
Im using tomcat to test it.
Can anyone help me with this?
UPDATE:
I’ve just found the cause of the problem is the tomcat, when I send the request via POST with ISO-8859-1 encoding the service works fine. The solution is to change the encoding of the tomcat.
I’ve just found that the cause of the problem is the tomcat, when I send the request via POST with ISO-8859-1 encoding the service works fine. I guess the solution is to change the encoding of the tomcat.