Camel:查找调用路由的Web服务接口的限定名称

时间:2015-05-08 20:06:29

标签: java rest soap apache-camel cxf

我有一个由Camel路由调用的CXF Web服务。然后实际执行由一些SomethingDoerBean完成,该SOAP被调用为Camel路由的一个端点。

这是Web服务的界面。它适用于RESTpackage my.company.service; @WebService(name = "SomethingDoerService", targetNamespace = "my.company/SomethingDoerService") public interface SomethingDoerService { @GET @Path("/somepath/{userId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @WebMethod @WebResult(name = "myResponse") public MyResponse doSomething( @HeaderParam("myHeader") @WebParam(name = "MyHeader", header = true, targetNamespace = "my.company") MyHeader myHeader, @PathParam("userId") @WebParam(name = "userId") String userId); } 个请求。

<!-- soap requests -->
<route id="SoapSomethingDoerService">
    <from uri="cxf:bean:somethingDoerService" />
    <to uri="direct:somethingDoerOperation" />
</route>

<!-- rest requests -->
<route id="RestSomethingDoerService">
    <from uri="cxfrs:/rest/somethingDoerOperation?resourceClasses=my.company.service.somethingDoerOperation&amp;bindingStyle=SimpleConsumer&amp;providers=#restJacksonProviderList" />
    <to uri="direct:somethingDoerOperation" />
</route>

<route id="SomethingDoerOperationRoute">
    <from uri="direct:somethingDoerOperation" />
    ...............
    <to uri="bean:somethingDoerBean?method=doSomethingReal" />
    ...............
</route>

这是路线配置:

SomethingDoerBean

my.company.service.SomethingDoerService中,我想以编程方式了解调用路由的Web服务接口的限定名称(在本例中为exchange)。我怎么能实现这个目标?我在Camel <?php $url = 'http://api.geosvc.com/rest/US/84606/nearby?apikey=4ff687893a7b468cb520b3c4e967c4da&d=20&pt=PostalCode&format=json&callback=JSON_CALLBACK'; $JSON = file_get_contents($url); // echo the JSON (you can echo this to JavaScript to use it there) echo $JSON; ?> 界面上看不到任何可以让我得到它的东西......

0 个答案:

没有答案