我是
Spring Webservices的初学者.我试图使用spring-ws 2.0创建契约优先的Web服务.我已经完成了web.xml(MessagedispatcherServlet)配置,我的契约设计(XSD),生成了JAXB类和服务实现.我在端点感到困惑.以下哪一个,mvc rest控制器或enpoints,在哪种情况下使用是正确的,为什么?提前致谢.
@Endpoint public class PersonEndpoint { @Autowired private PersonServiceImpl personService; @PayloadRoot(localPart = "PersonRequest",namespace = Constants.PERSON_NAMESPACE) public @ResponsePayload PersonResponseType personReadMethod(@RequestPayload PersonReadRequestType requestElement) { return personService.isBiometricNeeded(requestElement); } }
要么
@Controller public class PersonController { @Autowired private PersonServiceImpl personService; @RequestMapping(value = "/person",method = RequestMethod.GET) public @ResponseBody PersonResponseType personReadMethod(@RequestBody PersonReadRequestType requestElement) { return personService.isBiometricNeeded(requestElement); } }