我是初学者Spring Webservices
。我正在尝试使用spring-ws 2.0
. 我已经完成了web.xml
(MessageDispatcherServlet)配置、我的合同设计(XSD)、生成的JAXB
类和服务实现。我对端点感到困惑。以下哪一项,mvc 休息控制器或端点,在哪种情况下使用是正确的,为什么?提前致谢。
@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);
}
}