Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-9059

Camel-CXF POJO dataformat with WS-Security does not work if operation has Holder type in parameter list

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.2.1
    • Fix Version/s: fuse-7.1
    • Component/s: Camel
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      1. compile camel-cxf-pojo-ws-test project and client-jaxws respectively;
      2. start JBoss Fuse 6.2.1 R5 container and install feature "cxf-ws-security" with command "features:install cxf-ws-security";
      3. deploy the camel-cxf-pojo-ws-test 1.0.0 bundle to the container with command "install -s mvn:org.jboss.fuse.samples/camel-cxf-pojo-ws-test/1.0.0";
      4. start the client-jaxws by command "mvn -Pclient";
      You will see the failure on the last operation "getCustomerStatus". Now let's remove ws-security from both server and client side and test again.
      5. modify "camel-cxf-pojo-ws-test/src/main/resources/META-INF/spring/customer-ws.xml" file by commenting out the line #58 and #59:

       58             <!--ref bean="wss4jInInterceptor"/-->
       59             <!--ref bean="authenticationInterceptor"/-->
      

      6. modify "client-jaxws/src/main/java/org/jboss/fuse/samples/cxf/jaxws/client/Client.java" file by commenting out the line #69:

      69         //ClientProxy.getClient(client).getOutInterceptors().add(new WSS4JOutInterceptor(outProps));
      

      7, rebuild both projects and update the camel-cxf-pojo-ws-test 1.0.0 bundle deployed in the container with the new version. The start the client by "mvn -Pclient". It should work fine.

      Show
      1. compile camel-cxf-pojo-ws-test project and client-jaxws respectively; 2. start JBoss Fuse 6.2.1 R5 container and install feature "cxf-ws-security" with command "features:install cxf-ws-security"; 3. deploy the camel-cxf-pojo-ws-test 1.0.0 bundle to the container with command "install -s mvn:org.jboss.fuse.samples/camel-cxf-pojo-ws-test/1.0.0"; 4. start the client-jaxws by command "mvn -Pclient"; You will see the failure on the last operation "getCustomerStatus". Now let's remove ws-security from both server and client side and test again. 5. modify "camel-cxf-pojo-ws-test/src/main/resources/META-INF/spring/customer-ws.xml" file by commenting out the line #58 and #59: 58 <!--ref bean="wss4jInInterceptor"/--> 59 <!--ref bean="authenticationInterceptor"/--> 6. modify "client-jaxws/src/main/java/org/jboss/fuse/samples/cxf/jaxws/client/Client.java" file by commenting out the line #69: 69 //ClientProxy.getClient(client).getOutInterceptors().add(new WSS4JOutInterceptor(outProps)); 7, rebuild both projects and update the camel-cxf-pojo-ws-test 1.0.0 bundle deployed in the container with the new version. The start the client by "mvn -Pclient". It should work fine.
    • Sprint:
      Fuse 7.1 Sprint 30

      Description

      Camel-CXF POJO dataformat with WS-Security does not work when operation has javax.xml.ws.Holder type in parameter list. CXF just throws an "java.lang.IllegalArgumentException: argument type mismatch" exception.

      But when tried without WS-Security, the same use case works fine. Here is the sample operation:

      @WebService(targetNamespace = "http://demo.fusesource.com/wsdl/CustomerService/", name = "CustomerService")
      @XmlSeeAlso({ObjectFactory.class, com.fusesource.demo.customer.ObjectFactory.class})
      public interface CustomerService {
      ...
      ...
      ...
          @WebMethod(action = "http://www.example.org/CustomerService/getCustomerStatus")
          @RequestWrapper(localName = "getCustomerStatus", targetNamespace = "http://demo.fusesource.com/wsdl/CustomerService/", className = "com.fusesource.demo.wsdl.customerservice.GetCustomerStatus")
          @ResponseWrapper(localName = "getCustomerStatusResponse", targetNamespace = "http://demo.fusesource.com/wsdl/CustomerService/", className = "com.fusesource.demo.wsdl.customerservice.GetCustomerStatusResponse")
          public void getCustomerStatus(
              @WebParam(name = "customerId", targetNamespace = "")
              java.lang.String customerId,
              @WebParam(mode = WebParam.Mode.OUT, name = "status", targetNamespace = "")
              javax.xml.ws.Holder<java.lang.String> status,
              @WebParam(mode = WebParam.Mode.OUT, name = "statusMessage", targetNamespace = "")
              javax.xml.ws.Holder<java.lang.String> statusMessage
          );
      }
      

      Please see attached test case for more detail.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ffang Freeman(Yue) Fang
                Reporter:
                joe.luo Joe Luo
                Tester:
                Viliam Kasala
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: