You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2007/09/17 19:56:27 UTC

svn commit: r576548 - in /incubator/cxf/tags/cxf-2.0.2-incubator: ./ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ systests/ systests/src/test/java/org/apache/cxf/systest/cxf993/ systests/src/test/java/org/apache/cxf/systest/s...

Author: dkulp
Date: Mon Sep 17 10:56:25 2007
New Revision: 576548

URL: http://svn.apache.org/viewvc?rev=576548&view=rev
Log:
Merged revisions 574887-575221,575223-575253,575255-575529 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r574887 | mmao | 2007-09-12 07:19:23 -0400 (Wed, 12 Sep 2007) | 5 lines
  
  CXF-993 
   
    * Client should ignore the header if the optional soap header is not generated as a parameter of the method
........
  r575213 | mmao | 2007-09-13 04:27:58 -0400 (Thu, 13 Sep 2007) | 9 lines
  
  CXF994
     * Clean up the method body of the async methods in the impl class
     * Wrap the each method generated in the client, since we don't cache the parameter's name, will cause duplicate definition
     * Import the async classes in the client main line
     * Add the callback handler field in the client mail line.
  
  Fix typos
........
  r575516 | mmao | 2007-09-13 22:44:07 -0400 (Thu, 13 Sep 2007) | 5 lines
  
  CXF-996 
    * If there's no binding style, it's DOCUMENT
    * Add tests for WSI-BP R2717
........
  r575529 | mmao | 2007-09-14 00:36:18 -0400 (Fri, 14 Sep 2007) | 4 lines
  
  CXF-1001
   * Fix the out of band header if the number of parameter of the wrapper child is zero
........

Added:
    incubator/cxf/tags/cxf-2.0.2-incubator/systests/src/test/java/org/apache/cxf/systest/cxf993/
      - copied from r575213, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/cxf993/
    incubator/cxf/tags/cxf-2.0.2-incubator/systests/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Impl.java
      - copied unchanged from r575213, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Impl.java
    incubator/cxf/tags/cxf-2.0.2-incubator/systests/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java
      - copied unchanged from r575213, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java
    incubator/cxf/tags/cxf-2.0.2-incubator/systests/src/test/java/org/apache/cxf/systest/cxf993/Server.java
      - copied unchanged from r575213, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/cxf993/Server.java
    incubator/cxf/tags/cxf-2.0.2-incubator/systests/src/test/resources/wsdl/cxf-993.wsdl
      - copied unchanged from r575213, incubator/cxf/trunk/systests/src/test/resources/wsdl/cxf-993.wsdl
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/test/resources/validator_wsdl/bp2717.wsdl
      - copied unchanged from r575529, incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/bp2717.wsdl
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/test/resources/validator_wsdl/cxf996.wsdl
      - copied unchanged from r575529, incubator/cxf/trunk/tools/validator/src/test/resources/validator_wsdl/cxf996.wsdl
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1001.wsdl
      - copied unchanged from r575529, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1001.wsdl
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf994/
      - copied from r575213, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf994/
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf994/async.xml
      - copied unchanged from r575213, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf994/async.xml
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf994/hello_world_async.wsdl
      - copied unchanged from r575213, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf994/hello_world_async.wsdl
Modified:
    incubator/cxf/tags/cxf-2.0.2-incubator/   (props changed)
    incubator/cxf/tags/cxf-2.0.2-incubator/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
    incubator/cxf/tags/cxf-2.0.2-incubator/systests/pom.xml
    incubator/cxf/tags/cxf-2.0.2-incubator/systests/src/test/java/org/apache/cxf/systest/soapheader/HeaderClientServerTest.java
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm
    incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java

Propchange: incubator/cxf/tags/cxf-2.0.2-incubator/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Sep 17 10:56:25 2007
@@ -1 +1 @@
-/incubator/cxf/trunk:1-573640,573667-574161,574163-574834,574836-574886,574888-575212,575214-575221,575223-575253,575255-575515,575517-575528,575530-576516
+/incubator/cxf/trunk:1-573640,573667-574161,574163-574834,574836-575221,575223-575253,575255-576516

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java Mon Sep 17 10:56:25 2007
@@ -98,6 +98,7 @@
             xtw.writeNamespace(soapVersion.getPrefix(), soapVersion.getNamespace());
             
             boolean preexistingHeaders = message.hasHeaders();
+
             if (preexistingHeaders) {
                 xtw.writeStartElement(soapVersion.getPrefix(), 
                                       soapVersion.getHeader().getLocalPart(),
@@ -172,10 +173,13 @@
             if (headers == null) {
                 return endedHeader;
             }            
-            
+
             for (SoapHeaderInfo header : headers) {
                 MessagePartInfo part = header.getPart();
-
+                if (part.getIndex() >= objs.size()) {
+                    // The optional out of band header is not a part of parameters of the method
+                    continue;
+                }
                 Object arg = objs.get(part);
                 objs.remove(part);
                 if (!(startedHeader || preexistingHeaders)) {

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/systests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/systests/pom.xml?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/systests/pom.xml (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/systests/pom.xml Mon Sep 17 10:56:25 2007
@@ -65,6 +65,11 @@
                                       <extraarg>-V</extraarg>
                                     </extraargs-->
                                 </wsdlOption>
+
+                                <wsdlOption>
+                                    <wsdl>${basedir}/src/test/resources/wsdl/cxf-993.wsdl</wsdl>
+                                </wsdlOption>
+
                             </wsdlOptions>
                         </configuration>
                         <goals>

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/systests/src/test/java/org/apache/cxf/systest/soapheader/HeaderClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/systests/src/test/java/org/apache/cxf/systest/soapheader/HeaderClientServerTest.java?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/systests/src/test/java/org/apache/cxf/systest/soapheader/HeaderClientServerTest.java (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/systests/src/test/java/org/apache/cxf/systest/soapheader/HeaderClientServerTest.java Mon Sep 17 10:56:25 2007
@@ -72,7 +72,7 @@
         assertNotNull("WSDL is null", wsdl);
 
         PizzaService service = new PizzaService(wsdl, serviceName);
-        assertNotNull("Service is ull ", service);
+        assertNotNull("Service is null ", service);
 
         return service.getPizzaPort();
     }

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java Mon Sep 17 10:56:25 2007
@@ -50,6 +50,8 @@
     private final Map<String, JavaAnnotation> annotations = new HashMap<String, JavaAnnotation>();
 
     private JavaCodeBlock block;
+
+    private boolean async;
     
     public JavaMethod() {
         this(new JavaInterface());
@@ -320,5 +322,13 @@
 
     public JavaCodeBlock getJavaCodeBlock() {
         return this.block;
+    }
+
+    public final boolean isAsync() {
+        return async;
+    }
+
+    public final void setAsync(final boolean newAsync) {
+        this.async = newAsync;
     }
 }

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java Mon Sep 17 10:56:25 2007
@@ -28,6 +28,11 @@
     private String partName;
 
     private JavaMethod javaMethod;
+
+    /**
+     * Describe callback here.
+     */
+    private boolean callback;
     
     public JavaParameter() {
     }
@@ -96,5 +101,23 @@
 
     public void annotate(Annotator annotator) {
         annotator.annotate(this);
+    }
+
+    /**
+     * Get the <code>Callback</code> value.
+     *
+     * @return a <code>boolean</code> value
+     */
+    public final boolean isCallback() {
+        return callback;
+    }
+
+    /**
+     * Set the <code>Callback</code> value.
+     *
+     * @param newCallback The new Callback value.
+     */
+    public final void setCallback(final boolean newCallback) {
+        this.callback = newCallback;
     }
 }

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java Mon Sep 17 10:56:25 2007
@@ -247,10 +247,9 @@
                 BindingOperation bop = wsdlHelper.getBindingOperation(def, operation.getName());
                 Binding binding = wsdlHelper.getBinding(bop, def);
                 String bindingStyle = binding != null ? SOAPBindingUtil.getBindingStyle(binding) : "";
-
                 String style = "".equals(SOAPBindingUtil.getSOAPOperationStyle(bop))
                     ? bindingStyle : SOAPBindingUtil.getSOAPOperationStyle(bop);
-                if ("DOCUMENT".equalsIgnoreCase(style)) {
+                if ("DOCUMENT".equalsIgnoreCase(style) || "".equals(style)) {
                     boolean passed = checkR2201Input(operation, bop)
                         && checkR2201Output(operation, bop)
                         && checkR2716(bop);

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/tools/validator/src/test/java/org/apache/cxf/tools/validator/WSDLValidationTest.java Mon Sep 17 10:56:25 2007
@@ -220,6 +220,26 @@
         }
     }
 
+    @Test
+    public void testBPR2717() throws Exception {
+        try {
+            String[] args = new String[] {"-verbose",
+                                          getLocation("/validator_wsdl/cxf996.wsdl")};
+            WSDLValidator.main(args);
+        } catch (Exception e) {
+            assertTrue(getStdErr().indexOf("WSI-BP-1.0 R2717:  ") == -1);
+            assertTrue(getStdErr().indexOf("WSI-BP-1.0 R2210:  ") != -1);
+        }
+
+        try {
+            String[] args = new String[] {"-verbose",
+                                          getLocation("/validator_wsdl/bp2717.wsdl")};
+            WSDLValidator.main(args);
+        } catch (Exception e) {
+            assertTrue(getStdErr().indexOf("WSI-BP-1.0 R2717:  ") != -1);
+        }
+    }
+
     @Override
     protected String getLocation(String wsdlFile) throws Exception {
         Enumeration<URL> e = WSDLValidationTest.class.getClassLoader().getResources(wsdlFile);

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java Mon Sep 17 10:56:25 2007
@@ -36,6 +36,7 @@
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaParameter;
 import org.apache.cxf.tools.common.model.JavaReturn;
+import org.apache.cxf.tools.common.model.JavaType;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBinding;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.SoapBindingAnnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WebMethodAnnotator;
@@ -63,7 +64,7 @@
 
     void processMethod(JavaMethod method, OperationInfo operation,
                               JAXWSBinding globalBinding) throws ToolException {
-        if (isAsynCMethod(method)) {
+        if (isAsyncMethod(method)) {
             return;
         }
         MessageInfo inputMessage = operation.getInput();
@@ -146,7 +147,7 @@
         }
     }
 
-    private boolean isAsynCMethod(JavaMethod method) {
+    private boolean isAsyncMethod(JavaMethod method) {
         if (method.getName().toLowerCase()
             .equals((method.getOperationName() + ToolConstants.ASYNC_METHOD_SUFFIX).toLowerCase())) {
             return true;
@@ -162,64 +163,68 @@
         method.getInterface().addImport("javax.xml.ws.Response");
     }
 
-    private void addPollingMethod(JavaMethod method) throws ToolException {
-        JavaMethod pollingMethod = new JavaMethod(method.getInterface());
-        pollingMethod.setName(method.getName() + ToolConstants.ASYNC_METHOD_SUFFIX);
-        pollingMethod.setStyle(method.getStyle());
-        pollingMethod.setWrapperStyle(method.isWrapperStyle());
-        pollingMethod.setSoapAction(method.getSoapAction());
-        pollingMethod.setOperationName(method.getOperationName());
+    private void addCallbackMethod(JavaMethod method) throws ToolException {
+        JavaMethod callbackMethod = new JavaMethod(method.getInterface());
+        callbackMethod.setAsync(true);
+        callbackMethod.setName(method.getName() + ToolConstants.ASYNC_METHOD_SUFFIX);
+        callbackMethod.setStyle(method.getStyle());
+        callbackMethod.setWrapperStyle(method.isWrapperStyle());
+        callbackMethod.setSoapAction(method.getSoapAction());
+        callbackMethod.setOperationName(method.getOperationName());
 
         JavaReturn future = new JavaReturn();
         future.setClassName("Future<?>");
-        pollingMethod.setReturn(future);
+        callbackMethod.setReturn(future);
 
         // REVISIT: test the operation name in the annotation
-        pollingMethod.annotate(new WebMethodAnnotator());
-        pollingMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
-        pollingMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
-        pollingMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));
+        callbackMethod.annotate(new WebMethodAnnotator());
+        callbackMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
+        callbackMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
+        callbackMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));
 
         for (Iterator iter = method.getParameters().iterator(); iter.hasNext();) {
-            pollingMethod.addParameter((JavaParameter)iter.next());
+            callbackMethod.addParameter((JavaParameter)iter.next());
         }
 
         JavaParameter asyncHandler = new JavaParameter();
         asyncHandler.setName("asyncHandler");
+        asyncHandler.setCallback(true);
         asyncHandler.setClassName(getAsyncClassName(method, "AsyncHandler"));
         JavaAnnotation asyncHandlerAnnotation = new JavaAnnotation("WebParam");
         asyncHandlerAnnotation.addArgument("name", "asyncHandler");
         asyncHandlerAnnotation.addArgument("targetNamespace", "");
         asyncHandler.setAnnotation(asyncHandlerAnnotation);
+        asyncHandler.setStyle(JavaType.Style.IN);
 
-        pollingMethod.addParameter(asyncHandler);
+        callbackMethod.addParameter(asyncHandler);
 
-        method.getInterface().addMethod(pollingMethod);
+        method.getInterface().addMethod(callbackMethod);
     }
 
-    private void addCallbackMethod(JavaMethod method) throws ToolException {
-        JavaMethod callbackMethod = new JavaMethod(method.getInterface());
-        callbackMethod.setName(method.getName() + ToolConstants.ASYNC_METHOD_SUFFIX);
-        callbackMethod.setStyle(method.getStyle());
-        callbackMethod.setWrapperStyle(method.isWrapperStyle());
-        callbackMethod.setSoapAction(method.getSoapAction());
-        callbackMethod.setOperationName(method.getOperationName());
+    private void addPollingMethod(JavaMethod method) throws ToolException {
+        JavaMethod pollingMethod = new JavaMethod(method.getInterface());
+        pollingMethod.setAsync(true);
+        pollingMethod.setName(method.getName() + ToolConstants.ASYNC_METHOD_SUFFIX);
+        pollingMethod.setStyle(method.getStyle());
+        pollingMethod.setWrapperStyle(method.isWrapperStyle());
+        pollingMethod.setSoapAction(method.getSoapAction());
+        pollingMethod.setOperationName(method.getOperationName());
 
         JavaReturn response = new JavaReturn();
         response.setClassName(getAsyncClassName(method, "Response"));
-        callbackMethod.setReturn(response);
+        pollingMethod.setReturn(response);
 
         // REVISIT: test the operation name in the annotation
-        callbackMethod.annotate(new WebMethodAnnotator());
-        callbackMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
-        callbackMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
-        callbackMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));
+        pollingMethod.annotate(new WebMethodAnnotator());
+        pollingMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
+        pollingMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
+        pollingMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));
 
         for (Iterator iter = method.getParameters().iterator(); iter.hasNext();) {
-            callbackMethod.addParameter((JavaParameter)iter.next());
+            pollingMethod.addParameter((JavaParameter)iter.next());
         }
 
-        method.getInterface().addMethod(callbackMethod);
+        method.getInterface().addMethod(pollingMethod);
     }
 
     private String getAsyncClassName(JavaMethod method, String clzName) {

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java Mon Sep 17 10:56:25 2007
@@ -186,7 +186,8 @@
         MessagePartInfo part = inputParts.iterator().next();
 
         List<QName> wrappedElements = ProcessorUtil.getWrappedElementQNames(context, part.getElementQName());
-        if (wrappedElements == null || wrappedElements.size() == 0) {
+        if ((wrappedElements == null || wrappedElements.size() == 0) 
+            && countOutOfBandHeader(inputMessage) == 0) {
             return;
         }
         boolean isSchemaQualified = ProcessorUtil.isSchemaFormQualified(context, part.getElementQName());
@@ -201,9 +202,9 @@
         }
 
         // Adding out of band headers
-        if (countOutOfBandHeader(inputMessage) > 0) {
+        if (requireOutOfBandHeader() && countOutOfBandHeader(inputMessage) > 0) {
             for (MessagePartInfo hpart : inputMessage.getMessageParts()) {
-                if (!isOutOfBandHeader(hpart) || !requireOutOfBandHeader()) {
+                if (!isOutOfBandHeader(hpart)) {
                     continue;
                 }
                 addParameter(method, getParameterFromPart(hpart, JavaType.Style.IN));

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/client.vm Mon Sep 17 10:56:25 2007
@@ -29,6 +29,9 @@
 #if ($service.PackageName != $intf.PackageName) 
 import ${service.PackageName}.${service.Name};
 #end
+#foreach ($import in $intf.Imports)
+import ${import};
+#end
 
 /**
  * This class was generated by the CXF $version
@@ -66,7 +69,7 @@
         $intf.Name port = ss.get${port.Name}();  
         
 #foreach ($method in $intf.Methods)
-
+        {
         System.out.println("Invoking ${method.Name}...");
 #foreach ($parameter in $method.Parameters)
 #set($paramValueName = "_${method.Name}_${parameter.Name}")
@@ -90,6 +93,7 @@
 #if($method.return.Type != "void")
 ${indent}System.out.println("${method.Name}.result=" + _${method.Name}__return);
 #end
+
 #foreach ($parameter in $method.Parameters)
 #if ($parameter.Style.toString() != "IN")
 #set($paramValueName = "_${method.Name}_${parameter.Name}")
@@ -104,8 +108,9 @@
         }#end
 #end        
 
+${indent}}
 #end
-        
+
         System.exit(0);
     }
 

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm Mon Sep 17 10:56:25 2007
@@ -49,6 +49,10 @@
      * @see $intf.PackageName.$intf.Name#${method.Name}(#foreach ($parameter in $method.Parameters)$parameter.ClassName  $parameter.Name #if ($velocityCount != $method.getParameters().size()),#end)#end*
      */
     public $method.return.ClassName ${method.Name}(#if($method.ParameterListWithoutAnnotation.size() == 0))#end#if($method.ParameterListWithoutAnnotation.size() != 0)#foreach($param in ${method.ParameterListWithoutAnnotation})$param#end)#end#if($method.Exceptions.size() > 0) throws #foreach($exception in $method.Exceptions)$exception.ClassName #if($velocityCount != $method.Exceptions.size()),#end #end #end { 
+#if ($method.Async)
+       return null;
+       /* not called */
+#else
         LOG.info("Executing operation $method.Name");
 #foreach ($parameter in $method.Parameters)
 #if ($parameter.Style.toString() == "IN")
@@ -76,6 +80,7 @@
 #if ($method.Exceptions.size() > 0) 
 #foreach($exception in $method.Exceptions)
         //throw new ${exception.ClassName}("${exception.Name}...");
+#end
 #end
 #end
     }

Modified: incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=576548&r1=576547&r2=576548&view=diff
==============================================================================
--- incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java (original)
+++ incubator/cxf/tags/cxf-2.0.2-incubator/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java Mon Sep 17 10:56:25 2007
@@ -693,4 +693,35 @@
             fail("The cxf978.wsdl is a valid wsdl, should pass the test, caused by: " + e.getMessage());
         }
     }
+
+    @Test
+    public void testAsyncImplAndClient() throws Exception {
+        //CXF994
+        env.put(ToolConstants.CFG_COMPILE, "compile");
+        env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
+        env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
+        env.put(ToolConstants.CFG_CLIENT, ToolConstants.CFG_CLIENT);
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf994/hello_world_async.wsdl"));
+        env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf994/async.xml"));
+        processor.setContext(env);
+        processor.execute();
+    }
+
+    @Test
+    public void testZeroInputOutOfBandHeader() throws Exception {
+        env.put(ToolConstants.CFG_COMPILE, "compile");
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf1001.wsdl"));
+        env.put(ToolConstants.CFG_EXTRA_SOAPHEADER, "TRUE");
+        env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
+        env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
+        env.put(ToolConstants.CFG_CLIENT, ToolConstants.CFG_CLIENT);
+
+        processor.setContext(env);
+        processor.execute();
+
+        String results = getStringFromFile(new File(output.getCanonicalPath(), 
+                                                    "soapinterface/ems/esendex/com/AccountServiceSoap.java"));
+        assertTrue(results.indexOf("public  int  getMessageLimit") != -1);
+        assertTrue(results.indexOf("header  =  true,  name  =  \"MessengerHeader") != -1);
+    }
 }