title: jax-ws generation: @WebMethod vs. @ResponseWrapper
body: <p>I have two very similar wsdl-files, that generate different Java-Code. In the first case I get a method with a @WebMethod-annotation and a return value, in the second case a method with @ResponseWrapper-annotation and no return values is generated. I would like to have return values.</p>
  
  <h2>1. Service1</h2>
  
  <pre><code>&lt;wsdl:operation name="foo"&gt;
          &lt;wsdl:input  name="deleteUser"         message="tns:deleteUserRequest"/&gt;
          &lt;wsdl:output name="deleteUserResponse"  message="tns:deleteUserResponse"/&gt;
          &lt;wsdl:fault name="ServiceFault"        message="tns:ServiceFault"/&gt;
      &lt;/wsdl:operation&gt; 
  </code></pre>
  
  <p>generates:</p>
  
  <pre><code>    @WebMethod
  @WebResult(name = "commonReturnType", targetNamespace = "http://www.foo.com/fooSchemaTypes-v3.0/", partName = "returnValue")
  public CommonReturnType foo(
      @WebParam(name = "fooType", targetNamespace = "http://www.foo.com/fooSchemaTypes-v3.0/", partName = "user")
      FooType user)
      throws ServiceFault
  ;
  </code></pre>
  
  <h2>2. FooBarService</h2>
  
  <pre><code>    &lt;wsdl:operation name="fooBar"&gt;
          &lt;wsdl:input name="fooBar" message="tns:fooBarRequest"&gt;&lt;/wsdl:input&gt;
          &lt;wsdl:output name="ackFileResponse" message="tns:fooBarResponse"&gt;&lt;/wsdl:output&gt;
          &lt;wsdl:fault name="ServiceFault" message="tns:fooBarFault"&gt;&lt;/wsdl:fault&gt;
      &lt;/wsdl:operation&gt;
  </code></pre>
  
  <p>genereates: </p>
  
  <pre><code>  @WebMethod
  @RequestWrapper(localName = "fooBar", targetNamespace = "http://www.foo.com/fooBarSchemaTypes-v1.0/", className = "com.foo.fooBar.v1_0.GetFileType")
  @ResponseWrapper(localName = "fooBarResponse", targetNamespace = "http://www.foo.com/fooBarSchemaTypes-v1.0/", className = "com.foo.fooBar.v1_0.CommonReturnType")
  public void ackFile(
      @WebParam(name = "id", targetNamespace = "")
      String id,
      @WebParam(name = "timestamp", targetNamespace = "")
      XMLGregorianCalendar timestamp,
      @WebParam(name = "anotherId", targetNamespace = "")
      String anotherId,
      @WebParam(name = "fileId", targetNamespace = "")
      String fileId,
      @WebParam(name = "returnCode", targetNamespace = "", mode = WebParam.Mode.OUT)
      Holder&lt;ReturnCode&gt; returnCode,
      @WebParam(name = "errorMessage", targetNamespace = "", mode = WebParam.Mode.OUT)
      Holder&lt;String&gt; errorMessage);
  </code></pre>
  
  <p>The code that generates the code is exactly the same.</p>
  
  <p>If necessary, I can provide the markup for the messages and the types. I hope anonymising didn't mess up the relevant parts.</p>
  
  <p>I would like to have the second version also with a return value. How can I achieve this?</p>