Hi Eduard On 09/10/12 14:47, Eduard Hildebrandt wrote:
Hi guys,I have a JAXRS service with an interface which is shared by client and server code. For example: @Path("/myservice/{a}/{b}/") public interface MyService { @POST @Path("doSomething") ObjectY doSomething(ObjectX x); } On the server-side we use Jersey and the implementations look like this: @Path("/myservice/{a}/{b}/") public class MyServiceImpl implements MyService { @PathParam("a") private String a; @PathParam("b") private String b; public ObjectY doSomething(ObjectX x) { return new ObjectY(a, b, x); } } I’d like to use CXF. I created a proxy-based CXF client from the interface. But how can I set the path-params “a” and “b”? I could change the interface signature to: @POST @Path("doSomething") public ObjectY doSomething(@PathParam(“a”) String a, @PathParam(“b”) String b, ObjectX x); But unfortunately this is not an option. I’m not allowed to change this interface. Do you have any ideas how I can solve this issue? Your help is highly appreciated!
Please try JAXRSClientFactory.create(address, MyService.class, null, aValue, bValue);
where 'null' is set for (Spring) configuration resource, I had to add this extra parameter to this factory method to avoid various overloading issues.
Alternatively: JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); bean.setAddress(address); bean.setServiceClass(MyService.class); MyService proxy = bean.create(MyService.class, aValue, bValue); That should do it, give it a try please Thanks, Sergey
Many greetings from Munich. Best regards, Eduard Hildebrandt
