invalid xml syntax in jersey webservices using JAXB



I am using jersey web services which consumes POST request as an xml and produces response as an xml. I am using JAXB to marshal/Unmarshal xml into Java bean. Here "TestCall" is a class which stores all the attributes specified in request,but in case XML is malformed(i.e. end tag missing) in request, i need to return ERROR code in response XML. so how to handle these scenario ?


Here is my code:



@POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
@Path("/testCall")
@Override
public TestCallOutput postCall(TestCall testCall)
return myService.acceptCallData(testCall);
}

No comments:

Post a Comment