我必须在现有的应用程序中创建RESTful web服务,该应用程序目前提供SOAP服务,并因此使用org.springframework.ws.server.endpoint.annotation.Endpoint
,所以我可以使用@Endpoint
注释类而不是@RestController
来使用Spring创建RESTful web服务,这些类可以使用以下方法:
@RequestMapping(value = "/myMethod", method=RequestMethod.GET)
public ResponseEntity<String> restMethod() {
...
}
发布于 2018-02-22 06:44:16
@Endpoint注释将类标记为SOAP端点,该端点将通过其方法处理SOAP请求。根据javadoc的说法,@RestController是“一个本身带有@Controller和@ResponseBody注解的方便注释”,这是创建REST服务的非常方便的机制。因此,您不能使用@Endpoint来等待它像@RestController一样运行。
https://stackoverflow.com/questions/48929369
复制