CXF Web Service with Multiple Parameters

I am developing a web service using Camel and CXF and use the "first code". Everything works fine for methods that have one parameter. However, methods with several parameters receive only the first parameter, others - to zeros. No exception selected.

Here is my route:

<route>
  <from uri="cxf:bean:serverEndPoint" />
  <log message=">>> data is : ${body}"/>
  <choice>
    <when>
      <simple>${in.header.operationName} == 'doSomething'</simple>
      <to uri="bean:TestWSBean?method=doSomething"/>
    </when>
    ...
</route>

The server endpoint is defined as follows:

<cxf:cxfEndpoint id="serverEndPoint"
               address="http://localhost:9000/casServer/"
               serviceClass="com.test.iface.TestWebService">
  <cxf:inInterceptors>
      <ref bean="loggingInInterceptor"/>
  </cxf:inInterceptors>                   
  <cxf:outInterceptors>
      <ref bean="loggingOutInterceptor"/>
  </cxf:outInterceptors>                   
</cxf:cxfEndpoint>

And the bean implementation itself:

@WebService
public interface TestWebService {
  public String doSomething(String one, String two);
}

My question is pretty simple, what needs to be done to send multiple parameters?

+3
source share
1 answer

I think you will need to use requestwrappper annotation. Take a look at the code generated in the wsdl_first example in cxf. It generates annotations and a suitable wrapper class.

@RequestWrapper (localName = "updateCustomer", targetNamespace = "http://customerservice.example.com/", className = "com.example.customerservice.UpdateCustomer" )

+2

All Articles