You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by pe...@apache.org on 2006/11/07 04:17:01 UTC

svn commit: r471975 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/resource/ rt/bindings/soap/src/main...

Author: peterjones
Date: Mon Nov  6 19:16:59 2006
New Revision: 471975

URL: http://svn.apache.org/viewvc?view=rev&rev=471975
Log:
[CXF-184] some changes to account for parameter order of header parts

- Added a test to the HeaderClientServerTest systest for CXF-184
- Work-around for not resolving relative imports in certain circumstances
- Fixed problem with not deleting some temporary files
- Fixed some typos in comments and stuff

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
    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/MessagePartInfo.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/XmlSchemaURIResolver.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.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/interceptor/BareInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPRpcLitClientTypeTest.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java
    incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java Mon Nov  6 19:16:59 2006
@@ -203,6 +203,7 @@
         } else {
             tempFile = File.createTempFile("att", "tmp", outputDir);
         }
+        tempFile.deleteOnExit();
         currentStream = new BufferedOutputStream(new FileOutputStream(tempFile));
         currentStream.write(bytes);
         inmem = false;

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java Mon Nov  6 19:16:59 2006
@@ -57,11 +57,11 @@
      */
     void setConduit(Conduit conduit);
     
-
     /**
      * @return true if the exchange is known to be a one-way exchange
      */
     boolean isOneWay();
+
     /**
      * 
      * @param b true if the exchange is known to be a one-way exchange
@@ -69,15 +69,15 @@
     void setOneWay(boolean b);
     
     /**
-     * Convienience method for storing/retrieving typed objects from the map.
-     * equivilent to:  (T)get(key.getName());
+     * Convenience method for storing/retrieving typed objects from the map.
+     * equivalent to:  (T)get(key.getName());
      * @param <T> key
      * @return
      */
     <T> T get(Class<T> key);
     /**
-     * Convienience method for storing/retrieving typed objects from the map.
-     * equivilent to:  put(key.getName(), value);
+     * Convenience method for storing/retrieving typed objects from the map.
+     * equivalent to:  put(key.getName(), value);
      * @param <T> key
      * @return
      */

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java Mon Nov  6 19:16:59 2006
@@ -80,7 +80,7 @@
     String getAttachmentMimeType();
 
     /**
-     * Retreive the encapsulated content as a particular type (a result type
+     * Retrieve the encapsulated content as a particular type (a result type
      * if message is outbound, a source type if message is inbound)
      * 
      * @param format the expected content format 
@@ -103,15 +103,15 @@
     Set<Class<?>> getContentFormats();
     
     /**
-     * Convienience method for storing/retrieving typed objects from the map.
-     * equivilent to:  (T)get(key.getName());
+     * Convenience method for storing/retrieving typed objects from the map.
+     * equivalent to:  (T)get(key.getName());
      * @param <T> key
      * @return
      */
     <T> T get(Class<T> key);
     /**
-     * Convienience method for storing/retrieving typed objects from the map.
-     * equivilent to:  put(key.getName(), value);
+     * Convenience method for storing/retrieving typed objects from the map.
+     * equivalent to:  put(key.getName(), value);
      * @param <T> key
      * @return
      */

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=471975&r1=471974&r2=471975
==============================================================================
--- 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 Mon Nov  6 19:16:59 2006
@@ -59,7 +59,7 @@
     }
 
     /**
-     * Adds an message part to this conainer.
+     * Adds a message part to this container.
      *
      * @param name  the qualified name of the message part.
      * @param clazz the type of the message part.
@@ -78,7 +78,7 @@
                                         name));
     }    
     /**
-     * Adds an message part to this container.
+     * Adds a message part to this container.
      *
      * @param part the message part.
      */

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java Mon Nov  6 19:16:59 2006
@@ -33,7 +33,6 @@
     private boolean isElement;
     private QName typeName;
     private QName elementName;
-    private boolean isInSoapHeader;
     private XmlSchemaAnnotated xmlSchema;
     private Class<?> typeClass;
     
@@ -87,14 +86,6 @@
     
     public AbstractMessageContainer getMessageInfo() {
         return mInfo;
-    }
-
-    public boolean isInSoapHeader() {
-        return isInSoapHeader;
-    }
-
-    public void setInSoapHeader(boolean inSoapHeader) {
-        this.isInSoapHeader = inSoapHeader;
     }
 
     public XmlSchemaAnnotated getXmlSchema() {

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java Mon Nov  6 19:16:59 2006
@@ -290,7 +290,10 @@
     }
 
     public boolean isFile() {
-        return file.exists();
+        if (file != null) {
+            return file.exists();
+        }
+        return false;
     }
 
     public File getFile() {

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/XmlSchemaURIResolver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/XmlSchemaURIResolver.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/XmlSchemaURIResolver.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/XmlSchemaURIResolver.java Mon Nov  6 19:16:59 2006
@@ -48,6 +48,13 @@
             // move on...
         }
         if (resolver.isResolved()) {
+            if (resolver.getURI().isAbsolute()) {
+                // When importing a relative file,
+                // setSystemId with an absolute path so the
+                // resolver finds any files which that file
+                // imports with locations relative to it.
+                schemaLocation = resolver.getURI().toString();
+            }
             InputSource source = new InputSource(resolver.getInputStream());
             source.setSystemId(schemaLocation);
             return source;

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Mon Nov  6 19:16:59 2006
@@ -262,6 +262,8 @@
                     bmsg.addExtensor(headerInfo);
                 }
             }
+            // Exclude the header parts from the message part list.
+            bmsg.setMessageParts(messageParts);
         }
 
         SoapBodyInfo bodyInfo = new SoapBodyInfo();

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java Mon Nov  6 19:16:59 2006
@@ -104,7 +104,7 @@
                     p.getName().getLocalPart());
 
             if (!elName.getLocalPart().equals(name.getLocalPart())) {
-                String expMessage = "Parameter " + name + " does not equal to the name ["
+                String expMessage = "Parameter " + name + " is not equal to the name ["
                                     + elName.getLocalPart() + "] in the servicemodel!";
                 throw new SoapFault(expMessage, ((SoapMessage)message).getVersion().getSender());
             }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java Mon Nov  6 19:16:59 2006
@@ -94,7 +94,7 @@
                 }
             }
             xtw.writeEndElement();            
-            // Write Envelop end element
+            // Write Envelope end element
             xtw.writeEndElement();
             
             xtw.flush();
@@ -120,7 +120,7 @@
         if (bmi == null) {
             return;
         } else {
-            parts = bmi.getMessageParts();
+            parts = bmi.getMessageInfo().getMessageParts();
         } 
         if (parts.size() > 0) {
             List<?> objs = message.getContent(List.class);

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=471975&r1=471974&r2=471975
==============================================================================
--- 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 Mon Nov  6 19:16:59 2006
@@ -37,6 +37,7 @@
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -161,15 +162,17 @@
      */
     protected MessagePartInfo findMessagePart(Exchange exchange, Collection<OperationInfo> operations,
                                               QName name, boolean client, int index) {
+        Endpoint ep = exchange.get(Endpoint.class);
         MessagePartInfo lastChoice = null;
         for (Iterator<OperationInfo> itr = operations.iterator(); itr.hasNext();) {
             OperationInfo op = itr.next();
 
-            MessageInfo msgInfo = null;
+            BindingOperationInfo boi = ep.getEndpointInfo().getBinding().getOperation(op);
+            BindingMessageInfo msgInfo = null;
             if (client) {
-                msgInfo = op.getOutput();
+                msgInfo = boi.getOutput();
             } else {
-                msgInfo = op.getInput();
+                msgInfo = boi.getInput();
             }
 
             if (msgInfo == null) {
@@ -184,10 +187,7 @@
             }
 
             MessagePartInfo p = (MessagePartInfo)msgInfo.getMessageParts().get(index);
-
             if (name.equals(p.getConcreteName())) {
-                Endpoint ep = exchange.get(Endpoint.class);
-                BindingOperationInfo boi = ep.getEndpointInfo().getBinding().getOperation(op);
                 exchange.put(BindingOperationInfo.class, boi);
                 exchange.setOneWay(op.isOneWay());
                 return p;

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java Mon Nov  6 19:16:59 2006
@@ -36,8 +36,9 @@
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
-import org.apache.cxf.service.model.MessageInfo;
+//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.staxutils.DepthXMLStreamReader;
@@ -75,30 +76,44 @@
         Endpoint ep = exchange.get(Endpoint.class);
         Service service = ep.getService();
         BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
-        MessageInfo msgInfo = message.get(MessageInfo.class);
+        // XXX - Should the BindingMessageInfo.class be put on
+        // the message?
+        //MessageInfo msgInfo = message.get(MessageInfo.class);
+        BindingMessageInfo msgInfo = null;
+        
+        boolean client = isRequestor(message);
         
         Collection<OperationInfo> ops = null;
         if (bop == null) {
             ops = new ArrayList<OperationInfo>();
             ops.addAll(service.getServiceInfo().getInterface().getOperations());
         } else if (msgInfo == null) {
-            msgInfo = getMessageInfo(message, bop, exchange);
+            // XXX - Is the call to
+            // AbstractInDatabindingInterceptor.getMessageInfo()
+            // necessary?  Should we put the BindingMessageInfo on
+            // the message instead of the MessageInfo?
+            // msgInfo = getMessageInfo(message, bop, exchange);
+            getMessageInfo(message, bop, exchange);
+            if (client) {
+                msgInfo = bop.getOutput();
+            } else {
+                msgInfo = bop.getInput();
+            }
         }
         
-        boolean client = isRequestor(message);
-        
         int paramNum = 0;
         while (StaxUtils.toNextElement(xmlReader)) {
             QName elName = xmlReader.getName();
             Object o = null;
             
             MessagePartInfo p;
-            if (msgInfo != null) {
-                p = msgInfo.getMessagePartByIndex(paramNum);
+            if (msgInfo != null && msgInfo.getMessageParts() != null) {
+                assert msgInfo.getMessageParts().size() > paramNum;
+                p = msgInfo.getMessageParts().get(paramNum);
             } else {
                 p = findMessagePart(exchange, ops, elName, client, paramNum);
             }
-            
+
             if (p == null) {
                 throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", BUNDLE, elName));
             }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java Mon Nov  6 19:16:59 2006
@@ -34,7 +34,7 @@
         setPhase(Phase.MARSHAL);
     }
 
-    public void handleMessage(Message message) {      
+    public void handleMessage(Message message) {
         Exchange exchange = message.getExchange();
         BindingOperationInfo operation = (BindingOperationInfo)exchange.get(BindingOperationInfo.class
             .getName());
@@ -65,19 +65,18 @@
             if (objs != null) {
                 Object[] args = objs.toArray();
                 Object[] els = parts.toArray();
-                        
+
                 for (int idx = 0; idx < countParts; idx++) {
                     Object arg = args[idx];
                     MessagePartInfo part = (MessagePartInfo)els[idx];
                     if (part.getProperty(MessagePartInfo.KEY_SKIPPED) == null) {
-                        //this part should be in header, should donot write to soap body
+                        // not in header, write to soap body
                         dataWriter.write(arg, part, message);
-                    }                                        
+                    }
                 }
             }
         }
         message.getInterceptorChain().finishSubChain();
     }
-    
     
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java Mon Nov  6 19:16:59 2006
@@ -19,20 +19,26 @@
 
 package org.apache.cxf.jaxws;
 
-import java.lang.reflect.Array;
-import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.TreeSet;
 
 import javax.xml.ws.Holder;
 import javax.xml.ws.handler.MessageContext;
 
+import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.jaxws.context.WebServiceContextImpl;
 import org.apache.cxf.jaxws.support.ContextPropertiesMapping;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.service.invoker.BeanInvoker;
+import org.apache.cxf.service.model.BindingMessageInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
 
 public class JAXWSMethodInvoker extends BeanInvoker {
 
@@ -42,16 +48,26 @@
 
     @SuppressWarnings("unchecked")
     protected Object invoke(Exchange exchange, final Object serviceObject, Method m, List<Object> params) {
-        checkHolder(m, params, exchange);
-        //set up the webservcie request context 
+        BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
+        List<Object> orderedParams = params;
+        if (bop != null && bop.getInput() != null) {
+            orderedParams = getOrderedParamList(params, bop.getInput());
+        }
+        checkHolder(m, orderedParams, exchange);
+        // set up the webservice request context 
         MessageContext ctx = 
             ContextPropertiesMapping.createWebServiceContext(exchange);
         WebServiceContextImpl.setMessageContext(ctx);
         
-        List<Object> res = (List<Object>) super.invoke(exchange, serviceObject, m, params);
-        for (Object o : params) {
-            if (o instanceof Holder) {
-                res.add(((Holder) o).value);
+        List<Object> res = (List<Object>) super.invoke(exchange, serviceObject,
+            m, orderedParams);
+        if (bop != null && bop.getOutput() != null) {
+            getOrderedReturnList(res, orderedParams, bop.getOutput());
+        } else {
+            for (Object o : orderedParams) {
+                if (o instanceof Holder) {
+                    res.add(((Holder) o).value);
+                }
             }
         }
         //update the webservice response context
@@ -68,19 +84,6 @@
                 if (para[i] instanceof ParameterizedType) {
                     ParameterizedType paramType = (ParameterizedType)para[i];
                     if (((Class)paramType.getRawType()).getName().equals("javax.xml.ws.Holder")) {
-
-                        Object rawType = paramType.getActualTypeArguments()[0];
-                        Class rawClass = null;
-                        if (rawType instanceof GenericArrayType) {
-                            rawClass = (Class)((GenericArrayType)rawType).getGenericComponentType();
-                            rawClass = Array.newInstance(rawClass, 0).getClass();
-                        } else if (rawType instanceof Class) {
-                            rawClass = (Class)rawType;
-                        } else if (rawType instanceof ParameterizedType) {
-                            rawClass = (Class)((ParameterizedType)rawType).getRawType();
-                        }
-                        // param = new Holder((Class) rawClass);
-
                         if (i >= params.size()) {
                             params.add(new Holder());
                         } else {
@@ -91,4 +94,60 @@
             }
         }
     }
+    
+    private List<Object> getOrderedParamList(List<Object> params, BindingMessageInfo bmi) {
+        List<SoapHeaderInfo> headers = bmi.getExtensors(SoapHeaderInfo.class);
+        if (headers == null || headers.isEmpty()) {
+            return params;
+        }
+        List<Object> orderedParams = new ArrayList<Object>();
+        
+        // Add non-header params to the list first.
+        int headerIdx = params.size() - headers.size();
+        orderedParams.addAll(params.subList(0, headerIdx));
+        
+        Map<Integer, Object> headerParams = new TreeMap<Integer, Object>();
+        for (SoapHeaderInfo header : headers) {
+            headerParams.put(header.getSequence(), params.get(headerIdx));
+            headerIdx++;
+        }
+        // Insert the header params according to their wsdl message order.
+        for (Integer i : headerParams.keySet()) {
+            if (i.intValue() <= orderedParams.size()) {
+                orderedParams.add(i.intValue(), headerParams.get(i));
+            } else {
+                orderedParams.add(headerParams.get(i));
+            }
+        }
+
+        return orderedParams;
+    }
+
+    private void getOrderedReturnList(List<Object> res, List<Object> params, BindingMessageInfo bmi) {
+        List<SoapHeaderInfo> headers = bmi.getExtensors(SoapHeaderInfo.class);
+        int returnIdx = 0;
+        if (headers != null && !headers.isEmpty()) {
+            Collection<Integer> headerIndices = new TreeSet<Integer>();
+            for (SoapHeaderInfo header : headers) {
+                headerIndices.add(header.getSequence());
+            }
+            // XXX - Does this assume that the header parts in the IN message
+            // have the same order as in the out message?
+            for (Integer i : headerIndices) {
+                if (i.intValue() <= returnIdx && params.get(i) instanceof Holder) {
+                    res.add(i.intValue(), ((Holder) params.get(i.intValue())).value);
+                    returnIdx++;
+                } else {
+                    break;
+                }
+            }
+        }
+        for (int i = returnIdx; i < params.size(); i++) {
+            Object o = params.get(i);
+            if (o instanceof Holder) {
+                res.add(((Holder) o).value);
+            }
+        }
+    }
+
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java Mon Nov  6 19:16:59 2006
@@ -49,7 +49,7 @@
         if (boi == null) {
             return;
         }
-                
+               
         Method method = message.getExchange().get(Method.class);
 
         if (method != null && method.getName().endsWith("Async")) {
@@ -61,21 +61,10 @@
         }        
 
         
-        if (method != null && method.getName().endsWith("Async")) {
-            Class<?> retType = method.getReturnType();
-            if (retType.getName().equals("java.util.concurrent.Future") 
-                || retType.getName().equals("javax.xml.ws.Response")) {
-                return;
-            }
-
-        }
-      
-
-
         if (boi != null && boi.isUnwrappedCapable()) {
             BindingOperationInfo boi2 = boi.getUnwrappedOperation();
             
-            // Sometimes, an uperation can be unwrapped according to WSDLServiceFactory,
+            // Sometimes, an operation can be unwrapped according to WSDLServiceFactory,
             // but not according to JAX-WS. We should unify these at some point, but
             // for now check for the wrapper class.
             MessageInfo messageInfo = message.get(MessageInfo.class);
@@ -136,7 +125,7 @@
                 } else {
                     lst.clear();
                 }
-            }           
+            }
         }
     }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java Mon Nov  6 19:16:59 2006
@@ -30,8 +30,9 @@
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 
-// Do some context mapping work from rt-core to jaxws stander
-// NOTE if there some change in cxf Message property name, this class should be update
+// Do some context mapping work from rt-core to jaxws standard.
+// NOTE if there are changes in cxf Message property names, this
+// class should be updated.
 
 public final class ContextPropertiesMapping {    
     

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java Mon Nov  6 19:16:59 2006
@@ -119,7 +119,7 @@
 
         // rpc out-message-part-info class mapping
         Operation op = (Operation)o.getProperty(WSDLServiceBuilder.WSDL_OPERATION);
-        initalizeClassInfo(o, method, op == null ? null : op.getParameterOrdering());
+        initializeClassInfo(o, method, op == null ? null : op.getParameterOrdering());
 
     }
 
@@ -172,7 +172,7 @@
      * @param o
      * @param method
      */
-    protected void initalizeClassInfo(OperationInfo o, Method method, List<String> paramOrder) {
+    protected void initializeClassInfo(OperationInfo o, Method method, List<String> paramOrder) {
         if (isWrapped(method)) {
             if (o.hasInput()) {
                 MessageInfo input = o.getInput();
@@ -189,7 +189,7 @@
             setFaultClassInfo(o, method);
             o = o.getUnwrappedOperation();
         } else if (o.isUnwrappedCapable()) {
-            // remove the unrwrapped operation because it will break the
+            // remove the unwrapped operation because it will break the
             // the WrapperClassOutInterceptor, and in general makes
             // life more confusing
             o.setUnwrappedOperation(null);
@@ -197,7 +197,6 @@
             setFaultClassInfo(o, method);
         }
         
-        // Initialize return type
         Class<?>[] paramTypes = method.getParameterTypes(); 
         Type[] genericTypes = method.getGenericParameterTypes();
         for (int i = 0; i < paramTypes.length; i++) {
@@ -207,6 +206,7 @@
             initializeParameter(o, method, i, paramType, genericType);
         }
         
+        // Initialize return type
         Class paramType = method.getReturnType();
         Type genericType = method.getGenericReturnType();
         
@@ -226,33 +226,33 @@
         if (isIn && !isOut) {
             QName name = getInPartName(o, method, i);
             MessagePartInfo part = o.getInput().getMessagePart(name);
-            initializeParameter(part, paramType, genericType, i);
+            initializeParameter(part, paramType, genericType);
         } else if (!isIn && isOut) {
             QName name = getOutPartName(o, method, i);
             MessagePartInfo part = o.getOutput().getMessagePart(name);
-            initializeParameter(part, paramType, genericType, i);
+            initializeParameter(part, paramType, genericType);
         } else if (isIn && isOut) {
             QName name = getOutPartName(o, method, i);
             MessagePartInfo part = o.getInput().getMessagePart(name);
             part.setProperty(JaxWsServiceFactoryBean.MODE_INOUT, Boolean.TRUE);
-            initializeParameter(part, paramType, genericType, i);
+            initializeParameter(part, paramType, genericType);
             
             part = o.getOutput().getMessagePart(name);
             part.setProperty(JaxWsServiceFactoryBean.MODE_INOUT, Boolean.TRUE);
-            initializeParameter(part, paramType, genericType, i);
+            initializeParameter(part, paramType, genericType);
         }
     }
 
-    private void initializeParameter(MessagePartInfo part, Class rawClass, Type type, int i) {
+    private void initializeParameter(MessagePartInfo part, Class rawClass, Type type) {
         if (rawClass.equals(Holder.class) && type instanceof ParameterizedType) {
             ParameterizedType paramType = (ParameterizedType)type;
-            rawClass = getHolderClass(paramType, i);
+            rawClass = getHolderClass(paramType);
         }
         part.setProperty(GENERIC_TYPE, type);
         part.setTypeClass(rawClass);
     }
 
-    private static Class getHolderClass(ParameterizedType paramType, int idx) {
+    private static Class getHolderClass(ParameterizedType paramType) {
         Object rawType = paramType.getActualTypeArguments()[0];
         Class rawClass;
         if (rawType instanceof GenericArrayType) {
@@ -270,4 +270,4 @@
     public void setJaxWsConfiguration(JaxWsServiceConfiguration jaxWsConfiguration) {
         this.jaxWsConfiguration = jaxWsConfiguration;
     }
-}
\ No newline at end of file
+}

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java Mon Nov  6 19:16:59 2006
@@ -92,7 +92,7 @@
         if (paramNumber != -1) {
             String[] names = ParamReader.getParameterNamesFromDebugInfo(method);
 
-            // get the spcific parameter name from the parameter Number
+            // get the specific parameter name from the parameter Number
             if (names != null && names[paramNumber] != null) {
                 paramName = names[paramNumber];
                 addMethodName = false;

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java Mon Nov  6 19:16:59 2006
@@ -45,6 +45,8 @@
 import org.apache.header_test.types.TestHeader3;
 import org.apache.header_test.types.TestHeader3Response;
 import org.apache.header_test.types.TestHeader5;
+import org.apache.header_test.types.TestHeader6;
+import org.apache.header_test.types.TestHeader6Response;
 
 
 public class HeaderClientServerTest extends ClientServerTestBase {
@@ -90,9 +92,6 @@
                        
     }  
 
-    
-    
-     
     public void testInHeader() throws Exception {
         URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl");
         assertNotNull(wsdl);
@@ -197,6 +196,41 @@
         } 
     } 
     
+    public void testHeaderPartBeforeBodyPart() throws Exception {
+        URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl");
+        assertNotNull(wsdl);
+        
+        SOAPHeaderService service = new SOAPHeaderService(wsdl, serviceName);
+        assertNotNull(service);
+        proxy = service.getPort(portName, TestHeader.class);
+        
+        try {
+            TestHeader6 in = new TestHeader6();
+            String val = new String(TestHeader6.class.getSimpleName());
+            Holder<TestHeader3> inoutHeader = new Holder<TestHeader3>();
+            for (int idx = 0; idx < 2; idx++) {
+                val += idx;                
+                in.setRequestType(val);
+                inoutHeader.value = new TestHeader3();
+                TestHeader6Response returnVal = proxy.testHeaderPartBeforeBodyPart(inoutHeader, in);
+                //inoutHeader copied to return
+                //in copied to inoutHeader
+                assertNotNull(returnVal);
+                assertNull(returnVal.getResponseType());
+                assertEquals(val, inoutHeader.value.getRequestType());
+                
+                in.setRequestType(null);
+                inoutHeader.value.setRequestType(val);
+                returnVal = proxy.testHeaderPartBeforeBodyPart(inoutHeader, in);
+                assertNotNull(returnVal);
+                assertEquals(val, returnVal.getResponseType());
+                assertNull(inoutHeader.value.getRequestType());
+            }
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        } 
+    }
+
     public static void main(String[] args) {
         junit.textui.TestRunner.run(HeaderClientServerTest.class);
     }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java Mon Nov  6 19:16:59 2006
@@ -34,9 +34,9 @@
 import org.apache.type_test.types2.StructWithAnyStrict;
 
 public class SOAPDocLitClientTypeTest extends AbstractTypeTestClient5 {
-    static final String WSDL_PATH = "/wsdl/type_test/type_test_doclit_soap.wsdl";
-    static final QName SERVICE_NAME = new QName("http://apache.org/type_test/doc", "SOAPService");
-    static final QName PORT_NAME = new QName("http://apache.org/type_test/doc", "SOAPPort");
+    protected static final String WSDL_PATH = "/wsdl/type_test/type_test_doclit_soap.wsdl";
+    protected static final QName SERVICE_NAME = new QName("http://apache.org/type_test/doc", "SOAPService");
+    protected static final QName PORT_NAME = new QName("http://apache.org/type_test/doc", "SOAPPort");
 
     public SOAPDocLitClientTypeTest(String name) {
         super(name);

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPRpcLitClientTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPRpcLitClientTypeTest.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPRpcLitClientTypeTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPRpcLitClientTypeTest.java Mon Nov  6 19:16:59 2006
@@ -34,11 +34,11 @@
 import org.apache.type_test.types2.StructWithAnyStrict;
 
 public class SOAPRpcLitClientTypeTest extends AbstractTypeTestClient5 {
-    static final String WSDL_PATH = "/wsdl/type_test/type_test_rpclit_soap.wsdl";
+    protected static final String WSDL_PATH = "/wsdl/type_test/type_test_rpclit_soap.wsdl";
 
-    static final QName SERVICE_NAME = new QName("http://apache.org/type_test/rpc", "SOAPService");
+    protected static final QName SERVICE_NAME = new QName("http://apache.org/type_test/rpc", "SOAPService");
 
-    static final QName PORT_NAME = new QName("http://apache.org/type_test/rpc", "SOAPPort");
+    protected static final QName PORT_NAME = new QName("http://apache.org/type_test/rpc", "SOAPPort");
 
     public SOAPRpcLitClientTypeTest(String name) {
         super(name);

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java (original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java Mon Nov  6 19:16:59 2006
@@ -29,6 +29,8 @@
 import org.apache.header_test.types.TestHeader3;
 import org.apache.header_test.types.TestHeader3Response;
 import org.apache.header_test.types.TestHeader5;
+import org.apache.header_test.types.TestHeader6;
+import org.apache.header_test.types.TestHeader6Response;
 
 
 @WebService(serviceName = "SOAPHeaderService", 
@@ -97,4 +99,18 @@
         return in;
     }
     
+    public TestHeader6Response testHeaderPartBeforeBodyPart(
+        Holder<TestHeader3> inoutHeader,
+        TestHeader6 in) {
+        
+        if (inoutHeader.value == null) {
+            throw new IllegalArgumentException("TestHeader3 part not found.");
+        }
+        TestHeader6Response returnVal = new TestHeader6Response();
+        returnVal.setResponseType(inoutHeader.value.getRequestType());
+        
+        inoutHeader.value.setRequestType(in.getRequestType());
+        return returnVal;
+    }
+
 }

Modified: incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl (original)
+++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl Mon Nov  6 19:16:59 2006
@@ -82,6 +82,20 @@
                     </sequence>
                 </complexType>
             </element>
+            <element name="testHeader6">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" nillable="true" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="testHeader6Response">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" nillable="true" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
         </schema>
     </wsdl:types>
     <wsdl:message name="testHeader1Request">
@@ -118,6 +132,14 @@
     <wsdl:message name="testHeader5Response">
         <wsdl:part name="outHeader" element="x1:testHeader5"/>
     </wsdl:message>
+    <wsdl:message name="testHeaderPartBeforeBodyPart">
+        <wsdl:part name="inoutHeader" element="x1:testHeader3"/>
+        <wsdl:part name="in" element="x1:testHeader6"/>
+    </wsdl:message>
+    <wsdl:message name="testHeaderPartBeforeBodyPartResponse">
+        <wsdl:part name="inoutHeader" element="x1:testHeader3"/>
+        <wsdl:part name="out" element="x1:testHeader6Response"/>
+    </wsdl:message>
     <wsdl:message name="testHeaderMessage">
         <wsdl:part name="inoutHeader" element="x1:testHeaderMessage"/>
     </wsdl:message>
@@ -142,6 +164,12 @@
             <wsdl:input name="testHeader5Request" message="tns:testHeader5Request"/>
             <wsdl:output name="testHeader5Response" message="tns:testHeader5Response"/>
         </wsdl:operation>
+        <wsdl:operation name="testHeaderPartBeforeBodyPart" parameterOrder="inoutHeader in">
+            <wsdl:input name="testHeaderPartBeforeBodyPart" 
+                message="tns:testHeaderPartBeforeBodyPart"/>
+            <wsdl:output name="testHeaderPartBeforeBodyPartResponse" 
+                message="tns:testHeaderPartBeforeBodyPartResponse"/>
+        </wsdl:operation>
     </wsdl:portType>
     <wsdl:binding name="TestHeader_SOAPBinding" type="tns:TestHeader">
         <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
@@ -195,6 +223,19 @@
             <wsdl:output>
                 <soap:body parts="" use="literal"/>
                 <soap:header message="tns:testHeader5Response" part="outHeader" use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="testHeaderPartBeforeBodyPart">
+            <soap:operation style="document"/>
+            <wsdl:input>
+                <soap:body parts="in" use="literal"/>
+                <soap:header message="tns:testHeaderPartBeforeBodyPart" 
+                    part="inoutHeader" use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body parts="out" use="literal"/>
+                <soap:header message="tns:testHeaderPartBeforeBodyPartResponse" 
+                    part="inoutHeader" use="literal"/>
             </wsdl:output>
         </wsdl:operation>
     </wsdl:binding>

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java?view=diff&rev=471975&r1=471974&r2=471975
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java Mon Nov  6 19:16:59 2006
@@ -200,6 +200,7 @@
         File file = null;
         try {
             file = File.createTempFile(xsdFile, ".xsd");
+            file.deleteOnExit();
         } catch (IOException e) {
             e.printStackTrace();
         }



Re: svn commit: r471975 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/resource/ rt/bindings/soap/src/main...

Posted by Dan Diephouse <da...@envoisolutions.com>.
Sure, but just want to say that people should still be cleaning up there 
files. I think the best solution is to support streaming attachments 
directly. And then if an attachment is saved, the user should be 
responsible for cleaning up and deleting the files.

- Dan

Daniel Kulp wrote:

>Another option might be to create a single "temporary directory" where all 
>the temp files are dumped.  We can register a single exit hook that 
>cleans up the entire directory.   
>
>Dan
>
>On Thursday November 09 2006 9:42 am, Peter Jones wrote:
>  
>
>>Hi John,
>>
>>On Thu, Nov 09, 2006 at 10:31:40AM +1100, John Sisson wrote:
>>    
>>
>>>FYI, deleteOnExit is known to consume memory that can lead to running
>>>out of memory on a long running JVM.  See
>>>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513817
>>>      
>>>
>>Thanks for pointing this out, I should have considered that.  PerhapsDan
>>we should do something about the file when the output stream is closed,
>>or it might be best to just rely on the caller ensuring the clean up
>>happens as Dan mentioned.
>>
>>Cheers,
>>Peter
>>
>>    
>>
>>>Regards,
>>>John
>>>
>>>Dan Diephouse wrote:
>>>      
>>>
>>>>Hiya Peter,
>>>>
>>>>Clean up looked good, just wanted to add two comments for the
>>>>general populace:
>>>>- I think people using attachments should clean up after
>>>>themselves. I'm not sure that we want to do file.deleteOnExit() -
>>>>what if the user just moves the file to a different location and
>>>>they want to keep it around as a saved attachment? this is probably
>>>>ok as a workaround for now though...
>>>>- It would be best if we streamed attachments directly off the
>>>>wire. This would remove our need to write an attachment to disk...
>>>>
>>>>- Dan
>>>>
>>>>peterjones@apache.org wrote:
>>>>        
>>>>
>>>>>Author: peterjones
>>>>>Date: Mon Nov  6 19:16:59 2006
>>>>>New Revision: 471975
>>>>>
>>>>>URL: http://svn.apache.org/viewvc?view=rev&rev=471975
>>>>>Log:
>>>>>[CXF-184] some changes to account for parameter order of header
>>>>>parts
>>>>>
>>>>>- Added a test to the HeaderClientServerTest systest for CXF-184
>>>>>- Work-around for not resolving relative imports in certain
>>>>>circumstances
>>>>>- Fixed problem with not deleting some temporary files
>>>>>- Fixed some typos in comments and stuff
>>>>>
>>>>>Modified:
>>>>>
>>>>>incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCa
>>>>>chedOutputStream.java [...]
>>>>>
>>>>>URL:
>>>>>http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java
>>>>>/org/apache/cxf/io/AbstractCachedOutputStream.java?view=diff&rev=47
>>>>>1975&r1=471974&r2=471975
>>>>>          
>>>>>
>
>  
>


-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com


Re: svn commit: r471975 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/resource/ rt/bindings/soap/src/main...

Posted by Daniel Kulp <da...@iona.com>.
Another option might be to create a single "temporary directory" where all 
the temp files are dumped.  We can register a single exit hook that 
cleans up the entire directory.   

Dan

On Thursday November 09 2006 9:42 am, Peter Jones wrote:
> Hi John,
>
> On Thu, Nov 09, 2006 at 10:31:40AM +1100, John Sisson wrote:
> > FYI, deleteOnExit is known to consume memory that can lead to running
> > out of memory on a long running JVM.  See
> > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513817
>
> Thanks for pointing this out, I should have considered that.  PerhapsDan
> we should do something about the file when the output stream is closed,
> or it might be best to just rely on the caller ensuring the clean up
> happens as Dan mentioned.
>
> Cheers,
> Peter
>
> > Regards,
> > John
> >
> > Dan Diephouse wrote:
> > > Hiya Peter,
> > >
> > > Clean up looked good, just wanted to add two comments for the
> > > general populace:
> > > - I think people using attachments should clean up after
> > > themselves. I'm not sure that we want to do file.deleteOnExit() -
> > > what if the user just moves the file to a different location and
> > > they want to keep it around as a saved attachment? this is probably
> > > ok as a workaround for now though...
> > > - It would be best if we streamed attachments directly off the
> > > wire. This would remove our need to write an attachment to disk...
> > >
> > > - Dan
> > >
> > > peterjones@apache.org wrote:
> > >> Author: peterjones
> > >> Date: Mon Nov  6 19:16:59 2006
> > >> New Revision: 471975
> > >>
> > >> URL: http://svn.apache.org/viewvc?view=rev&rev=471975
> > >> Log:
> > >> [CXF-184] some changes to account for parameter order of header
> > >> parts
> > >>
> > >> - Added a test to the HeaderClientServerTest systest for CXF-184
> > >> - Work-around for not resolving relative imports in certain
> > >> circumstances
> > >> - Fixed problem with not deleting some temporary files
> > >> - Fixed some typos in comments and stuff
> > >>
> > >> Modified:
> > >>
> > >> incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCa
> > >>chedOutputStream.java [...]
> > >>
> > >> URL:
> > >> http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java
> > >>/org/apache/cxf/io/AbstractCachedOutputStream.java?view=diff&rev=47
> > >>1975&r1=471974&r2=471975

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194   F:781-902-8001
daniel.kulp@iona.com

Re: svn commit: r471975 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/resource/ rt/bindings/soap/src/main...

Posted by Peter Jones <pe...@iona.com>.
Hi John,

On Thu, Nov 09, 2006 at 10:31:40AM +1100, John Sisson wrote:
> FYI, deleteOnExit is known to consume memory that can lead to running 
> out of memory on a long running JVM.  See 
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513817

Thanks for pointing this out, I should have considered that.  Perhaps
we should do something about the file when the output stream is closed,
or it might be best to just rely on the caller ensuring the clean up
happens as Dan mentioned.

Cheers,
Peter

> Regards,
> John
> 
> Dan Diephouse wrote:
> > Hiya Peter,
> >
> > Clean up looked good, just wanted to add two comments for the general 
> > populace:
> > - I think people using attachments should clean up after themselves. 
> > I'm not sure that we want to do file.deleteOnExit() - what if the user 
> > just moves the file to a different location and they want to keep it 
> > around as a saved attachment? this is probably ok as a workaround for 
> > now though...
> > - It would be best if we streamed attachments directly off the wire. 
> > This would remove our need to write an attachment to disk...
> >
> > - Dan
> >
> > peterjones@apache.org wrote:
> >
> >> Author: peterjones
> >> Date: Mon Nov  6 19:16:59 2006
> >> New Revision: 471975
> >>
> >> URL: http://svn.apache.org/viewvc?view=rev&rev=471975
> >> Log:
> >> [CXF-184] some changes to account for parameter order of header parts
> >>
> >> - Added a test to the HeaderClientServerTest systest for CXF-184
> >> - Work-around for not resolving relative imports in certain 
> >> circumstances
> >> - Fixed problem with not deleting some temporary files
> >> - Fixed some typos in comments and stuff
> >>
> >> Modified:
> >>    
> >> incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java 
> >> [...]
> >>
> >> URL: 
> >> http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java?view=diff&rev=471975&r1=471974&r2=471975 

-- 
Peter Jones
IONA Technologies Inc.
E-Mail: mailto:peter.jones@iona.com
Tel: (w) 709-738-3725 x22 | Fax: 709-738-3745
84-86 Elizabeth Ave. St. John's, NL A1A 1W7 Canada

Re: svn commit: r471975 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/resource/ rt/bindings/soap/src/main...

Posted by John Sisson <jr...@gmail.com>.
FYI, deleteOnExit is known to consume memory that can lead to running 
out of memory on a long running JVM.  See 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513817

Regards,
John

Dan Diephouse wrote:
> Hiya Peter,
>
> Clean up looked good, just wanted to add two comments for the general 
> populace:
> - I think people using attachments should clean up after themselves. 
> I'm not sure that we want to do file.deleteOnExit() - what if the user 
> just moves the file to a different location and they want to keep it 
> around as a saved attachment? this is probably ok as a workaround for 
> now though...
> - It would be best if we streamed attachments directly off the wire. 
> This would remove our need to write an attachment to disk...
>
> - Dan
>
> peterjones@apache.org wrote:
>
>> Author: peterjones
>> Date: Mon Nov  6 19:16:59 2006
>> New Revision: 471975
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=471975
>> Log:
>> [CXF-184] some changes to account for parameter order of header parts
>>
>> - Added a test to the HeaderClientServerTest systest for CXF-184
>> - Work-around for not resolving relative imports in certain 
>> circumstances
>> - Fixed problem with not deleting some temporary files
>> - Fixed some typos in comments and stuff
>>
>> Modified:
>>    
>> incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java 
>>
>>    
>> incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java 
>>
>>    
>> incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java 
>>
>>    
>> 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/MessagePartInfo.java 
>>
>>    
>> incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java 
>>
>>    
>> incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/XmlSchemaURIResolver.java 
>>
>>    
>> incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java 
>>
>>    
>> incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java 
>>
>>    
>> incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.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/interceptor/BareInInterceptor.java 
>>
>>    
>> incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java 
>>
>>    
>> incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java 
>>
>>    
>> incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java 
>>
>>    
>> incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java 
>>
>>    
>> incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java 
>>
>>    
>> incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java 
>>
>>    
>> incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java 
>>
>>    
>> incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java 
>>
>>    
>> incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPRpcLitClientTypeTest.java 
>>
>>    
>> incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java 
>>
>>    incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl
>>    
>> incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java 
>>
>>
>> Modified: 
>> incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java?view=diff&rev=471975&r1=471974&r2=471975 
>>
>>  
>>
>


Re: svn commit: r471975 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/resource/ rt/bindings/soap/src/main...

Posted by Dan Diephouse <da...@envoisolutions.com>.
Hiya Peter,

Clean up looked good, just wanted to add two comments for the general 
populace:
- I think people using attachments should clean up after themselves. I'm 
not sure that we want to do file.deleteOnExit() - what if the user just 
moves the file to a different location and they want to keep it around 
as a saved attachment? this is probably ok as a workaround for now 
though...
- It would be best if we streamed attachments directly off the wire. 
This would remove our need to write an attachment to disk...

- Dan

peterjones@apache.org wrote:

>Author: peterjones
>Date: Mon Nov  6 19:16:59 2006
>New Revision: 471975
>
>URL: http://svn.apache.org/viewvc?view=rev&rev=471975
>Log:
>[CXF-184] some changes to account for parameter order of header parts
>
>- Added a test to the HeaderClientServerTest systest for CXF-184
>- Work-around for not resolving relative imports in certain circumstances
>- Fixed problem with not deleting some temporary files
>- Fixed some typos in comments and stuff
>
>Modified:
>    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java
>    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Exchange.java
>    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
>    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/MessagePartInfo.java
>    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
>    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/XmlSchemaURIResolver.java
>    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
>    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
>    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.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/interceptor/BareInInterceptor.java
>    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
>    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
>    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
>    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
>    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
>    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
>    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java
>    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPDocLitClientTypeTest.java
>    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/soap/SOAPRpcLitClientTypeTest.java
>    incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java
>    incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl
>    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java
>
>Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java
>URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/io/AbstractCachedOutputStream.java?view=diff&rev=471975&r1=471974&r2=471975
>  
>

-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com