【问题标题】:Camel route to soap service通往肥皂服务的骆驼路线
【发布时间】:2012-12-22 08:19:21
【问题描述】:

我是骆驼新手。

我想将以下代理路由添加到soap服务作为运行时。

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 指向地址为:http://localhost:9091/Client/NewWebService 的肥皂服务

我不知道如何创建 EndPoint clientService。

请帮帮我。

谢谢。

【问题讨论】:

    标签: soap apache-camel endpoint


    【解决方案1】:

    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")
    

    在此配置中替换您的目标 Web 服务设置应该相当简单。不过,您需要为此代码生成 Java 类等。

    【讨论】:

      猜你喜欢
      • 2018-11-27
      • 2019-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-12
      • 2018-09-05
      相关资源
      最近更新 更多