2012-12-22 155 views
1

我是骆驼新手。骆驼肥皂服务路线

我想添加以下代理路由到肥皂服务作为运行时间。

from("cxf://http://localhost:8081/CentrelServer/NewWebService?" +       
        "serviceClass=com.vnitt.webservice.axis.NewWebService" + 
        "&serviceName={http://axis.webservice.vnitt.com/}NewWebService" + 
        "&portName={http://axis.webservice.vnitt.com/}NewWebServicePort" + 
        "&wsdlURL=src/conf/NewWebService.wsdl"). 
          process(new Processor() { 

       public void process(Exchange arg0) throws Exception { 
        System.out.println("code run here"); 

       } 
      }).to(clientService); 

在上面的代码中,我想在地址clientService指向一个SOAP服务:http://localhost:9091/Client/NewWebService

我不知道如何创建端点clientService。

请帮帮我。

谢谢。

回答

2

official docs有一些体面的例子。

这个例子(取自上面的文档)例如(假设你可以在春季配置这个)。

<cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9000/SoapContext/SoapPort" 
     wsdlURL="testutils/hello_world.wsdl" 
     serviceClass="org.apache.hello_world_soap_http.Greeter" 
     endpointName="s:SoapPort" 
     serviceName="s:SOAPService" 
     xmlns:s="http://apache.org/hello_world_soap_http" /> 

或挺直的DSL线路:

to("cxf://http://localhost:9000/SoapContext/SoapPort?" +       
       "serviceClass=org.apache.hello_world_soap_http.Greeter" + 
       "&serviceName={http://apache.org/hello_world_soap_http/}SOAPService" + 
       "&endpointName={http://apache.org/hello_world_soap_http/}SoapPort" + 
       "&wsdlURL=testutils/hello_world.wsdl") 

应该是相当直截了当在此配置到substitue您的目标Web服务的设置。不过,您需要为这段代码生成Java类等。