CXF
  1. CXF
  2. CXF-4750

Wrong return type for enumeration in generated service interface using xmlbeans

    Details

    • Estimated Complexity:
      Unknown

      Description

      I have a WSDL which has an enumeration as the response type for a SOAP operation. From that, I am generating Java classes using the cxf-codegen-plugin with xmlbeans.
      The generated service interface has a String as response type. If my implementation returns a String containing one of the specified enum values, I get an Exception (using CXF 2.3.11):
      org.apache.cxf.interceptor.Fault
      at org.apache.cxf.databinding.AbstractWrapperHelper.createWrapperObject(AbstractWrapperHelper.java:107)
      at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:105)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
      at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
      at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:102)
      at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:464)
      at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:188)
      at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)
      at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
      at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:751)
      at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)

      If I manually change the return type of the generated interface and my implementation from String to "org.apache.test.ETestResponseType.Enum", everything works well.

      I could only test the wsdl2java generation with a newer CXF version, but 2.7.2 also generates a String as the response type.

      I will attach a sample project.

      1. enumtest.zip
        5 kB
        Roland Mueller
      2. enumtest-2.7.2.zip
        14 kB
        Roland Mueller
      3. enumtest-2.7.3-SNAPSHOT.zip
        14 kB
        Roland Mueller

        Activity

        Roland Mueller created issue -
        Roland Mueller made changes -
        Field Original Value New Value
        Attachment enumtest.zip [ 12564688 ]
        Daniel Kulp made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Daniel Kulp [ dkulp ]
        Fix Version/s 2.5.9 [ 12323912 ]
        Fix Version/s 2.6.6 [ 12323911 ]
        Fix Version/s 2.7.3 [ 12323910 ]
        Resolution Fixed [ 1 ]
        Roland Mueller made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Roland Mueller made changes -
        Attachment enumtest-2.7.2.zip [ 12566753 ]
        Attachment enumtest-2.7.3-SNAPSHOT.zip [ 12566754 ]
        Daniel Kulp made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Daniel Kulp made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Daniel Kulp
            Reporter:
            Roland Mueller
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development