CXF
  1. CXF
  2. CXF-4104

wsdl2java generates Wrapped async method for Bare

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2.10
    • Fix Version/s: Invalid
    • Component/s: Core, Tooling
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      It looks like CXF 2.2.10 can only generate a wrapped async method when we set enableAsyncMapping. After I change enableWrapperStyle=false, it failed to generate Bare style Async method.

      Is it a known issue? Do we have workaround? thanks.

      Please see test below:

      binding.xml
      <jaxws:bindings wsdlLocation="http://localhost:7650/Calculator?wsdl"
                      xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
                      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
                      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                      xmlns:xs="http://www.w3.org/2001/XMLSchema">
      
        <jaxws:bindings node="wsdl:definitions">
          <jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
          <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
        </jaxws:bindings>
      
      </jaxws:bindings>
      
      generated HelloWorld.java
      @WebService(targetNamespace = "http://helloworld.webservice.com", name = "HelloWorld")
      @XmlSeeAlso({ObjectFactory.class})
      @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
      public interface HelloWorld {
      
          @WebMethod(operationName = "sayHello")
          public Response<test.client.generated.SayHelloResponse> sayHelloAsync(
              @WebParam(name = "name", targetNamespace = "http://helloworld.webservice.com")
              java.lang.String name,
              @WebParam(name = "another", targetNamespace = "http://helloworld.webservice.com")
              java.lang.String another,
              @WebParam(name = "timestamp", targetNamespace = "http://helloworld.webservice.com")
              java.lang.String timestamp
          );
      
          @WebMethod(operationName = "sayHello")
          public Future<?> sayHelloAsync(
              @WebParam(name = "name", targetNamespace = "http://helloworld.webservice.com")
              java.lang.String name,
              @WebParam(name = "another", targetNamespace = "http://helloworld.webservice.com")
              java.lang.String another,
              @WebParam(name = "timestamp", targetNamespace = "http://helloworld.webservice.com")
              java.lang.String timestamp,
              @WebParam(name = "asyncHandler", targetNamespace = "")
              AsyncHandler<test.client.generated.SayHelloResponse> asyncHandler
          );
      
          @WebResult(name = "sayHelloResponse", targetNamespace = "http://helloworld.webservice.com", partName = "parameters")
          @WebMethod
          public SayHelloResponse sayHello(
              @WebParam(partName = "parameters", name = "sayHello", targetNamespace = "http://helloworld.webservice.com")
              SayHello parameters
          );
      }
      

      David

        Activity

        David Liu created issue -
        David Liu made changes -
        Field Original Value New Value
        Description It looks like CXF 2.2.10 can only generate a wrapped async method when we set enableAsyncMapping. After I change enableWrapperStyle=false, it failed to generate Bare style Async method. Please see test below:

        {code:title=binding.xml}
        <jaxws:bindings wsdlLocation="http://localhost:7650/Calculator?wsdl"
                        xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
                        xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
                        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                        xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <jaxws:bindings node="wsdl:definitions">
            <jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
            <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
          </jaxws:bindings>

        </jaxws:bindings>
        {code}

        {code:title=generated HelloWorld.java}
        @WebService(targetNamespace = "http://helloworld.webservice.com", name = "HelloWorld")
        @XmlSeeAlso({ObjectFactory.class})
        @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
        public interface HelloWorld {

            @WebMethod(operationName = "sayHello")
            public Response<test.client.generated.SayHelloResponse> sayHelloAsync(
                @WebParam(name = "name", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String name,
                @WebParam(name = "another", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String another,
                @WebParam(name = "timestamp", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String timestamp
            );

            @WebMethod(operationName = "sayHello")
            public Future<?> sayHelloAsync(
                @WebParam(name = "name", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String name,
                @WebParam(name = "another", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String another,
                @WebParam(name = "timestamp", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String timestamp,
                @WebParam(name = "asyncHandler", targetNamespace = "")
                AsyncHandler<test.client.generated.SayHelloResponse> asyncHandler
            );

            @WebResult(name = "sayHelloResponse", targetNamespace = "http://helloworld.webservice.com", partName = "parameters")
            @WebMethod
            public SayHelloResponse sayHello(
                @WebParam(partName = "parameters", name = "sayHello", targetNamespace = "http://helloworld.webservice.com")
                SayHello parameters
            );
        }
        {Code}
        It looks like CXF 2.2.10 can only generate a wrapped async method when we set enableAsyncMapping. After I change enableWrapperStyle=false, it failed to generate Bare style Async method. Please see test below:

        {code:title=binding.xml}
        <jaxws:bindings wsdlLocation="http://localhost:7650/Calculator?wsdl"
                        xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
                        xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
                        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                        xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <jaxws:bindings node="wsdl:definitions">
            <jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
            <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
          </jaxws:bindings>

        </jaxws:bindings>
        {code}

        {code:title=generated HelloWorld.java}
        @WebService(targetNamespace = "http://helloworld.webservice.com", name = "HelloWorld")
        @XmlSeeAlso({ObjectFactory.class})
        @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
        public interface HelloWorld {

            @WebMethod(operationName = "sayHello")
            public Response<test.client.generated.SayHelloResponse> sayHelloAsync(
                @WebParam(name = "name", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String name,
                @WebParam(name = "another", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String another,
                @WebParam(name = "timestamp", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String timestamp
            );

            @WebMethod(operationName = "sayHello")
            public Future<?> sayHelloAsync(
                @WebParam(name = "name", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String name,
                @WebParam(name = "another", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String another,
                @WebParam(name = "timestamp", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String timestamp,
                @WebParam(name = "asyncHandler", targetNamespace = "")
                AsyncHandler<test.client.generated.SayHelloResponse> asyncHandler
            );

            @WebResult(name = "sayHelloResponse", targetNamespace = "http://helloworld.webservice.com", partName = "parameters")
            @WebMethod
            public SayHelloResponse sayHello(
                @WebParam(partName = "parameters", name = "sayHello", targetNamespace = "http://helloworld.webservice.com")
                SayHello parameters
            );
        }

        {code}
        David Liu made changes -
        Description It looks like CXF 2.2.10 can only generate a wrapped async method when we set enableAsyncMapping. After I change enableWrapperStyle=false, it failed to generate Bare style Async method. Please see test below:

        {code:title=binding.xml}
        <jaxws:bindings wsdlLocation="http://localhost:7650/Calculator?wsdl"
                        xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
                        xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
                        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                        xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <jaxws:bindings node="wsdl:definitions">
            <jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
            <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
          </jaxws:bindings>

        </jaxws:bindings>
        {code}

        {code:title=generated HelloWorld.java}
        @WebService(targetNamespace = "http://helloworld.webservice.com", name = "HelloWorld")
        @XmlSeeAlso({ObjectFactory.class})
        @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
        public interface HelloWorld {

            @WebMethod(operationName = "sayHello")
            public Response<test.client.generated.SayHelloResponse> sayHelloAsync(
                @WebParam(name = "name", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String name,
                @WebParam(name = "another", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String another,
                @WebParam(name = "timestamp", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String timestamp
            );

            @WebMethod(operationName = "sayHello")
            public Future<?> sayHelloAsync(
                @WebParam(name = "name", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String name,
                @WebParam(name = "another", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String another,
                @WebParam(name = "timestamp", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String timestamp,
                @WebParam(name = "asyncHandler", targetNamespace = "")
                AsyncHandler<test.client.generated.SayHelloResponse> asyncHandler
            );

            @WebResult(name = "sayHelloResponse", targetNamespace = "http://helloworld.webservice.com", partName = "parameters")
            @WebMethod
            public SayHelloResponse sayHello(
                @WebParam(partName = "parameters", name = "sayHello", targetNamespace = "http://helloworld.webservice.com")
                SayHello parameters
            );
        }

        {code}
          It looks like CXF 2.2.10 can only generate a wrapped async method when we set enableAsyncMapping. After I change enableWrapperStyle=false, it failed to generate Bare style Async method.

         Is it a known issue? Do we have workaround? thanks.

        Please see test below:
        {code:title=binding.xml}
        <jaxws:bindings wsdlLocation="http://localhost:7650/Calculator?wsdl"
                        xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
                        xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
                        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                        xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <jaxws:bindings node="wsdl:definitions">
            <jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
            <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
          </jaxws:bindings>

        </jaxws:bindings>
        {code}

        {code:title=generated HelloWorld.java}
        @WebService(targetNamespace = "http://helloworld.webservice.com", name = "HelloWorld")
        @XmlSeeAlso({ObjectFactory.class})
        @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
        public interface HelloWorld {

            @WebMethod(operationName = "sayHello")
            public Response<test.client.generated.SayHelloResponse> sayHelloAsync(
                @WebParam(name = "name", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String name,
                @WebParam(name = "another", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String another,
                @WebParam(name = "timestamp", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String timestamp
            );

            @WebMethod(operationName = "sayHello")
            public Future<?> sayHelloAsync(
                @WebParam(name = "name", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String name,
                @WebParam(name = "another", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String another,
                @WebParam(name = "timestamp", targetNamespace = "http://helloworld.webservice.com")
                java.lang.String timestamp,
                @WebParam(name = "asyncHandler", targetNamespace = "")
                AsyncHandler<test.client.generated.SayHelloResponse> asyncHandler
            );

            @WebResult(name = "sayHelloResponse", targetNamespace = "http://helloworld.webservice.com", partName = "parameters")
            @WebMethod
            public SayHelloResponse sayHello(
                @WebParam(partName = "parameters", name = "sayHello", targetNamespace = "http://helloworld.webservice.com")
                SayHello parameters
            );
        }
        {code}

        David
        Hide
        Daniel Kulp added a comment -

        Can you try with a more recent version of CXF? 2.2.x is long since unsupported.

        I added both bare and async flags to our wsdl first sample and with 2.5.2 it does generate bare async methods. Thus, this is something that may already be fixed.

        Show
        Daniel Kulp added a comment - Can you try with a more recent version of CXF? 2.2.x is long since unsupported. I added both bare and async flags to our wsdl first sample and with 2.5.2 it does generate bare async methods. Thus, this is something that may already be fixed.
        Daniel Kulp made changes -
        Fix Version/s NeedMoreInfo [ 12315387 ]
        Hide
        Daniel Kulp added a comment -


        Cannot reproduce with supported versions of CXF and request for testcase unanswered for over 2 months.

        Show
        Daniel Kulp added a comment - Cannot reproduce with supported versions of CXF and request for testcase unanswered for over 2 months.
        Daniel Kulp made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s Invalid [ 12312706 ]
        Fix Version/s NeedMoreInfo [ 12315387 ]
        Resolution Cannot Reproduce [ 5 ]
        Daniel Kulp made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        77d 13h 49m 1 Daniel Kulp 01/May/12 16:51
        Resolved Resolved Closed Closed
        119d 1h 54m 1 Daniel Kulp 28/Aug/12 18:46

          People

          • Assignee:
            Unassigned
            Reporter:
            David Liu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development