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

        Daniel Kulp made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Daniel Kulp made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s Invalid [ 12312706 ]
        Fix Version/s NeedMoreInfo [ 12315387 ]
        Resolution Cannot Reproduce [ 5 ]
        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 -
        Fix Version/s NeedMoreInfo [ 12315387 ]
        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.
        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
        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 created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development