cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r490973 [1/3] - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/service/model/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/core/src/test/java/org/apache/cxf/wsdl11/ rt/frontend...
Date Fri, 29 Dec 2006 10:05:43 GMT
Author: mmao
Date: Fri Dec 29 02:05:41 2006
New Revision: 490973

URL: http://svn.apache.org/viewvc?view=rev&rev=490973
Log:
CXF-309
   Port the jaxws processors from tools to tools2

* Separate the annotation processing from processors
* Separate the mapping of the wsdl service model to Java code model 
* Fix a NEP in AbstractInDatabindingInterceptor
* Find a bug in testheader4, revisit later
* Add the parameter order in OperationInfo

Added:
    incubator/cxf/trunk/testutils/src/main/resources/wsdl/bug161/
      - copied from r490267, incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/bug161/
    incubator/cxf/trunk/testutils/src/main/resources/wsdl/bug161/header2.wsdl
      - copied unchanged from r490962, incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/bug161/header2.wsdl
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/Annotator.java   (with props)
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaCommon.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/AbstractProcessor.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java
      - copied, changed from r490267, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/Messages.properties
      - copied unchanged from r490267, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/Messages.properties
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
      - copied, changed from r490267, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
      - copied, changed from r490267, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/PortTypeProcessor.java
      - copied, changed from r490267, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/PortTypeProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
      - copied, changed from r490267, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/SEIAnnotationProcessor.java
      - copied, changed from r490267, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/SEIAnnotationProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
      - copied, changed from r490267, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/BindingAnnotator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebServiceAnnotator.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/InterfaceMapper.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/Messages.properties
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/MethodMapper.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/ParameterMapper.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/PortTypeProcessorTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtilTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotatorTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotatorTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/InterfaceMapperTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/MethodMapperTest.java   (with props)
Removed:
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/TypesCodeWriter.java
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_xml_http/bare/GreeterImpl.java
    incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_xml_bare.wsdl
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaAnnotation.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/DummyDataBinding.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java Fri Dec 29 02:05:41 2006
@@ -73,9 +73,13 @@
         addMessagePart(part);
         return part;
     }
+    
+    public QName getMessagePartQName(String name) {
+        return new QName(this.getOperation().getInterface().getService().getTargetNamespace(), name);
+    }
+    
     public MessagePartInfo addMessagePart(String name) {
-        return addMessagePart(new QName(this.getOperation().getInterface().getService().getTargetNamespace(),
-                                        name));
+        return addMessagePart(getMessagePartQName(name));
     }    
     /**
      * Adds a message part to this container.

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java Fri Dec 29 02:05:41 2006
@@ -20,11 +20,39 @@
 package org.apache.cxf.service.model;
 
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.common.util.StringUtils;
+
 public class MessageInfo extends AbstractMessageContainer {
     public MessageInfo(OperationInfo op, QName nm) {
         super(op, nm);
     }
     
+    public Map<QName, MessagePartInfo> getMessagePartsMap() {
+        Map<QName, MessagePartInfo> partsMap = new HashMap<QName, MessagePartInfo>();
+        for (MessagePartInfo part : getMessageParts()) {
+            partsMap.put(part.getName(), part);
+        }
+        return partsMap;
+    }
+
+    public List<MessagePartInfo> getOrderedParts(List<String> order) {  
+        if (StringUtils.isEmpty(order)) {
+            return getMessageParts();
+        }
+        
+        List<MessagePartInfo> orderedParts = new ArrayList<MessagePartInfo>();
+        Map<QName, MessagePartInfo> partsMap = getMessagePartsMap();
+        for (String part : order) {
+            QName qname = getMessagePartQName(part);
+            orderedParts.add(partsMap.get(qname));
+        }
+        return orderedParts;
+    }
 }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java Fri Dec 29 02:05:41 2006
@@ -21,6 +21,7 @@
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.logging.Logger;
@@ -30,9 +31,6 @@
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 
-/**
- * 
- */
 public class OperationInfo extends AbstractPropertiesHolder {
     private static final Logger LOG = LogUtils.getL7dLogger(OperationInfo.class);
     InterfaceInfo intf;
@@ -43,6 +41,7 @@
     MessageInfo outputMessage;
     Map<QName, FaultInfo> faults;
     OperationInfo unwrappedOperation;
+    List<String> parameterOrdering;     
 
     public OperationInfo() {
     }
@@ -193,6 +192,14 @@
             return Collections.emptyList();
         }
         return Collections.unmodifiableCollection(faults.values());
+    }
+    
+    public void setParameterOrdering(List<String> o) {
+        this.parameterOrdering = o;
+    }
+    
+    public List<String> getParameterOrdering() {
+        return parameterOrdering;
     }
     
     @Override

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java Fri Dec 29 02:05:41 2006
@@ -33,6 +33,7 @@
     TypeInfo typeInfo;
     Map<QName, BindingInfo> bindings = new ConcurrentHashMap<QName, BindingInfo>(2);
     Map<QName, EndpointInfo> endpoints = new ConcurrentHashMap<QName, EndpointInfo>(2);
+    Map<QName, MessageInfo> messages;
     
     public ServiceInfo() {
     }
@@ -89,5 +90,25 @@
 
     public void setTypeInfo(TypeInfo typeInfo) {
         this.typeInfo = typeInfo;
+    }
+    
+    public Map<QName, MessageInfo> getMessages() {
+        if (messages != null) {
+            return messages;            
+        }
+        messages = new ConcurrentHashMap<QName, MessageInfo>();
+        for (OperationInfo operation : getInterface().getOperations()) {
+            if (operation.getInput() != null) {
+                messages.put(operation.getInput().getName(), operation.getInput());
+            }
+            if (operation.getOutput() != null) {
+                messages.put(operation.getOutput().getName(), operation.getOutput());
+            }
+        }
+        return messages;
+    }
+    
+    public MessageInfo getMessage(QName qname) {
+        return getMessages().get(qname);
     }
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java Fri Dec 29 02:05:41 2006
@@ -168,6 +168,9 @@
             OperationInfo op = itr.next();
 
             BindingOperationInfo boi = ep.getEndpointInfo().getBinding().getOperation(op);
+            if (boi == null) {
+                continue;
+            }
             BindingMessageInfo msgInfo = null;
             if (client) {
                 msgInfo = boi.getOutput();

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Fri Dec 29 02:05:41 2006
@@ -332,10 +332,12 @@
 
     }
 
+    @SuppressWarnings("unchecked")
     private void buildInterfaceOperation(InterfaceInfo inf, Operation op) {
         OperationInfo opInfo = inf.addOperation(new QName(inf.getName().getNamespaceURI(), op.getName()));
         opInfo.setProperty(WSDL_OPERATION, op);
-
+        opInfo.setParameterOrdering(op.getParameterOrdering());
+        
         Input input = op.getInput();
         List paramOrder = op.getParameterOrdering();
         if (input != null) {

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java Fri Dec 29 02:05:41 2006
@@ -65,7 +65,7 @@
 import org.easymock.classextension.IMocksControl;
 
 public class WSDLServiceBuilderTest extends TestCase {
-
+    // TODO: reuse the wsdl in testutils and add the parameter order into one of the wsdl
     private static final Logger LOG = Logger.getLogger(WSDLServiceBuilderTest.class.getName());
 
     private static final String WSDL_PATH = "hello_world.wsdl";
@@ -164,6 +164,8 @@
         assertFalse(sayHi.isOneWay());
         assertTrue(sayHi.hasInput());
         assertTrue(sayHi.hasOutput());
+        
+        assertNull(sayHi.getParameterOrdering());
 
         name = new QName(serviceInfo.getName().getNamespaceURI(), "greetMe");
         OperationInfo greetMe = serviceInfo.getInterface().getOperation(name);
@@ -424,5 +426,56 @@
             MessagePartInfo mpi = oi.getInput().getMessagePart(new QName(ns, "NewOperationRequest"));
             assertNotNull(mpi);                    
         }
+    }
+    
+    public void testParameterOrder() throws Exception {
+        String ns = "http://apache.org/hello_world_xml_http/bare";
+        setUpWSDL("/wsdl/hello_world_xml_bare.wsdl", 0);
+        
+        OperationInfo operation = serviceInfo.getInterface().getOperation(new QName(ns, 
+                                                                                    "testTriPart"));
+        assertNotNull(operation);
+        List<MessagePartInfo> parts = operation.getInput().getMessageParts();
+        assertNotNull(parts);
+        assertEquals(3, parts.size());
+        assertEquals("in1", parts.get(0).getName().getLocalPart());
+        assertEquals("in3", parts.get(1).getName().getLocalPart());
+        assertEquals("in2", parts.get(2).getName().getLocalPart());
+        
+        List<String> order = operation.getParameterOrdering();
+        assertNotNull(order);
+        assertEquals(3, order.size());
+        assertEquals("in1", order.get(0));
+        assertEquals("in3", order.get(1));
+        assertEquals("in2", order.get(2));
+        
+        parts = operation.getInput().getOrderedParts(order);
+        assertNotNull(parts);
+        assertEquals(3, parts.size());
+        assertEquals("in1", parts.get(0).getName().getLocalPart());
+        assertEquals("in3", parts.get(1).getName().getLocalPart());
+        assertEquals("in2", parts.get(2).getName().getLocalPart());
+        
+        operation = serviceInfo.getInterface().getOperation(new QName(ns,
+                                                                      "testTriPartNoOrder"));
+        assertNotNull(operation);
+        parts = operation.getInput().getMessageParts();
+        assertNotNull(parts);
+        assertEquals(3, parts.size());
+        assertEquals("in3", parts.get(0).getName().getLocalPart());
+        assertEquals("in1", parts.get(1).getName().getLocalPart());
+        assertEquals("in2", parts.get(2).getName().getLocalPart());        
+    }
+    
+    public void testParameterOrder2() throws Exception {
+        setUpWSDL("/wsdl/bug161/header2.wsdl", 0);
+        String ns = "http://apache.org/header2";
+        OperationInfo operation = serviceInfo.getInterface().getOperation(new QName(ns, "headerMethod"));
+        assertNotNull(operation);
+        List<MessagePartInfo> parts = operation.getInput().getMessageParts();
+        assertNotNull(parts);
+        assertEquals(2, parts.size());
+        assertEquals("header_info", parts.get(0).getName().getLocalPart());
+        assertEquals("the_request", parts.get(1).getName().getLocalPart());
     }
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java Fri Dec 29 02:05:41 2006
@@ -202,6 +202,21 @@
             assertNull(inoutHeader.value.getRequestType());
         }
     }
+    
+    public void testHeader4() {
+        URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl");
+        assertNotNull(wsdl);
+        
+        SOAPHeaderService service = new SOAPHeaderService(wsdl, serviceName);
+        assertNotNull(service);
+        proxy = service.getPort(portName, TestHeader.class);
+        try {
+            proxy.testHeader4("cxf");
+        } catch (Exception e) {
+            // REVISIT
+            // fail("No exception should happen in testHeader4");
+        }
+    }
 
     public static void main(String[] args) {
         junit.textui.TestRunner.run(HeaderClientServerTest.class);

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_xml_http/bare/GreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_xml_http/bare/GreeterImpl.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_xml_http/bare/GreeterImpl.java (original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_xml_http/bare/GreeterImpl.java Fri Dec 29 02:05:41 2006
@@ -51,4 +51,14 @@
         return "Bonjour";
     }
 
+    public String testTriPart(MyComplexStructType in1, String in3, String in2) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String testTriPartNoOrder(String in3, MyComplexStructType in1, String in2) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
 }

Modified: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_xml_bare.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_xml_bare.wsdl?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_xml_bare.wsdl (original)
+++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_xml_bare.wsdl Fri Dec 29 02:05:41 2006
@@ -75,7 +75,13 @@
     <wsdl:message name="multiParamPartResponse">
 	<wsdl:part element="x1:responseType" name="out1"/>
     </wsdl:message>
-
+    
+    <wsdl:message name="triPartRequest">
+	<wsdl:part element="x1:requestType" name="in3"/>
+	<wsdl:part element="x1:myComplexStruct" name="in1"/>
+	<wsdl:part element="x1:requestType" name="in2"/>
+    </wsdl:message>
+    
     <wsdl:portType name="Greeter">
 	<wsdl:operation name="sayHi">
 	    <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
@@ -91,6 +97,14 @@
 	</wsdl:operation>
 	<wsdl:operation name="testMultiParamPart" parameterOrder="in2 in1">
 	    <wsdl:input message="tns:multiParamPartRequest" name="multiParamPartRequest"/>
+	    <wsdl:output message="tns:multiParamPartResponse" name="multiParamPartResponse"/>
+	</wsdl:operation>
+	<wsdl:operation name="testTriPart" parameterOrder="in1 in3 in2">
+	    <wsdl:input message="tns:triPartRequest" name="triPartRequest"/>
+	    <wsdl:output message="tns:multiParamPartResponse" name="multiParamPartResponse"/>
+	</wsdl:operation>
+	<wsdl:operation name="testTriPartNoOrder">
+	    <wsdl:input message="tns:triPartRequest" name="triPartRequest"/>
 	    <wsdl:output message="tns:multiParamPartResponse" name="multiParamPartResponse"/>
 	</wsdl:operation>
     </wsdl:portType>

Added: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/Annotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/Annotator.java?view=auto&rev=490973
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/Annotator.java (added)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/Annotator.java Fri Dec 29 02:05:41 2006
@@ -0,0 +1,24 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.common.model;
+
+public interface Annotator {
+    // To indicator it is a annotation processor
+}

Propchange: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/Annotator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/Annotator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaAnnotation.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaAnnotation.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaAnnotation.java Fri Dec 29 02:05:41 2006
@@ -21,6 +21,8 @@
 
 import java.util.*;
 
+import org.apache.cxf.common.util.StringUtils;
+
 public class JavaAnnotation {
     private static final String DEFAULT_QUOTE  = "\"";
 
@@ -35,11 +37,17 @@
     }
 
     public void addArgument(String key, String value, String quote) {
-        arguments.put(key, quote + value + quote);
+        if (!StringUtils.isEmpty(value)) {
+            arguments.put(key, quote + value + quote);
+        }        
     }
     
     public void addArgument(String key, String value) {
         addArgument(key, value, DEFAULT_QUOTE);
+    }
+    
+    public Map<String, String> getArguments() {
+        return arguments;
     }
 
     public String toString() {

Added: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaCommon.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaCommon.java?view=auto&rev=490973
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaCommon.java (added)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaCommon.java Fri Dec 29 02:05:41 2006
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.common.model;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+public class JavaCommon {
+    private final Set<String> imports = new TreeSet<String>();
+
+    public void addImport(String i) {
+        imports.add(i);
+    }
+
+    public Set<String> getAllImport() {
+        return imports;
+    }
+}

Propchange: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaCommon.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaCommon.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java Fri Dec 29 02:05:41 2006
@@ -212,5 +212,8 @@
         this.bindingExt = pBindingExt;
     }
     
+    public void setJavaModel(JavaModel jm) {
+        this.model = jm;
+    }
     
 }

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java Fri Dec 29 02:05:41 2006
@@ -46,7 +46,7 @@
     private WSDLParameter requestParameter;
     private WSDLParameter responseParameter;
     private boolean wrapperStyle;
-    private final JavaInterface javaInterface;
+    private JavaInterface javaInterface;
     private final List<JavaParameter> parameters = new ArrayList<JavaParameter>();
     private final List<JavaException> exceptions = new ArrayList<JavaException>();
     private final Map<String, JavaAnnotation> annotations = new HashMap<String, JavaAnnotation>();
@@ -55,7 +55,8 @@
     private JAXWSBinding bindingExt = new JAXWSBinding();
 
     public JavaMethod() {
-        this.javaInterface = null;
+        this.javaInterface = new JavaInterface();
+        this.javaReturn = new JavaReturn();
     }
 
     public JavaMethod(JavaInterface i) {
@@ -64,7 +65,7 @@
 
     public void clear() {
         parameters.clear();
-        javaReturn = null;
+        javaReturn = new JavaReturn();
     }
 
     public String getSignature() {
@@ -334,5 +335,9 @@
 
     public void setBindingExt(JAXWSBinding pBindingExt) {
         this.bindingExt = pBindingExt;
+    }
+    
+    public void setInterface(JavaInterface intf) {
+        this.javaInterface = intf;
     }
 }

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java Fri Dec 29 02:05:41 2006
@@ -438,5 +438,26 @@
         } else if (!namespaces.values().contains(WSDLConstants.SOAP11_NAMESPACE)) {
             definition.addNamespace("soap", WSDLConstants.SOAP12_NAMESPACE);
         }
-    }    
+    }
+    
+    public static javax.jws.soap.SOAPBinding.Style getSoapStyle(String soapStyle) {
+        if ("".equals(soapStyle)) {
+            return null;
+        } else if ("RPC".equalsIgnoreCase(soapStyle)) {
+            return javax.jws.soap.SOAPBinding.Style.RPC;
+        } else {
+            return javax.jws.soap.SOAPBinding.Style.DOCUMENT;
+        }
+    }
+
+    public static javax.jws.soap.SOAPBinding.Use getSoapUse(String soapUse) {
+        if ("".equals(soapUse)) {
+            return null;
+        } else if ("ENCODED".equalsIgnoreCase(soapUse)) {
+            return javax.jws.soap.SOAPBinding.Use.ENCODED;
+        } else {
+            return javax.jws.soap.SOAPBinding.Use.LITERAL;
+        }
+    }
+    
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java Fri Dec 29 02:05:41 2006
@@ -77,6 +77,7 @@
         return BusFactoryHelper.newInstance().getDefaultBus();
     }
     
+    @SuppressWarnings("unchecked")
     public void execute(boolean exitOnFinish) throws ToolException {
         try {
             super.execute(exitOnFinish);
@@ -86,8 +87,6 @@
                 
                 FrontEndProfile frontend = context.get(FrontEndProfile.class);
                 
-                Processor processor = frontend.getProcessor();
-                
                 ToolConstants.WSDLVersion version = getWSDLVersion();
 
                 ServiceInfo service = null;
@@ -98,7 +97,11 @@
                     AbstractWSDLBuilder<Definition> builder =
                         (AbstractWSDLBuilder<Definition>) frontend.getWSDLBuilder();
                     Definition definition = builder.build(wsdlURL);
-                    builder.validate(definition);
+
+                    context.put(Definition.class, definition);
+                    if (context.optionSet(ToolConstants.CFG_VALIDATE_WSDL)) {
+                        builder.validate(definition);
+                    }
                     
                     if (context.optionSet(ToolConstants.CFG_BINDING)) {
                         builder.setContext(context);
@@ -116,6 +119,7 @@
 
                 // Build the JavaModel from the ServiceModel
                 context.put(ServiceInfo.class, service);
+                Processor processor = frontend.getProcessor();
                 processor.setEnvironment(context);
                 processor.process();
 
@@ -357,6 +361,6 @@
         if (passthrough()) {
             return;
         }
-        context.get(DataBindingProfile.class).generate();
+        context.get(DataBindingProfile.class).generate(context);
     }
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/DataBindingProfile.java Fri Dec 29 02:05:41 2006
@@ -21,17 +21,16 @@
 
 import java.util.List;
 
-import javax.wsdl.Part;
 import javax.xml.namespace.QName;
 
 import com.sun.tools.xjc.api.Property;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 
 public interface DataBindingProfile {
-    void initialize(ToolContext context) throws ToolException;
-    void generate() throws ToolException;
+    void generate(ToolContext context) throws ToolException;
     String getType(QName qn, boolean fullName);
     String getJavaType(QName qn, boolean boxify);
-    List<? extends Property> getBlock(Part part);
+    List<? extends Property> getBlock(MessagePartInfo part);
 }

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java?view=diff&rev=490973&r1=490972&r2=490973
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java Fri Dec 29 02:05:41 2006
@@ -19,15 +19,17 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor;
 
-import javax.wsdl.Definition;
-
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaModel;
-import org.apache.cxf.tools.wsdl2java.processor.internal.SEIAnnotationProcessor;
-import org.apache.cxf.tools.wsdl2java.processor.internal.ServiceProcessor;
 import org.apache.cxf.tools.wsdlto.core.WSDLToProcessor;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.PortTypeProcessor;
+//import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.SEIAnnotationProcessor;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.BindingAnnotator;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WebServiceAnnotator;
 
 public class WSDLToJavaProcessor extends WSDLToProcessor {
 
@@ -40,38 +42,32 @@
             Message msg = new Message("FAIL_TO_CREATE_JAVA_MODEL", LOG);
             throw new ToolException(msg);
         }
-
-        context.put(JavaModel.class, jmodel);
     }
 
     private JavaModel wsdlDefinitionToJavaModel(ServiceInfo serviceInfo) throws ToolException {
         JavaModel javaModel = new JavaModel();
-       /* getEnvironment().put(ToolConstants.RAW_JAXB_MODEL, getRawJaxbModel());*/
-
-        // TODO replace the definition with service model
+        context.put(JavaModel.class, javaModel);
 
         //javaModel.setJAXWSBinding(customizing(definition));
 
         // TODO refactroing the internal processors to use the service model
 
-        //Map<QName, PortType> portTypes = getPortTypes(definition);
-        //for (Iterator iter = portTypes.keySet().iterator(); iter.hasNext();) {
-        //PortType portType = (PortType)portTypes.get(iter.next());
-        //PortTypeProcessor portTypeProcessor = new PortTypeProcessor(getEnvironment());
-        //portTypeProcessor.process(javaModel, portType);
-        //}
+        PortTypeProcessor portTypeProcessor = new PortTypeProcessor(context);
+        portTypeProcessor.process(serviceInfo);
 
-        ServiceProcessor serviceProcessor = new ServiceProcessor(context, getWSDLDefinition());
-        serviceProcessor.process(javaModel);
+        ServiceProcessor serviceProcessor = new ServiceProcessor(context);
+        serviceProcessor.process(serviceInfo);
         
-        SEIAnnotationProcessor seiAnnotationProcessor = new SEIAnnotationProcessor(context);
-        seiAnnotationProcessor.process(javaModel, getWSDLDefinition());
-        return javaModel;
-    }
+        //         SEIAnnotationProcessor seiAnnotationProcessor = new SEIAnnotationProcessor(context);
+        //         seiAnnotationProcessor.process(serviceInfo);
+
+        JavaInterface intf = javaModel.getInterfaces().values().iterator().next();
+        new WebServiceAnnotator().annotate(intf);
+        if (serviceInfo.getBindings().size() > 0) {
+            new BindingAnnotator().annotate(intf);
+        }
 
-    private Definition getWSDLDefinition() {
-        // TODO remove this method after the refactoring of procesors were done
-        return null;
+        return javaModel;
     }
 
     // TODO replace the definition with service model

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/AbstractProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/AbstractProcessor.java?view=auto&rev=490973
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/AbstractProcessor.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/AbstractProcessor.java Fri Dec 29 02:05:41 2006
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal;
+
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.tools.common.ToolContext;
+
+public abstract class AbstractProcessor {
+    protected static final Logger LOG = LogUtils.getL7dLogger(AbstractProcessor.class);
+    protected ToolContext context;
+    
+    public AbstractProcessor(ToolContext c) {
+        this.context = c;
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/AbstractProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/AbstractProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java (from r490267, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java?view=diff&rev=490973&p1=incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java&r1=490267&p2=incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java&r2=490973
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java Fri Dec 29 02:05:41 2006
@@ -17,15 +17,13 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.wsdl2java.processor.internal;
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal;
 
 import java.util.Collection;
-import java.util.Map;
-
-import javax.wsdl.Fault;
-import javax.wsdl.Message;
-import javax.wsdl.Part;
+import java.util.List;
 
+import org.apache.cxf.service.model.FaultInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
@@ -34,33 +32,28 @@
 import org.apache.cxf.tools.common.model.JavaField;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaModel;
-import org.apache.cxf.tools.util.ProcessorUtil;
+import org.apache.cxf.tools.util.ClassCollector;
 
 public class FaultProcessor extends AbstractProcessor {
-
+    private ClassCollector  collector;
    
     public FaultProcessor(ToolContext penv) {
-      super(penv);
+        super(penv);
+        collector = penv.get(ClassCollector.class);
     }
 
-    public void process(JavaMethod method, Map<String, Fault> faults) throws ToolException {
+    public void process(JavaMethod method, Collection<FaultInfo> faults) throws ToolException {
         if (faults == null) {
             return;
         }
 
-        //Collection<Fault> faultsValue = faults.values();
-        java.util.Iterator<Fault> ite = faults.values().iterator();
-        while (ite.hasNext()) {
-            Fault fault = ite.next();
+        for (FaultInfo fault : faults) {
             processFault(method, fault);
         }
-        /*for (Fault fault : faultsValue) {
-            processFault(method, fault);
-        }*/
     }
 
     private boolean isNameCollision(String packageName, String className) {  
-        if (env.optionSet(ToolConstants.CFG_GEN_OVERWRITE)) {
+        if (context.optionSet(ToolConstants.CFG_GEN_OVERWRITE)) {
             return false;
         }
         boolean collision = collector.containTypesClass(packageName, className)
@@ -69,14 +62,12 @@
     }
 
     @SuppressWarnings("unchecked")
-    private void processFault(JavaMethod method, Fault fault) throws ToolException {
+    private void processFault(JavaMethod method, FaultInfo faultMessage) throws ToolException {
         JavaModel model = method.getInterface().getJavaModel();
-        Message faultMessage = fault.getMessage();
-        String name = ProcessorUtil.mangleNameToClassName(faultMessage.getQName().getLocalPart());
+        String name = ProcessorUtil.mangleNameToClassName(faultMessage.getName().getLocalPart());
         //Fix issue 305770
-        String namespace = faultMessage.getQName().getNamespaceURI();
-        //String namespace = method.getInterface().getNamespace();
-        String packageName = ProcessorUtil.parsePackageName(namespace, env.mapPackageName(namespace));
+        String namespace = faultMessage.getName().getNamespaceURI();
+        String packageName = ProcessorUtil.parsePackageName(namespace, context.mapPackageName(namespace));
 
         while (isNameCollision(packageName, name)) {
             name = name + "_Exception";
@@ -88,38 +79,25 @@
         boolean samePackage = method.getInterface().getPackageName().equals(packageName);
         method.addException(new JavaException(name, samePackage ? name : fullClassName, namespace));
         
-        Map<String, Part> faultParts = faultMessage.getParts();
-        Collection<Part> faultValues = faultParts.values();
+        List<MessagePartInfo> faultParts = faultMessage.getMessageParts();
         
         JavaExceptionClass expClass = new JavaExceptionClass(model);
         expClass.setName(name);
         expClass.setNamespace(namespace);
         expClass.setPackageName(packageName);
       
-        for (Part part : faultValues) {
-            String fName;
-            String fNamespace;
-            
-            if (part.getElementName() != null) {
-                fName = part.getElementName().getLocalPart();               
-                fNamespace = part.getElementName().getNamespaceURI();
-               
-                /*
-                 * org.apache.cxf.common.i18n.Message msg = new
-                 * org.apache.cxf.common.i18n.Message("WSDL_FAULT_MSG_PART_ELEMENT_MISSING_ERROR",
-                 * LOG, faultMessage, part.getName()); throw new
-                 * ToolException(msg);
-                 */
-
-            } else {
-                fName = part.getName();
-                fNamespace = part.getTypeName().getNamespaceURI();
-
+        for (MessagePartInfo part : faultParts) {
+            String fName = null;
+            String fNamespace = null;
+
+            if (part.getConcreteName() != null) {
+                fNamespace = part.getConcreteName().getNamespaceURI();
+                fName = part.getConcreteName().getLocalPart();
             }
             
-            String fType = ProcessorUtil.getType(part, env, false);
-            String fPackageName = ProcessorUtil.parsePackageName(fNamespace, env
-                                                                 .mapPackageName(fNamespace));
+            String fType = ProcessorUtil.getType(part, context, false);
+            String fPackageName = ProcessorUtil.parsePackageName(fNamespace,
+                                                                 context.mapPackageName(fNamespace));
             
             
 
@@ -127,11 +105,10 @@
             fField.setQName(ProcessorUtil.getElementName(part));
             
             if (!method.getInterface().getPackageName().equals(fPackageName)) {
-                fField.setClassName(ProcessorUtil.getFullClzName(part, 
-                                                                 env, this.collector, false));                
+                fField.setClassName(ProcessorUtil.getFullClzName(part, context, false));
             }
             if (!fType.equals(ProcessorUtil.resolvePartType(part))) {
-                fField.setClassName(ProcessorUtil.getType(part, env, true));
+                fField.setClassName(ProcessorUtil.getType(part, context, true));
             }
 
             expClass.addField(fField);

Copied: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java (from r490267, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java?view=diff&rev=490973&p1=incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java&r1=490267&p2=incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java&r2=490973
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java Fri Dec 29 02:05:41 2006
@@ -17,78 +17,59 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.wsdl2java.processor.internal;
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal;
 
-import java.util.HashMap;
+import java.util.Collection;
 import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
 import java.util.logging.Level;
 
-import javax.jws.soap.SOAPBinding;
-import javax.wsdl.Fault;
-import javax.wsdl.Message;
-import javax.wsdl.Operation;
-import javax.wsdl.OperationType;
-import javax.wsdl.Part;
-import javax.xml.namespace.QName;
-
-import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.service.model.FaultInfo;
+import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
-import org.apache.cxf.tools.common.extensions.jaxws.CustomizationParser;
-import org.apache.cxf.tools.common.extensions.jaxws.JAXWSBinding;
 import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaInterface;
 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.util.ProcessorUtil;
-import org.apache.cxf.tools.util.SOAPBindingUtil;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WebMethodAnnotator;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.mapper.MethodMapper;
 
 public class OperationProcessor  extends AbstractProcessor {
    
     private JavaParameter wrapperRequest;
     private JavaParameter wrapperResponse;
-
-    public OperationProcessor(ToolContext penv) {
-        super(penv);
+    private WebMethodAnnotator annotator;
+        
+    public OperationProcessor(ToolContext c) {
+        super(c);
+        annotator = new WebMethodAnnotator();
     }
 
     @SuppressWarnings("unchecked")
-    public void process(JavaInterface intf, Operation operation) throws ToolException {
-        JavaMethod method = new JavaMethod(intf);
-        // set default Document Bare style
-        method.setSoapStyle(javax.jws.soap.SOAPBinding.Style.DOCUMENT);
-
-        method.setName(ProcessorUtil.mangleNameToVariableName(operation.getName()));
-        method.setOperationName(operation.getName());
-        method.setStyle(operation.getStyle());
-        if (method.getStyle() == null) {
-            if (operation.getOutput() == null) {
-                method.setStyle(OperationType.ONE_WAY);
-            } else {
-                method.setStyle(OperationType.REQUEST_RESPONSE);
-            }
-        }
-
-        method.setWrapperStyle(isWrapperStyle(operation));
-        method.setJAXWSBinding(customizing(intf, operation));
+    public void process(JavaInterface intf, OperationInfo operation) throws ToolException {
+        JavaMethod method = new MethodMapper().map(operation);
+        method.setInterface(intf);
+        
+        // TODO: add customizing
+        // method.setJAXWSBinding(customizing(intf, operation));
+        
         processMethod(method, operation);
-        Map<String, Fault> faults = operation.getFaults();
+        Collection<FaultInfo> faults = operation.getFaults();
 
-        FaultProcessor faultProcessor = new FaultProcessor(env);
+        FaultProcessor faultProcessor = new FaultProcessor(context);
         faultProcessor.process(method, faults);
 
         intf.addMethod(method);
     }
 
     @SuppressWarnings("unchecked")
-    public void processMethod(JavaMethod method, Operation operation) throws ToolException {
-        List<String> parameterOrder = operation.getParameterOrdering();
-        Message inputMessage = operation.getInput() == null ? null : operation.getInput().getMessage();
-        Message outputMessage = operation.getOutput() == null ? null : operation.getOutput().getMessage();
+    public void processMethod(JavaMethod method, OperationInfo operation) throws ToolException {
+        MessageInfo inputMessage = operation.getInput();
+        MessageInfo outputMessage = operation.getOutput();
 
         if (inputMessage == null) {
             LOG.log(Level.WARNING, "NO_INPUT_MESSAGE", new Object[] {operation.getName()});
@@ -98,177 +79,32 @@
             throw new ToolException(msg);
         }
 
-        ParameterProcessor paramProcessor = new ParameterProcessor(env);
+        ParameterProcessor paramProcessor = new ParameterProcessor(context);
         method.clear();
-        paramProcessor.process(method, inputMessage, outputMessage, isRequestResponse(operation),
-                               parameterOrder);
-        isWrapperStyle(operation);
-        addWebMethodAnnotation(method);
-        addWrapperAnnotation(method, operation);
-        addWebResultAnnotation(method);
-        addSOAPBindingAnnotation(method);
-        if (!method.isOneWay() && method.getJAXWSBinding().isEnableAsyncMapping()) {
-            addAsyncMethod(method);
-        }
-    }
-
-    private void addSOAPBindingAnnotation(JavaMethod method) {
-        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT && !method.isWrapperStyle()) {
-            JavaAnnotation bindingAnnotation = new JavaAnnotation("SOAPBinding");
-            bindingAnnotation.addArgument("parameterStyle", SOAPBindingUtil.getBindingAnnotation("BARE"), "");
-            method.addAnnotation("SOAPBinding", bindingAnnotation);
-        }
-    }
-
-    private void addWebMethodAnnotation(JavaMethod method) {
-        addWebMethodAnnotation(method, method.getOperationName());
-    }
+        paramProcessor.process(method,
+                               inputMessage,
+                               outputMessage,
+                               operation.getParameterOrdering());
 
-    private void addWebMethodAnnotation(JavaMethod method, String operationName) {
-        JavaAnnotation methodAnnotation = new JavaAnnotation("WebMethod");
-        methodAnnotation.addArgument("operationName", operationName);
-        if (!StringUtils.isEmpty(method.getSoapAction())) {
-            methodAnnotation.addArgument("action", method.getSoapAction());
-        }
-        method.addAnnotation("WebMethod", methodAnnotation);
-        method.getInterface().addImport("javax.jws.WebMethod");
-    }
-
-    private void addWebResultAnnotation(JavaMethod method) {
-        if (method.isOneWay()) {
-            JavaAnnotation oneWayAnnotation = new JavaAnnotation("Oneway");
-            method.addAnnotation("Oneway", oneWayAnnotation);
-            method.getInterface().addImport("javax.jws.Oneway");
-            return;
-        }
-
-        if ("void".equals(method.getReturn().getType())) {
-            return;
-        }
-        JavaAnnotation resultAnnotation = new JavaAnnotation("WebResult");
-        String targetNamespace = method.getReturn().getTargetNamespace();
-        String name = "return";
-
-        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT && !method.isWrapperStyle()) {
-            name = method.getName() + "Response";
-        }
-
-        if (method.getSoapStyle() == SOAPBinding.Style.RPC) {
-            name = method.getReturn().getName();
-            targetNamespace = method.getInterface().getNamespace();
-           
-        }
-        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT) {
-            if (method.getReturn().getQName() != null) {
-                name = method.getReturn().getQName().getLocalPart();
-            }
-            targetNamespace = method.getReturn().getTargetNamespace();
-        }
-
-        resultAnnotation.addArgument("name", name);
-        resultAnnotation.addArgument("targetNamespace", targetNamespace);
-
-        if (method.getSoapStyle() == SOAPBinding.Style.RPC
-            || (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT && !method.isWrapperStyle())) {
-            resultAnnotation.addArgument("partName", method.getReturn().getName());
-        }
-
-        method.addAnnotation("WebResult", resultAnnotation);
-        method.getInterface().addImport("javax.jws.WebResult");
-    }
-
-    protected void addWrapperAnnotation(JavaMethod method, Operation operation) {
-        if (!isWrapperStyle(operation)) {
-            return;
-        }
-
-        if (wrapperRequest != null) {
-            JavaAnnotation wrapperRequestAnnotation = new JavaAnnotation("RequestWrapper");
-            wrapperRequestAnnotation.addArgument("localName", wrapperRequest.getType());
-            wrapperRequestAnnotation.addArgument("targetNamespace", wrapperRequest.getTargetNamespace());
-            wrapperRequestAnnotation.addArgument("className", wrapperRequest.getClassName());
-            method.addAnnotation("RequestWrapper", wrapperRequestAnnotation);
-            method.getInterface().addImport("javax.xml.ws.RequestWrapper");
+        annotator.addWebMethodAnnotation(method);
+        
+        if (!method.isWrapperStyle()) {
+            setWrapper(operation);
+            annotator.addWrapperAnnotation(method, wrapperRequest, wrapperResponse);
         }
-        if (wrapperResponse != null) {
-            JavaAnnotation wrapperResponseAnnotation = new JavaAnnotation("ResponseWrapper");
-            wrapperResponseAnnotation.addArgument("localName", wrapperResponse.getType());
-            wrapperResponseAnnotation.addArgument("targetNamespace", wrapperResponse.getTargetNamespace());
-            wrapperResponseAnnotation.addArgument("className", wrapperResponse.getClassName());
-            method.addAnnotation("ResponseWrapper", wrapperResponseAnnotation);
-            method.getInterface().addImport("javax.xml.ws.ResponseWrapper");
+        
+        annotator.addWebResultAnnotation(method);
+        annotator.addSOAPBindingAnnotation(method);
+        if (!method.isOneWay() && method.getJAXWSBinding().isEnableAsyncMapping()) {
+            addAsyncMethod(method);
         }
-
     }
 
-    @SuppressWarnings("unchecked")
-    private boolean isWrapperStyle(Operation operation) {
-
-        Message inputMessage = operation.getInput() == null ? null : operation.getInput().getMessage();
-        Message outputMessage = operation.getOutput() == null ? null : operation.getOutput().getMessage();
-
-        Map<String, Part> inputParts = new HashMap<String, Part>();
-        Map<String, Part> outputParts = new HashMap<String, Part>();
-
-        if (inputMessage != null) {
-            inputParts = inputMessage.getParts();
-        }
-        if (outputMessage != null) {
-            outputParts = outputMessage.getParts();
-        }
-
-        //
-        // RULE No.1:
-        // The operation's input and output message (if present) each contain
-        // only a single part
-        //
-        if (inputParts.size() > 1 || outputParts.size() > 1) {
-            return false;
-        }
 
-        //
-        // RULE No.2:
-        // The input message part refers to a global element decalration whose
-        // localname
-        // is equal to the operation name
-        //
-        Part inputPart = null;
-        if (inputParts.size() == 1) {
-            inputPart = inputParts.values().iterator().next();
-            if (inputPart != null) {
-                QName inputElement = inputPart.getElementName();
-                if (inputElement == null) {
-                    return false;
-                } else if (!operation.getName().equals(inputElement.getLocalPart())) {
-                    return false;
-                }
-            }
-        }
-        //
-        // RULE No.3:
-        // The output message part refers to a global element decalration
-        //
-        Part outputPart = null;
-        if (outputParts.size() == 1) {
-            outputPart = outputParts.values().iterator().next();
-            if (outputPart != null) {
-                QName outputElement = outputPart.getElementName();
-                if (outputElement == null) {
-                    return false;
-                }
-            }
-        }
-
-        //
-        // RULE No.4 and No5:
-        // wrapper element should be pure complex type
-        //
+    private void setWrapper(OperationInfo operation) {
+        MessagePartInfo inputPart = operation.getInput().getMessageParts().iterator().next();
+        MessagePartInfo outputPart = operation.getOutput().getMessageParts().iterator().next();
         
-        if (dataBinder.getBlock(inputPart) == null 
-            || dataBinder.getBlock(outputPart) == null) {
-            return false;
-        }
-
         if (inputPart != null) {
             wrapperRequest = new JavaParameter();
             wrapperRequest.setName(ProcessorUtil.resolvePartName(inputPart));
@@ -276,7 +112,7 @@
             wrapperRequest.setTargetNamespace(ProcessorUtil.resolvePartNamespace(inputPart));
 
             wrapperRequest.setClassName(ProcessorUtil.getFullClzName(inputPart, 
-                                                                     this.env, this.collector, false));
+                                                                     context, false));
 
         }
         if (outputPart != null) {
@@ -285,49 +121,40 @@
             wrapperResponse.setType(ProcessorUtil.getPartType(outputPart));
             wrapperResponse.setTargetNamespace(ProcessorUtil.resolvePartNamespace(outputPart));
 
-            wrapperResponse.setClassName(ProcessorUtil.getFullClzName(outputPart, 
-                                                                      this.env, this.collector, false));
-
+            wrapperResponse.setClassName(ProcessorUtil.getFullClzName(outputPart,
+                                                                      context, false));
         }
-
-        return true;
     }
 
-    private boolean isRequestResponse(Operation operation) {
-        if (operation.getStyle() == null) {
-            return operation.getOutput() != null;
-        }
-        return OperationType.REQUEST_RESPONSE.equals(operation.getStyle());
-    }
-
-    private JAXWSBinding customizing(JavaInterface intf, Operation operation) {
-        JAXWSBinding binding = null;
-        List extElements = operation.getExtensibilityElements();
-        if (extElements.size() > 0) {
-            Iterator iterator = extElements.iterator();
-            while (iterator.hasNext()) {
-                Object obj = iterator.next();
-                if (obj instanceof JAXWSBinding) {
-                    binding = (JAXWSBinding)obj;
-                }
-            }
-        } else {
-            String portTypeName = intf.getWebServiceName();
-            String operationName = operation.getName();
-            binding = CustomizationParser.getInstance().getPortTypeOperationExtension(portTypeName,
-                                                                                      operationName);
-        }
-
-        if (binding == null) {
-            binding = new JAXWSBinding();
-        }
-        if (!binding.isSetAsyncMapping()
-            && (intf.getJavaModel().getJAXWSBinding().isEnableAsyncMapping() || intf.getJAXWSBinding()
-                .isEnableAsyncMapping())) {
-            binding.setEnableAsyncMapping(true);
-        }
-        return binding;
-    }
+    // TODO: Add customizing
+//     private JAXWSBinding customizing(JavaInterface intf, Operation operation) {
+//         JAXWSBinding binding = null;
+//         List extElements = operation.getExtensibilityElements();
+//         if (extElements.size() > 0) {
+//             Iterator iterator = extElements.iterator();
+//             while (iterator.hasNext()) {
+//                 Object obj = iterator.next();
+//                 if (obj instanceof JAXWSBinding) {
+//                     binding = (JAXWSBinding)obj;
+//                 }
+//             }
+//         } else {
+//             String portTypeName = intf.getWebServiceName();
+//             String operationName = operation.getName();
+//             binding = CustomizationParser.getInstance().getPortTypeOperationExtension(portTypeName,
+//                                                                                       operationName);
+//         }
+
+//         if (binding == null) {
+//             binding = new JAXWSBinding();
+//         }
+//         if (!binding.isSetAsyncMapping()
+//             && (intf.getJavaModel().getJAXWSBinding().isEnableAsyncMapping() || intf.getJAXWSBinding()
+//                 .isEnableAsyncMapping())) {
+//             binding.setEnableAsyncMapping(true);
+//         }
+//         return binding;
+//     }
 
     private void addAsyncMethod(JavaMethod method) throws ToolException {
         addPollingMethod(method);
@@ -349,7 +176,7 @@
         future.setClassName("Future<?>");
         pollingMethod.setReturn(future);
 
-        addWebMethodAnnotation(pollingMethod, method.getOperationName());
+        annotator.addWebMethodAnnotation(pollingMethod, method.getOperationName());
         pollingMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
         pollingMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
         pollingMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));
@@ -382,7 +209,7 @@
         response.setClassName(getAsyncClassName(method, "Response"));
         callbackMethod.setReturn(response);
 
-        addWebMethodAnnotation(callbackMethod, method.getOperationName());
+        annotator.addWebMethodAnnotation(callbackMethod, method.getOperationName());
         callbackMethod.addAnnotation("RequestWrapper", method.getAnnotationMap().get("RequestWrapper"));
         callbackMethod.addAnnotation("ResponseWrapper", method.getAnnotationMap().get("ResponseWrapper"));
         callbackMethod.addAnnotation("SOAPBinding", method.getAnnotationMap().get("SOAPBinding"));



Mime
View raw message