Spring alternative to JAXRSClientFactory

我怕爱的太早我们不能终老 提交于 2021-02-11 14:58:31

问题


I have an interface with javax-ws-rs annotations for endpoints, and I am creating JAXRSClientFactory from cxf. Interface looks like this

@Path("/ws")
public interface TheWebServiceResource {

    @Path( "/" )
    @Produces( { MediaType.APPLICATION_JSON } )
    @GET
    Response handshake() ;
}

Then I create the resource

TheWebServiceResource myResource = JAXRSClientFactory.create(url, cls, providers, features, conf);

Now I know I could change the annotations to spring ones - @RequestMapping above the interface, @GetMapping above the method header etc.

But how do I create such a resource with spring that I can later call the interface method (without implementation) and get the response like I do now?

Response response = myResource.handshake();

来源:https://stackoverflow.com/questions/64522087/spring-alternative-to-jaxrsclientfactory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!