问题
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