Question

I have following camel route:

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

where 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>

and TestWS:

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

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

Could you tell me what TestProcessor should return in order to proper call TestWS with multiple parameters?

Thanks

Was it helpful?

Solution

You need to add multiParameterArray=true option to the endpoint to the bean [1] URI.

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

Then your processor should set body as an array of parameters you want to pass to the service:

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top