【问题标题】:Apache Camel + spring remoting + jax-ws + multiple parametersApache Camel + spring remoting + jax-ws + 多参数
【发布时间】:2014-04-10 11:23:43
【问题描述】:

我有以下骆驼路线:

<route id="myRoute">
   <from uri="cxf:bean:TestEndpoint />
   <process ref="TestProcessor" />
   <to uri="bean:TestWS?method=doSomething" />
</route>

TestWS 在哪里:

<bean id="TestWS" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
    <property name="serviceInterface" value="org.example.TestWS />
    <property name="wsdlDocumentUrl" value="http://localhost:8080/TestWSImplService/TestWSImpl?wsdl" />
    <property name="namespaceUri" value="http://org.example" />
    <property name="serviceName" value="TestWSImplService" />
    <property name="portName" value="TestWSImplPort" />
</bean>

和TestWS:

@WebService(targetNamespace = "http://org.example")
public interface TestWS {

    public String doSomething(Object param1, Object param2);
}

您能告诉我 TestProcessor 应该返回什么以便正确调用具有多个参数的 TestWS 吗?

谢谢

【问题讨论】:

    标签: spring jax-ws apache-camel


    【解决方案1】:

    您需要将multiParameterArray=true 选项添加到bean [1] URI 的端点。

    <to uri="bean:TestWS?method=doSomething&amp;multiParameterArray=true" />
    

    那么你的处理器应该将 body 设置为你想要传递给服务的参数数组:

    exchange.getIn().setBody(new Object[]{"param1", "param2"});
    

    [1]https://camel.apache.org/bean.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多