

I'm a little stuck here. I am trying to POST a small XML fragment from a firefox poster.
<IntellexEvent> <RuleName>a rule name</RuleName> </IntellexEvent>
Simple enough, now my class for IntellexEvent is -
@XmlRootElement(name = "IntellexEvent") public class IntellexEvent {
}
My controller ...
@Controller @RequestMapping("/cace/**") public class CaceController { @Autowired IUserService userService; public CaceController() { } @RequestMapping(value = "/cace/postXML", method = RequestMethod.POST) public Result postXML(@RequestBody String intellexEvent) throws Exception { String temp = intellexEvent; Result result = new Result(); result.setStatusCode(200); result.setSuccess(true); return result; }
}
- EDITED - So, here I have @RequestBody as a string. I wanted this to be automatically connected to IntellexEvent ... As a string, I can hit my backend on POST, when I change String to IntellexEvent, I get 415 error.
I just want to hit my backend, I tried GET and I just hit (I didn't include them in my controller here), what am I missing here? In spring -mvc-servlet.xml, I defined the jaxb2 marshaller. If you need more information, just ask, thanks in advance guys!
source share