cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r614186 [1/2] - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/databinding/ api/src/main/java/org/apache/cxf/message/ rt/core/src/main/java/org/apache/cxf/databinding/source/ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/...
Date Tue, 22 Jan 2008 12:13:25 GMT
Author: bimargulies
Date: Tue Jan 22 04:13:22 2008
New Revision: 614186

URL: http://svn.apache.org/viewvc?rev=614186&view=rev
Log:
Fix the interaction of @MTOM and servers, so that it works for jaxws:server as well as jaxws:endpoint (cxf-1400). Make the threshold travel down to the jaxb attachment code (cxf-1401). Fix some spelling errors in the names of things. Push toward generating JavaScript that can process text/plain attachments via MTOM.

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBinding.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/Message.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBase.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperClassGeneratorTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomParser.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/MtoMTest.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/MtoM.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/MtoMImpl.java
    incubator/cxf/trunk/rt/javascript/src/test/resources/MtoMBeans.xml
    incubator/cxf/trunk/rt/javascript/src/test/resources/deserializationTests.js
    incubator/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/MtoMTests.js
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addr_disable/WSADisableTest.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java Tue Jan 22 04:13:22 2008
@@ -25,11 +25,18 @@
  * Supply default implementations, as appropriate, for DataBinding. 
  */
 public abstract class AbstractDataBinding implements DataBinding {
+    protected int mtomThreshold;
 
     /** {@inheritDoc}*/
     public Map<String, String> getDeclaredNamespaceMappings() {
         return null;
     }
 
+    public int getMtomThreshold() {
+        return mtomThreshold;
+    }
 
+    public void setMtomThreshold(int threshold) {
+        mtomThreshold = threshold;
+    }
 }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBinding.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBinding.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBinding.java Tue Jan 22 04:13:22 2008
@@ -46,5 +46,13 @@
      * @return the map, or null if there are none.
      */
     Map<String, String> getDeclaredNamespaceMappings();
+    
+    /**
+     * If the binding supports MTOM, set the size threshold for its use.
+     * may be overridden by (e.g.) JAXWS configuration.
+     * @param threshold
+     */
+    void setMtomThreshold(int threshold);
+    int getMtomThreshold();
 
 }

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?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- 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 Tue Jan 22 04:13:22 2008
@@ -48,6 +48,7 @@
     String PATH_INFO = Message.class.getName() + ".PATH_INFO";
     String QUERY_STRING = Message.class.getName() + ".QUERY_STRING";
     String MTOM_ENABLED = "mtom-enabled";
+    String MTOM_THRESHOLD = "mtom-threshold";
     String SCHEMA_VALIDATION_ENABLED = "schema-validation-enabled";
     String FAULT_STACKTRACE_ENABLED = "faultStackTraceEnabled";
     String CONTENT_TYPE = "Content-Type";    

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java Tue Jan 22 04:13:22 2008
@@ -33,13 +33,15 @@
 
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
+import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.ws.commons.schema.XmlSchema;
 
-public class AbstractDataBinding {
+public abstract class AbstractDataBinding implements DataBinding {
     private Collection<DOMSource> schemas;
     private Map<String, String> namespaceMap;
+    private int mtomThreshold;
 
     public Collection<DOMSource> getSchemas() {
         return schemas;
@@ -116,5 +118,13 @@
                 }
             }
         }
+    }
+
+    public int getMtomThreshold() {
+        return mtomThreshold;
+    }
+
+    public void setMtomThreshold(int threshold) {
+        mtomThreshold = threshold;
     }
 }

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBase.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBase.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBase.java Tue Jan 22 04:13:22 2008
@@ -45,9 +45,8 @@
     protected JAXBContext context; 
     protected Schema schema;
     protected Collection<Attachment> attachments;
-    protected boolean attachmentProcessingEnabled;
     protected boolean unwrapJAXBElement = true;
- 
+    protected Integer mtomThreshold; // null if we should default.
     
     protected JAXBDataBase(JAXBContext ctx) {
         context = ctx;
@@ -81,7 +80,7 @@
     }
 
     protected AttachmentMarshaller getAttachmentMarshaller() {
-        return new JAXBAttachmentMarshaller(attachments);
+        return new JAXBAttachmentMarshaller(attachments, mtomThreshold);
     }
     
     public void setProperty(String prop, Object value) {
@@ -90,7 +89,7 @@
         }
     }
     
-    protected Annotation[] getJAXBAnnotion(MessagePartInfo mpi) {
+    protected Annotation[] getJAXBAnnotation(MessagePartInfo mpi) {
         List<Annotation> annoList = new java.util.concurrent.CopyOnWriteArrayList<Annotation>();
         
         if (mpi != null && mpi.getProperty("parameter.annotations") != null) {
@@ -117,6 +116,14 @@
             
         }
         return annoList.toArray(new Annotation[]{});       
+    }
+
+    public Integer getMtomThreshold() {
+        return mtomThreshold;
+    }
+
+    public void setMtomThreshold(Integer threshold) {
+        this.mtomThreshold = threshold;
     }
     
     

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java Tue Jan 22 04:13:22 2008
@@ -62,7 +62,6 @@
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
-import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.databinding.source.AbstractDataBinding;
@@ -73,13 +72,14 @@
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.ws.addressing.ObjectFactory;
 
-public final class JAXBDataBinding extends AbstractDataBinding implements DataBinding {
+public final class JAXBDataBinding extends AbstractDataBinding {
     public static final String SCHEMA_RESOURCE = "SCHEMRESOURCE";
+    public static final String MTOM_THRESHOLD = "org.apache.cxf.jaxb.mtomThreshold";
     
     public static final String UNWRAP_JAXB_ELEMENT = "unwrap.jaxb.element";
     
     public static final String USE_JAXB_BRIDGE = "use.jaxb.bridge";
-
+    
     private static final Logger LOG = LogUtils.getLogger(JAXBDataBinding.class);
 
 
@@ -90,7 +90,7 @@
                                                                                Node.class,
                                                                                XMLEventWriter.class,
                                                                                XMLStreamWriter.class};
-
+    
     private static final Map<Set<Class<?>>, JAXBContext> JAXBCONTEXT_CACHE = 
         new CacheMap<Set<Class<?>>, JAXBContext>();
 
@@ -105,7 +105,7 @@
     private Map<String, Object> marshallerProperties = Collections.emptyMap();
 
     private boolean qualifiedSchemas;
-
+    private Service service;
     
     public JAXBDataBinding() {
     }
@@ -162,19 +162,28 @@
             currentMarshallerProperties.put("com.sun.xml.bind.namespacePrefixMapper",
                                             getNamespacePrefixMapper());
         }
-        currentMarshallerProperties.putAll(marshallerProperties);
+        
+        Integer mtomThresholdInt = new Integer(getMtomThreshold());
         if (c == XMLStreamWriter.class) {
-            return (DataWriter<T>)new DataWriterImpl<XMLStreamWriter>(context, currentMarshallerProperties);
+            DataWriterImpl<XMLStreamWriter> r = 
+                new DataWriterImpl<XMLStreamWriter>(context, currentMarshallerProperties);
+            r.setMtomThreshold(mtomThresholdInt);
+            return (DataWriter<T>)r;
         } else if (c == OutputStream.class) {
-            return (DataWriter<T>)new DataWriterImpl<OutputStream>(context, 
-                currentMarshallerProperties);            
+            DataWriterImpl<OutputStream> r = 
+                new DataWriterImpl<OutputStream>(context, currentMarshallerProperties);
+            r.setMtomThreshold(mtomThresholdInt);
+            return (DataWriter<T>)r;    
         } else if (c == XMLEventWriter.class) {
-            return (DataWriter<T>)new DataWriterImpl<XMLEventWriter>(context,
-                                                                     currentMarshallerProperties);           
+            DataWriterImpl<XMLEventWriter> r = new DataWriterImpl<XMLEventWriter>(context,
+                currentMarshallerProperties);
+            r.setMtomThreshold(mtomThresholdInt);
+            return (DataWriter<T>)r;        
         } else if (c == Node.class) {
-            return (DataWriter<T>)new DataWriterImpl<Node>(context, currentMarshallerProperties);      
+            DataWriterImpl<Node> r = new DataWriterImpl<Node>(context, currentMarshallerProperties);
+            r.setMtomThreshold(mtomThresholdInt);
+            return (DataWriter<T>)r;      
         }
-        
         return null;
     }
 
@@ -201,7 +210,8 @@
     }
     
     @SuppressWarnings("unchecked")
-    public void initialize(Service service) {
+    public void initialize(Service aservice) {
+        this.service = aservice;
         //context is already set, don't redo it
         if (context != null) {
             return;

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller.java Tue Jan 22 04:13:22 2008
@@ -35,13 +35,15 @@
 
 public class JAXBAttachmentMarshaller extends AttachmentMarshaller {
 
-    private static final int THRESHOLD = 5 * 1024;
+    private int threshold = 5 * 1024;
     private Collection<Attachment> atts;
     private boolean isXop;
 
-    public JAXBAttachmentMarshaller(Collection<Attachment> attachments) {
+    public JAXBAttachmentMarshaller(Collection<Attachment> attachments, Integer mtomThreshold) {
         super();
-
+        if (mtomThreshold != null) {
+            threshold = mtomThreshold.intValue();
+        }
         atts = attachments;
         isXop = attachments != null;
     }
@@ -55,8 +57,7 @@
         if (mimeType == null) {
             mimeType = "application/octet-stream";
         }
-        if ("application/octet-stream".equals(mimeType)
-            && length < THRESHOLD) {
+        if (length < threshold) {
             return null;
         }
         ByteDataSource source = new ByteDataSource(data, offset, length);
@@ -82,19 +83,18 @@
             return null;
         }        
 
-        if ("application/octet-stream".equals(handler.getContentType())) {
-            try {
-                Object o = handler.getContent();
-                if (o instanceof String 
-                    && ((String)o).length() < THRESHOLD) {
-                    return null;
-                } else if (o instanceof byte[]
-                            && ((byte[])o).length < THRESHOLD) {
-                    return null;
-                }
-            } catch (IOException e1) {
-                //ignore, just do the normal attachment thing
+        // The following is just wrong. Even if the DataHandler has a stream, we should still
+        // apply the threshold.
+        try {
+            Object o = handler.getContent();
+            if (o instanceof String 
+                && ((String)o).length() < threshold) {
+                return null;
+            } else if (o instanceof byte[] && ((byte[])o).length < threshold) {
+                return null;
             }
+        } catch (IOException e1) {
+        //      ignore, just do the normal attachment thing
         }
         
         String id;

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataReaderImpl.java Tue Jan 22 04:13:22 2008
@@ -45,7 +45,7 @@
         if (part != null && part.getProperty("honor.jaxb.annotations") != null) {
             honorJaxbAnnotation = (Boolean)part.getProperty("honor.jaxb.annotations");
         }
-        Annotation[] anns = getJAXBAnnotion(part);
+        Annotation[] anns = getJAXBAnnotation(part);
         if (honorJaxbAnnotation && anns.length > 0) {
             //RpcLit will use the JAXB Bridge to unmarshall part message when it is 
             //annotated with @XmlList,@XmlAttachmentRef,@XmlJavaTypeAdapter

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java Tue Jan 22 04:13:22 2008
@@ -69,7 +69,7 @@
                                                      part, output, getAttachmentMarshaller(),
                                                      marshallerProperties);                
             } else {
-                Annotation[] anns = getJAXBAnnotion(part);
+                Annotation[] anns = getJAXBAnnotation(part);
                 if (!honorJaxbAnnotation || anns.length == 0) {
                     JAXBEncoderDecoder.marshall(getJAXBContext(), getSchema(), obj, part, output,
                                                 getAttachmentMarshaller(), marshallerProperties);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java Tue Jan 22 04:13:22 2008
@@ -31,12 +31,7 @@
 import javax.xml.ws.Binding;
 import javax.xml.ws.EndpointReference;
 import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceFeature;
 import javax.xml.ws.WebServicePermission;
-import javax.xml.ws.soap.Addressing;
-import javax.xml.ws.soap.AddressingFeature;
-import javax.xml.ws.soap.MTOM;
-import javax.xml.ws.soap.MTOMFeature;
 import javax.xml.ws.wsaddressing.W3CEndpointReference;
 import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
 
@@ -111,7 +106,6 @@
         this.bus = b;
         this.serverFactory = sf;
         this.implementor = implementor;
-        loadWSFeatureAnnotation();
     }
     
     /**
@@ -128,7 +122,6 @@
         this.bindingUri = bindingUri;
         wsdlLocation = wsdl == null ? null : new String(wsdl);
         serverFactory = new JaxWsServerFactoryBean();
-        loadWSFeatureAnnotation();
     }
         
     public EndpointImpl(Bus b, Object i, String bindingUri) {
@@ -139,20 +132,6 @@
         this(bus, implementor, (String) null);
     }
     
-    private void loadWSFeatureAnnotation() {
-        List<WebServiceFeature> wsFeatures = new ArrayList<WebServiceFeature>();
-        MTOM mtom = implementor.getClass().getAnnotation(MTOM.class);        
-        if (mtom != null) {
-            wsFeatures.add(new MTOMFeature(mtom.enabled(), mtom.threshold()));
-        }
-
-        Addressing addressing = implementor.getClass().getAnnotation(Addressing.class);
-        if (addressing != null) {
-            wsFeatures.add(new AddressingFeature(addressing.enabled(), addressing.required()));
-        }
-        ((JaxWsServiceFactoryBean) serverFactory.getServiceFactory()).setWsFeatures(wsFeatures);
-    }
-
     public Binding getBinding() {
         return ((JaxWsEndpointImpl) getEndpoint()).getJaxwsBinding();
     }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java Tue Jan 22 04:13:22 2008
@@ -73,7 +73,7 @@
     }
 
     /**
-     * Add annotationed Interceptors and Features to the Endpoint
+     * Add annotated Interceptors and Features to the Endpoint
      * @param ep
      */
     protected void initializeAnnotationInterceptors(Endpoint ep, Class<?> cls) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java Tue Jan 22 04:13:22 2008
@@ -92,7 +92,7 @@
         return list;
     }
 
-    public Set<Class<?>> genearte() {
+    public Set<Class<?>> generate() {
         for (OperationInfo opInfo : interfaceInfo.getOperations()) {
             if (opInfo.isUnwrappedCapable()
                 && (opInfo.getUnwrappedOperation()

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?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- 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 Tue Jan 22 04:13:22 2008
@@ -39,6 +39,10 @@
 import javax.xml.ws.Service.Mode;
 import javax.xml.ws.WebFault;
 import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.MTOM;
+import javax.xml.ws.soap.MTOMFeature;
 
 import org.apache.cxf.binding.AbstractBindingFactory;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
@@ -72,6 +76,8 @@
  * @see org.apache.cxf.jaxws.JaxWsServerFactoryBean
  */
 public class JaxWsServiceFactoryBean extends ReflectionServiceFactoryBean {
+    // used to tag property on service.
+    public static final  String WS_FEATURES = "JAXWS-WS-FEATURES";
     private AbstractServiceConfiguration jaxWsConfiguration;
 
     private JaxWsImplementorInfo implInfo;
@@ -96,12 +102,41 @@
         this.implInfo = implInfo;
         initConfiguration(implInfo);
         this.serviceClass = implInfo.getEndpointClass();
+        loadWSFeatureAnnotation(implInfo.getSEIClass(), implInfo.getImplementorClass());
     }
 
     private void initSchemaLocations() {
         this.schemaLocationMapping.put(JAXWSAConstants.NS_WSA, 
                                        JAXWSAConstants.WSA_XSD);
     }
+    
+    private void loadWSFeatureAnnotation(Class<?> serviceClass, Class<?> implementorClass) {
+        List<WebServiceFeature> features = new ArrayList<WebServiceFeature>();
+        MTOM mtom = implInfo.getImplementorClass().getAnnotation(MTOM.class);        
+        if (mtom == null && serviceClass != null) {
+            mtom = serviceClass.getAnnotation(MTOM.class);
+        }
+        if (mtom != null) {
+            features.add(new MTOMFeature(mtom.enabled(), mtom.threshold()));
+        }
+
+        Addressing addressing = null;
+        if (implementorClass != null) {
+            addressing = implementorClass.getAnnotation(Addressing.class);
+        }
+
+        if (addressing == null && serviceClass != null) {
+            addressing = serviceClass.getAnnotation(Addressing.class);
+        }
+
+        if (addressing != null) {
+            features.add(new AddressingFeature(addressing.enabled(), addressing.required()));
+        }
+
+        if (features.size() > 0) {
+            wsFeatures = features;
+        }
+    }
 
     @Override
     public org.apache.cxf.service.Service create() {
@@ -332,6 +367,7 @@
                 }
             }
         }
+        loadWSFeatureAnnotation(ii.getSEIClass(), ii.getImplementorClass());
         setMethodDispatcher(new JAXWSMethodDispatcher(implInfo));
         
     }
@@ -412,8 +448,12 @@
     private Set<Class<?>> generatedWrapperBeanClass() {
         ServiceInfo serviceInfo = getService().getServiceInfos().get(0);
         WrapperClassGenerator wrapperGen = new WrapperClassGenerator(serviceInfo.getInterface());
-        return wrapperGen.genearte();
+        return wrapperGen.generate();
+    }
+
+    @Override
+    protected void buildServiceFromClass() {
+        super.buildServiceFromClass();
+        getService().put(WS_FEATURES, getWsFeatures()); 
     }
-    
-    
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperClassGeneratorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperClassGeneratorTest.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperClassGeneratorTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperClassGeneratorTest.java Tue Jan 22 04:13:22 2008
@@ -58,7 +58,7 @@
         
         InterfaceInfo interfaceInfo = serviceInfo.getInterface();
         WrapperClassGenerator wrapperClassGenerator = new WrapperClassGenerator(interfaceInfo);
-        Set<Class<?>> wrapperClassSet = wrapperClassGenerator.genearte();
+        Set<Class<?>> wrapperClassSet = wrapperClassGenerator.generate();
         assertEquals(2, wrapperClassSet.size());
 
         Class[] wrapperClasses = wrapperClassSet.toArray(new Class[]{});

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Tue Jan 22 04:13:22 2008
@@ -314,7 +314,6 @@
         col.getExtReg().registerSerializer(MimeAttribute.class, new MimeSerializer());
 
         ServiceImpl service = new ServiceImpl(serviceInfo);
-
         setService(service);
 
         setServiceProperties();
@@ -331,7 +330,7 @@
                 si.setProperty(EXTRA_CLASS, wrapperClasses);
             }
         }
-        
+
         getDataBinding().initialize(service);
 
         boolean isWrapped = isWrapped();

Modified: incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js (original)
+++ incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js Tue Jan 22 04:13:22 2008
@@ -1,621 +1,743 @@
-/**
- * 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.
- */
- 
-// This code is structured on to require a 'new' of an object of type CxfApacheOrgUtil.
-// Alternative, it could be made 'static', but this allowed us to use this same object
-// to carry some state.
- 
-const org_apache_cxf_XSI_namespace_uri = "http://www.w3.org/2001/XMLSchema-instance";
-const org_apache_cxf_XSD_namespace_uri = "http://www.w3.org/2001/XMLSchema";
-
-function cxf_apache_org_util_null_trace(message)
-{
-}
- 
-function CxfApacheOrgUtil()
-{
-	this.ELEMENT_NODE = 1;
-
-	if ("function" == typeof(org_apache_cxf_trace)) {
-		this.trace = org_apache_cxf_trace.trace;
-	} else {
-		this.trace = cxf_apache_org_util_null_trace;
-    }		
-}
-
-// compensate for Microsoft's weakness here.
-function org_apache_cxf_getNodeLocalName(node)
-{
-    if("localName" in node) {
-        return node.localName;
-    } else {
-        return node.baseName;
-    }
-}
-
-
-CxfApacheOrgUtil.prototype.getNodeLocalName = org_apache_cxf_getNodeLocalName;
-
-// compensate for lack of namespace support in IE.
-function org_apache_cxf_getNamespaceURI(elementNode, namespacePrefix)
-{
-	var namespaceURI = null;
-    if (elementNode.nodeType == 9)
-        return null;
-    else {
-        namespaceURI = org_apache_cxf_findNamespace (elementNode, namespacePrefix);
-        if (namespaceURI == null)
-            namespaceURI = org_apache_cxf_getNamespaceURI(elementNode.parentNode, namespacePrefix);
-        else
-            return namespaceURI; 
-    }
-    return namespaceURI;
- }
- 
- 
-function org_apache_cxf_findNamespace(elementNode, namespacePrefix)
-{
-    var attributes = elementNode.attributes;
-    if ((attributes!=null) && (attributes.length > 0)) {
-        for (var x=0; x<attributes.length; x++) {
-            var attributeNodeName = attributes.item(x).nodeName;
-            var attributeNamespacePrefix = org_apache_cxf_getPrefix(attributes.item(x).nodeName);
-            var attributeNamespaceSuffix = org_apache_cxf_getLocalName(attributes.item(x).nodeName);
-
-            if ( (namespacePrefix == null) &&
-                 (attributeNamespacePrefix == null) && 
-                 (attributeNamespaceSuffix == "xmlns"))
-                return attributes.item(x).nodeValue;
-            else if ((attributeNamespacePrefix == "xmlns") && 
-                     (attributeNamespaceSuffix == namespacePrefix))
-                return attributes.item(x).nodeValue;
-        }
-        return null;
-    }
-}
-
-function org_apache_cxf_get_node_namespaceURI(elementNode) 
-{
-	var prefix = org_apache_cxf_getPrefix(elementNode.nodeName);
-	return org_apache_cxf_getNamespaceURI(elementNode, prefix);
-}
-
-CxfApacheOrgUtil.prototype.getElementNamespaceURI = org_apache_cxf_get_node_namespaceURI;
-
-function org_apache_cxf_any_ns_matcher(style, tns, nslist, nextLocalPart)
-{
-	this.style = style;
-	this.tns = tns;
-	this.nslist = nslist;
-	this.nextLocalPart = nextLocalPart;
-}
-
-org_apache_cxf_any_ns_matcher.ANY = "##any";
-org_apache_cxf_any_ns_matcher.OTHER = "##other";
-org_apache_cxf_any_ns_matcher.LOCAL = "##local";
-org_apache_cxf_any_ns_matcher.LISTED = "listed";
-
-function org_apache_cxf_any_ns_matcher_match(namespaceURI, localName)
-{
-	switch(this.style) {
-		// should this match local elements?
-		case org_apache_cxf_any_ns_matcher.ANY:
-			return true;
-		case org_apache_cxf_any_ns_matcher.OTHER:
-			return namespaceURI != this.tns;
-		case org_apache_cxf_any_ns_matcher.LOCAL:
-			return namespaceURI == null || namespaceURI == '';
-		case org_apache_cxf_any_ns_matcher.LISTED:
-			for(var x in this.nslist) {
-				var ns = this.nslist[x];
-				if(ns == "##local") {
-					if((namespaceURI == null || namespaceURI == '') 
-						&& (this.nextLocalPart != null && localName != this.nextLocalPart))
-						return true;  
-				} else {
-					if(ns == namespaceURI)
-						return true;
-				} 
-			}
-            return false;
-	  }
-}
-
-org_apache_cxf_any_ns_matcher.prototype.match = org_apache_cxf_any_ns_matcher_match; 
-
-function org_apache_cxf_getPrefix(tagName)
-{
-    var prefix;
-    var prefixIndex = tagName.indexOf(":");
-    if (prefixIndex == -1)
-        return null;
-    else 
-        return prefix = tagName.substring(0, prefixIndex);
-}
-
-function org_apache_cxf_getLocalName(tagName)
-{
-    var suffix;
-    var prefixIndex = tagName.indexOf(":");
-
-    if (prefixIndex == -1)
-        return tagName;
-    else 
-        return suffix = tagName.substring (prefixIndex+1, tagName.length);
-}
-
-function org_apache_cxf_element_name_for_trace(node)
-{
-	if(node == null)
-		return "Null";
-	else if(node == undefined)
-		return "Undefined";
-	else {
-	    var n = '';
-	    if(node.namespaceURI != null && node.namespaceURI != '') {
-   			n = n + "{" + node.namespaceURI + "}";
-   		} 
-   		return n + this.getNodeLocalName(node);
-	}
-}
-
-CxfApacheOrgUtil.prototype.traceElementName = org_apache_cxf_element_name_for_trace; 
-
-function org_apache_cxf_escapeXmlEntities(val) {
-    if(val == null || val == undefined)
-        return "";
-    else {
-    	val = String(val);
-        return val.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
-    }
-}
-
-CxfApacheOrgUtil.prototype.escapeXmlEntities = org_apache_cxf_escapeXmlEntities; 
-    
-function org_apache_cxf_isElementNil(node) {
-    if(node == null)
-    	throw "null node passed to isElementNil";
-    // we need to look for an attribute xsi:nil, where xsi is
-    // http://www.w3.org/2001/XMLSchema-instance. we have the usual
-    // problem here with namespace-awareness.
-    if ('function' == typeof node.getAttributeNS) {
-        var nillness = node.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
-        return nillness != null && nillness == "true";
-    } else { // we assume the standard prefix and hope for the best.
-        var nillness = node.getAttribute("xsi:nil");
-        return nillness != null && nillness == "true";
-    }
-}
-
-CxfApacheOrgUtil.prototype.isElementNil = org_apache_cxf_isElementNil; 
-
-function org_apache_cxf_getFirstElementChild(node) {
-    if(node == undefined)
-       throw "undefined node to getFirstElementChild";
-
-	var n;
-	for(n = node.firstChild; n != null && n.nodeType != this.ELEMENT_NODE; n = n.nextSibling) {
-	}
-		
-	return n;
-}
-
-CxfApacheOrgUtil.prototype.getFirstElementChild = org_apache_cxf_getFirstElementChild; 
-
-function org_apache_cxf_getNextElementSibling(node) {
-	if(node == undefined)
-		throw "undefined node to getNextElementSibling";
-	if(node == null)
-		throw "null node to getNextElementSibling";
-	var n;
-	for(n = node.nextSibling; n != null && n.nodeType != this.ELEMENT_NODE; n = n.nextSibling)
-		;
-	return n;
-}
-
-CxfApacheOrgUtil.prototype.getNextElementSibling = org_apache_cxf_getNextElementSibling; 
-
-function org_apache_cxf_isNodeNamedNS(node, namespaceURI, localName)
-{
-    if(node == undefined)
-       throw "undefined node to isNodeNamedNS";
-
-    if(namespaceURI == '' || namespaceURI == null) {
-        if(node.namespaceURI == '' || node.namespaceURI == null) {
-            return localName == org_apache_cxf_getNodeLocalName(node);
-        } else
-            return false;
-    } else {
-        return namespaceURI == node.namespaceURI && localName == org_apache_cxf_getNodeLocalName(node);
-    }
-}
-
-CxfApacheOrgUtil.prototype.isNodeNamedNS = org_apache_cxf_isNodeNamedNS; 
-
-//Firefox splits large text regions into multiple Text objects (4096 chars in each).
-function org_apache_cxf_getNodeText(node)
-{
-    var r = "";
-    for(var x = 0; x < node.childNodes.length; x ++) {
-        r = r + node.childNodes[x].nodeValue;
-    }
-    return r;
-}
-
-CxfApacheOrgUtil.prototype.getNodeText = org_apache_cxf_getNodeText;
-
-// This always uses soap-env, soap, and xsi as prefixes.
-function org_apache_cxf_begin_soap11_message(namespaceAttributes)
-{
-	var value = 
-	    '<?xml version="1.0" encoding="UTF-8"?>' 
-	    + '<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"'
-		+ ' xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"'
-		+ ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
-	    + '><soap-env:Body '
-	    + namespaceAttributes 
-	    + '>';
-		return value;
-}
-
-CxfApacheOrgUtil.prototype.beginSoap11Message = org_apache_cxf_begin_soap11_message; 
-
-function org_apache_cxf_end_soap11_message()
-{
-	return '</soap-env:Body></soap-env:Envelope>';
-}
-	
-CxfApacheOrgUtil.prototype.endSoap11Message = org_apache_cxf_end_soap11_message; 
-
-/*
- * Client object sends requests and calls back with responses.
- */
-	
-function CxfApacheOrgClient(utils) {
-	utils.trace("Client constructor");
-    this.utils = utils;
-    utils.client = this; // we aren't worried about multithreading!
-    this.mtomparts = [];
-    this.soapAction = "";
-    this.messageType = "CALL";
-    // handler functions
-    this.onsuccess = null;
-    this.onerror = null;
-    // Firefox is noncompliant with respect to the defined constants,
-    // so we define our own.
-    this.READY_STATE_UNINITIALIZED = 0;
-    this.READY_STATE_LOADING = 1;
-    this.READY_STATE_LOADED = 2;
-    this.READY_STATE_INTERACTIVE = 3;
-    this.READY_STATE_DONE = 4;
-}
-
-const org_apache_cxf_pad_string_PAD_LEFT  = 0;
-const org_apache_cxf_pad_string_PAD_RIGHT = 1;
-const org_apache_cxf_pad_string_PAD_BOTH  = 2;
-
-function org_apache_cxf_pad_string(string, len, pad, type) {
-	var append = new String();
-
-	len = isNaN(len) ? 0 : len - string.length;
-	pad = typeof(pad) == 'string' ? pad : ' ';
-
-	if (type == org_apache_cxf_pad_string_PAD_BOTH) {
-		string = org_apache_cxf_pad_sring(Math.floor(len / 2) + string.length,
-				pad, org_apache_cxf_pad_string_PAD_LEFT);
-		return (org_apache_cxf_pad_string(Math.ceil(len / 2) + string.length,
-				pad, org_apache_cxf_pad_string_PAD_RIGHT));
-	}
-
-	while ((len -= pad.length) > 0)
-		append += pad;
-	append += pad.substr(0, len + pad.length);
-
-	return (type == org_apache_cxf_pad_string_PAD_LEFT
-			? append.concat(string)
-			: string.concat(append));
-}
-
-/*
- * Generate a uniformly distributed random integer within the range <min> ..
- * <max>. (min) - Lower limit: random >= min (default: 0) (max) - Upper limit:
- * random <= max (default: 1)
- */
-function org_apache_cxf_random_int(min, max) {
-    if (! isFinite(min)) min = 0;
-    if (! isFinite(max)) max = 1;
-    return Math.floor((Math.random () % 1) * (max - min + 1) + min);
-}
-
-function org_apache_cxf_random_hex_string(len)
-{
-	var random = org_apache_cxf_random_int(0, Math.pow (16, len) - 1);
-    return org_apache_cxf_pad_string(random.toString(16), len, '0', org_apache_cxf_pad_string_PAD_LEFT);
-}
-
-
-function org_apache_cxf_make_uuid(type) {
-	switch ((type || 'v4').toUpperCase()) {
-		// Version 4 UUID (Section 4.4 of RFC 4122)
-		case 'V4' :
-			var tl = org_apache_cxf_random_hex_string(8);
-			// time_low
-			var tm = org_apache_cxf_random_hex_string(4);
-			// time_mid
-			var thav = '4' + org_apache_cxf_random_hex_string(3);
-			// time_hi_and_version
-			var cshar = org_apache_cxf_random_int(0, 0xFF);
-			// clock_seq_hi_and_reserved
-			cshar = ((cshar & ~(1 << 6)) | (1 << 7)).toString(16);
-			var csl = org_apache_cxf_random_hex_string(2);
-			// clock_seq_low
-			var n = org_apache_cxf_random_hex_string(12);
-			// node
-
-			return (tl + '-' + tm + '-' + thav + '-' + cshar + csl + '-' + n);
-
-			// Nil UUID (Section 4.1.7 of RFC 4122)
-		case 'NIL' :
-			return '00000000-0000-0000-0000-000000000000';
-	}
-	return null;
-}
-
-const ORG_APACHE_CXF_MTOM_REQUEST_HEADER = 'Content-Type: application/xop+xml; type="text/xml"; charset=utf-8\r\n';
-
-// Caller must avoid stupid mistakes like 'GET' with a request body.
-// This does not support attempts to cross-script.
-// This imposes a relatively straightforward set of HTTP options.
-function org_apache_cxf_client_request(url, requestXML, method, sync, headers)
-{
-	this.utils.trace("request " + url);
-	
-    this.url = url;
-    this.sync = sync;
-
-    this.req = null;
-
-    if (method) {
-        this.method = method;
-    } else {
-        if(requestXML) 
-            this.method = "POST";
-        else
-            this.method="GET";
-    } 
-
-    try {
-        this.req = new XMLHttpRequest();
-    } catch(err) {
-        this.utils.trace("Error creating XMLHttpRequest " + err);
-        this.req = null;
-    }
-
-    if(this.req == null) {
-        if(window.ActiveXObject) {
-            this.req = new ActiveXObject("MSXML2.XMLHTTP.6.0"); // Microsoft's recommended version
-        }
-    }
-
-    if(this.req == null) {
-        this.utils.trace("Unable to create request object.");
-        throw "ORG_APACHE_CXF_NO_REQUEST_OBJECT";
-    }
-
-	this.utils.trace("about to open " + this.method + " " + this.url);
-    this.req.open(this.method, this.url, !this.sync);
- 
-    var mimeBoundary;
-    
-    // we can't do binary MTOM, but we can do 'text/plain' !
-	if(this.mtomparts.length > 0) {
-		var uuid = org_apache_cxf_make_uuid('v4');
-		mimeBoundary = '@_bOuNDaRy_' + uuid;
-		var ctHeader = 'Multipart/Related; start-info="text/xml"; type="application/xop+xml"; boundary="' + mimeBoundary + '"';
-    	this.req.setRequestHeader("Content-Type", ctHeader);
-		
-	} else {
-    	this.req.setRequestHeader("Content-Type", "application/xml");
-	}
-
-    if (headers) { // must be array indexed by header field.
-        for (var h in headers) {
-            this.req.setRequestHeader(h,headers[h]);
-        }
-    }
-
-    this.req.setRequestHeader("SOAPAction", this.soapAction);
-    this.req.setRequestHeader("MessageType", this.messageType);
-
-    var requester = this; /* setup a closure */
-            
-    this.req.onreadystatechange = function() {
-        requester.onReadyState();
-    }
-
-    // NOTE: we do not call the onerror callback for a synchronous error
-    // at request time. We let the request object throw as it will. 
-    // onError will only be called for asynchronous errors.
-    this.utils.trace("about to send data" + this.method + " " + this.url);
-    var dataToSend;
-    if(this.mtomparts.length == 0) {
-    	dataToSend = requestXML;
-    } else {
-    	dataToSend = "--" + mimeBoundary + "\r\n";
-    	dataToSend = dataToSend + ORG_APACHE_CXF_MTOM_REQUEST_HEADER + "\r\n";
-    	dataToSend = dataToSend + requestXML;
-    	for(var bx in this.mtomparts) {
-    		var part = this.mtomparts[bx];
-    		dataToSend += "\r\n\r\n--" + mimeBoundary + "\r\n";
-    		dataToSend += part;
-    	}
-   		dataToSend += "--" + mimeBoundary + "--\r\n";
-    }
-    
-    this.req.send(dataToSend);
-}
-
-CxfApacheOrgClient.prototype.request = org_apache_cxf_client_request;
-
-function org_apache_cxf_client_onReadyState() {
-    var req = this.req;
-    var ready = req.readyState;
-
-    this.utils.trace("onreadystatechange " + ready);
-
-    if (ready == this.READY_STATE_DONE) {
-    	var httpStatus;
-    	try {
-        	httpStatus=req.status;
-    	} catch(e) {
-    		// Firefox throws when there was an error here. 
-    		this.utils.trace("onreadystatechange DONE ERROR retrieving status (connection error?)");
-    		if(this.onerror != null) {
-   			    this.onerror(e);
-    		}
-    		return;
-
-    	}
-    	
-        this.utils.trace("onreadystatechange DONE " + httpStatus);
-
-        if (httpStatus==200 || httpStatus==0) {
-            if(this.onsuccess != null) {
-                // the onSuccess function is generated, and picks apart the response.
-                this.onsuccess(req.responseXML);
-            }
-		} else {
-            this.utils.trace("onreadystatechange DONE ERROR " + 
-                             req.getAllResponseHeaders() 
-                             + " " 
-                             + req.statusText 
-                             + " " 
-                             + req.responseText);
-            if(this.onerror != null) 
-                this.onerror(this);
-		}
-	}
-}
-
-CxfApacheOrgClient.prototype.onReadyState = org_apache_cxf_client_onReadyState;
-
-function org_apache_cxf_package_mtom(value) {
-	var uuid = org_apache_cxf_make_uuid('v4');
-    var placeholder = '<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" '
-        +'href="cid:' + uuid + '" />';
-    var mtomObject = 'Content-Type: text/plain; charset="utf-8";\r\nContent-ID: <' + uuid + '>\r\n\r\n' + value + '\r\n';
-    this.client.mtomparts.push(mtomObject);
-	return placeholder;
-}
-
-CxfApacheOrgUtil.prototype.packageMtom = org_apache_cxf_package_mtom; 
-
-// Holder object used for xs:any
-// The namespaceURI and localName identify the global element from the schema.
-// The object to go with it goes into object.
-// If the Any is an array, put the array into the object slot.
-
-function org_apache_cxf_any_holder(namespaceURI, localName, object) {
-	this.typeMarker = "org_apache_cxf_any_holder";
-	this.namespaceURI = namespaceURI;
-	this.localName = localName;
-	this.qname = "{" + namespaceURI + "}" + localName;
-	this.object = object;
-	this.raw = false;
-}
-
-// the following will simply dump the supplied XML into the message.
-function org_apache_cxf_raw_any_holder(xml)
-{
-	this.typeMarker = "org_apache_cxf_raw_any_holder";
-	this.xml = xml;
-	this.raw = true;
-	this.xsiType = false;
-}
-
-// The following will get an xsi:type attribute in addition to dumping the XML into
-// the message.
-function org_apache_cxf_raw_typed_any_holder(namespaceURI, localName, xml)
-{
-	this.typeMarker = "org_apache_cxf_raw_any_holder";
-	this.namespaceURI = namespaceURI;
-	this.localName = localName;
-	this.xml = xml;
-	this.raw = true;
-	this.xsiType = true;
-}
-
-function org_apache_cxf_get_xsi_type(elementNode)
-{
-    var attributes = elementNode.attributes;
-    if ((attributes!=null) && (attributes.length > 0)) {
-        for (var x=0; x<attributes.length; x++) {
-            var attributeNodeName = attributes.item(x).nodeName;
-            var attributeNamespacePrefix = org_apache_cxf_getPrefix(attributes.item(x).nodeName);
-            var attributeNamespaceSuffix = org_apache_cxf_getLocalName(attributes.item(x).nodeName);
-			if(attributeNamespaceSuffix == 'type') {
-				// perhaps this is ours
-				var ns = org_apache_cxf_getNamespaceURI(elementNode, attributeNamespacePrefix);
-				if(ns == org_apache_cxf_XSI_namespace_uri) {
-					return attributes.item(x).nodeValue;
-				}
-			}
-        }
-        return null;
-    }
-}
-
-// return the an object if we can deserialize an object, otherwise return the element itself.
-function org_apache_cxf_deserialize_anyType(cxfjsutils, element)
-{
-	var type = org_apache_cxf_get_xsi_type(element);
-	if(type != null) {
-		// type is a :-qualified name.
-		var namespacePrefix = org_apache_cxf_getPrefix(type);
-        var localName = org_apache_cxf_getLocalName(type);
-        var uri = org_apache_cxf_getNamespaceURI(element, namespacePrefix);
-        if(uri == org_apache_cxf_XSD_namespace_uri) {
-        	// we expect a Text node below
-        	var textNode = element.firstChild;
-        	if(textNode == null)
-        		return null;
-        	var text = textNode.nodeValue;
-        	if(text == null)
-        		return null;
-        	// For any of the basic types, assume that the nodeValue is what the doctor ordered,
-            //  converted to the appropriate type.
-        	// For some of the more interesting types this needs more work.
-        	if(localName == "int" || localName == "unsignedInt" || localName == "long" || localName == "unsignedLong") {
-        		return parseInt(text);
-        	}
-        	if(localName == "float" || localName == "double")
-        		return parseFloat(text);
-        	if(localName == "boolean") 
-        		return text == 'true';
-        	return text;
-        }
-		var qname = "{" + uri + "}" + localName;
-		var deserializer = cxfjsutils.interfaceObject.globalElementDeserializers[qname];
-		if(deserializer != null) {
-			return deserializer(cxfjsutils, element);
-		}
-	}
-	return element;
-}
-	
+/**
+ * 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.
+ */
+
+// This code is structured on to require a 'new' of an object of type
+// CxfApacheOrgUtil.
+// Alternative, it could be made 'static', but this allowed us to use this same
+// object
+// to carry some state.
+const org_apache_cxf_XSI_namespace_uri = "http://www.w3.org/2001/XMLSchema-instance";
+const org_apache_cxf_XSD_namespace_uri = "http://www.w3.org/2001/XMLSchema";
+
+function cxf_apache_org_util_null_trace(message) {
+}
+
+function CxfApacheOrgUtil() {
+	this.ELEMENT_NODE = 1;
+
+	if ("function" == typeof(org_apache_cxf_trace)) {
+		this.trace = org_apache_cxf_trace.trace;
+	} else {
+		this.trace = cxf_apache_org_util_null_trace;
+	}
+}
+
+// compensate for Microsoft's weakness here.
+function org_apache_cxf_getNodeLocalName(node) {
+	if ("localName" in node) {
+		return node.localName;
+	} else {
+		return node.baseName;
+	}
+}
+
+CxfApacheOrgUtil.prototype.getNodeLocalName = org_apache_cxf_getNodeLocalName;
+
+// compensate for lack of namespace support in IE.
+function org_apache_cxf_getNamespaceURI(elementNode, namespacePrefix) {
+	var namespaceURI = null;
+	if (elementNode.nodeType == 9)
+		return null;
+	else {
+		namespaceURI = org_apache_cxf_findNamespace(elementNode,
+				namespacePrefix);
+		if (namespaceURI == null)
+			namespaceURI = org_apache_cxf_getNamespaceURI(
+					elementNode.parentNode, namespacePrefix);
+		else
+			return namespaceURI;
+	}
+	return namespaceURI;
+}
+
+function org_apache_cxf_findNamespace(elementNode, namespacePrefix) {
+	var attributes = elementNode.attributes;
+	if ((attributes != null) && (attributes.length > 0)) {
+		for (var x = 0;x < attributes.length; x++) {
+			var attributeNodeName = attributes.item(x).nodeName;
+			var attributeNamespacePrefix = org_apache_cxf_getPrefix(attributes
+					.item(x).nodeName);
+			var attributeNamespaceSuffix = org_apache_cxf_getLocalName(attributes
+					.item(x).nodeName);
+
+			if ((namespacePrefix == null) && (attributeNamespacePrefix == null)
+					&& (attributeNamespaceSuffix == "xmlns"))
+				return attributes.item(x).nodeValue;
+			else if ((attributeNamespacePrefix == "xmlns")
+					&& (attributeNamespaceSuffix == namespacePrefix))
+				return attributes.item(x).nodeValue;
+		}
+		return null;
+	}
+}
+
+function org_apache_cxf_get_node_namespaceURI(elementNode) {
+	var prefix = org_apache_cxf_getPrefix(elementNode.nodeName);
+	return org_apache_cxf_getNamespaceURI(elementNode, prefix);
+}
+
+CxfApacheOrgUtil.prototype.getElementNamespaceURI = org_apache_cxf_get_node_namespaceURI;
+
+function org_apache_cxf_any_ns_matcher(style, tns, nslist, nextLocalPart) {
+	this.style = style;
+	this.tns = tns;
+	this.nslist = nslist;
+	this.nextLocalPart = nextLocalPart;
+}
+
+org_apache_cxf_any_ns_matcher.ANY = "##any";
+org_apache_cxf_any_ns_matcher.OTHER = "##other";
+org_apache_cxf_any_ns_matcher.LOCAL = "##local";
+org_apache_cxf_any_ns_matcher.LISTED = "listed";
+
+function org_apache_cxf_any_ns_matcher_match(namespaceURI, localName) {
+	switch (this.style) {
+		// should this match local elements?
+		case org_apache_cxf_any_ns_matcher.ANY :
+			return true;
+		case org_apache_cxf_any_ns_matcher.OTHER :
+			return namespaceURI != this.tns;
+		case org_apache_cxf_any_ns_matcher.LOCAL :
+			return namespaceURI == null || namespaceURI == '';
+		case org_apache_cxf_any_ns_matcher.LISTED :
+			for (var x in this.nslist) {
+				var ns = this.nslist[x];
+				if (ns == "##local") {
+					if ((namespaceURI == null || namespaceURI == '')
+							&& (this.nextLocalPart != null && localName != this.nextLocalPart))
+						return true;
+				} else {
+					if (ns == namespaceURI)
+						return true;
+				}
+			}
+			return false;
+	}
+}
+
+org_apache_cxf_any_ns_matcher.prototype.match = org_apache_cxf_any_ns_matcher_match;
+
+function org_apache_cxf_getPrefix(tagName) {
+	var prefix;
+	var prefixIndex = tagName.indexOf(":");
+	if (prefixIndex == -1)
+		return null;
+	else
+		return prefix = tagName.substring(0, prefixIndex);
+}
+
+function org_apache_cxf_getLocalName(tagName) {
+	var suffix;
+	var prefixIndex = tagName.indexOf(":");
+
+	if (prefixIndex == -1)
+		return tagName;
+	else
+		return suffix = tagName.substring(prefixIndex + 1, tagName.length);
+}
+
+function org_apache_cxf_element_name_for_trace(node) {
+	if (node == null)
+		return "Null";
+	else if (node == undefined)
+		return "Undefined";
+	else {
+		var n = '';
+		if (node.namespaceURI != null && node.namespaceURI != '') {
+			n = n + "{" + node.namespaceURI + "}";
+		}
+		return n + this.getNodeLocalName(node);
+	}
+}
+
+CxfApacheOrgUtil.prototype.traceElementName = org_apache_cxf_element_name_for_trace;
+
+function org_apache_cxf_escapeXmlEntities(val) {
+	if (val == null || val == undefined)
+		return "";
+	else {
+		val = String(val);
+		return val.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g,
+				"&gt;");
+	}
+}
+
+CxfApacheOrgUtil.prototype.escapeXmlEntities = org_apache_cxf_escapeXmlEntities;
+
+function org_apache_cxf_isElementNil(node) {
+	if (node == null)
+		throw "null node passed to isElementNil";
+	// we need to look for an attribute xsi:nil, where xsi is
+	// http://www.w3.org/2001/XMLSchema-instance. we have the usual
+	// problem here with namespace-awareness.
+	if ('function' == typeof node.getAttributeNS) {
+		var nillness = node.getAttributeNS(
+				"http://www.w3.org/2001/XMLSchema-instance", "nil");
+		return nillness != null && nillness == "true";
+	} else { // we assume the standard prefix and hope for the best.
+		var nillness = node.getAttribute("xsi:nil");
+		return nillness != null && nillness == "true";
+	}
+}
+
+CxfApacheOrgUtil.prototype.isElementNil = org_apache_cxf_isElementNil;
+
+function org_apache_cxf_getFirstElementChild(node) {
+	if (node == undefined)
+		throw "undefined node to getFirstElementChild";
+
+	var n;
+	for (n = node.firstChild;n != null && n.nodeType != this.ELEMENT_NODE; n = n.nextSibling) {
+	}
+
+	return n;
+}
+
+CxfApacheOrgUtil.prototype.getFirstElementChild = org_apache_cxf_getFirstElementChild;
+
+function org_apache_cxf_getNextElementSibling(node) {
+	if (node == undefined)
+		throw "undefined node to getNextElementSibling";
+	if (node == null)
+		throw "null node to getNextElementSibling";
+	var n;
+	for (n = node.nextSibling;n != null && n.nodeType != this.ELEMENT_NODE; n = n.nextSibling);
+	return n;
+}
+
+CxfApacheOrgUtil.prototype.getNextElementSibling = org_apache_cxf_getNextElementSibling;
+
+function org_apache_cxf_isNodeNamedNS(node, namespaceURI, localName) {
+	if (node == undefined)
+		throw "undefined node to isNodeNamedNS";
+
+	if (namespaceURI == '' || namespaceURI == null) {
+		if (node.namespaceURI == '' || node.namespaceURI == null) {
+			return localName == org_apache_cxf_getNodeLocalName(node);
+		} else
+			return false;
+	} else {
+		return namespaceURI == node.namespaceURI
+				&& localName == org_apache_cxf_getNodeLocalName(node);
+	}
+}
+
+CxfApacheOrgUtil.prototype.isNodeNamedNS = org_apache_cxf_isNodeNamedNS;
+
+// Firefox splits large text regions into multiple Text objects (4096 chars in
+// each).
+function org_apache_cxf_getNodeText(node) {
+	var r = "";
+	for (var x = 0;x < node.childNodes.length; x++) {
+		r = r + node.childNodes[x].nodeValue;
+	}
+	return r;
+}
+
+CxfApacheOrgUtil.prototype.getNodeText = org_apache_cxf_getNodeText;
+
+// This always uses soap-env, soap, and xsi as prefixes.
+function org_apache_cxf_begin_soap11_message(namespaceAttributes) {
+	var value = '<?xml version="1.0" encoding="UTF-8"?>'
+			+ '<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"'
+			+ ' xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"'
+			+ ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
+			+ '><soap-env:Body ' + namespaceAttributes + '>';
+	return value;
+}
+
+CxfApacheOrgUtil.prototype.beginSoap11Message = org_apache_cxf_begin_soap11_message;
+
+function org_apache_cxf_end_soap11_message() {
+	return '</soap-env:Body></soap-env:Envelope>';
+}
+
+CxfApacheOrgUtil.prototype.endSoap11Message = org_apache_cxf_end_soap11_message;
+
+/*
+ * Client object sends requests and calls back with responses.
+ */
+
+function CxfApacheOrgClient(utils) {
+	utils.trace("Client constructor");
+	this.utils = utils;
+	utils.client = this; // we aren't worried about multithreading!
+	this.mtomparts = [];
+	this.soapAction = "";
+	this.messageType = "CALL";
+	// handler functions
+	this.onsuccess = null;
+	this.onerror = null;
+	// Firefox is noncompliant with respect to the defined constants,
+	// so we define our own.
+	this.READY_STATE_UNINITIALIZED = 0;
+	this.READY_STATE_LOADING = 1;
+	this.READY_STATE_LOADED = 2;
+	this.READY_STATE_INTERACTIVE = 3;
+	this.READY_STATE_DONE = 4;
+}
+
+const org_apache_cxf_pad_string_PAD_LEFT = 0;
+const org_apache_cxf_pad_string_PAD_RIGHT = 1;
+const org_apache_cxf_pad_string_PAD_BOTH = 2;
+
+function org_apache_cxf_pad_string(string, len, pad, type) {
+	var append = new String();
+
+	len = isNaN(len) ? 0 : len - string.length;
+	pad = typeof(pad) == 'string' ? pad : ' ';
+
+	if (type == org_apache_cxf_pad_string_PAD_BOTH) {
+		string = org_apache_cxf_pad_sring(Math.floor(len / 2) + string.length,
+				pad, org_apache_cxf_pad_string_PAD_LEFT);
+		return (org_apache_cxf_pad_string(Math.ceil(len / 2) + string.length,
+				pad, org_apache_cxf_pad_string_PAD_RIGHT));
+	}
+
+	while ((len -= pad.length) > 0)
+		append += pad;
+	append += pad.substr(0, len + pad.length);
+
+	return (type == org_apache_cxf_pad_string_PAD_LEFT
+			? append.concat(string)
+			: string.concat(append));
+}
+
+/*
+ * Generate a uniformly distributed random integer within the range <min> ..
+ * <max>. (min) - Lower limit: random >= min (default: 0) (max) - Upper limit:
+ * random <= max (default: 1)
+ */
+function org_apache_cxf_random_int(min, max) {
+	if (!isFinite(min))
+		min = 0;
+	if (!isFinite(max))
+		max = 1;
+	return Math.floor((Math.random() % 1) * (max - min + 1) + min);
+}
+
+function org_apache_cxf_random_hex_string(len) {
+	var random = org_apache_cxf_random_int(0, Math.pow(16, len) - 1);
+	return org_apache_cxf_pad_string(random.toString(16), len, '0',
+			org_apache_cxf_pad_string_PAD_LEFT);
+}
+
+function org_apache_cxf_make_uuid(type) {
+	switch ((type || 'v4').toUpperCase()) {
+		// Version 4 UUID (Section 4.4 of RFC 4122)
+		case 'V4' :
+			var tl = org_apache_cxf_random_hex_string(8);
+			// time_low
+			var tm = org_apache_cxf_random_hex_string(4);
+			// time_mid
+			var thav = '4' + org_apache_cxf_random_hex_string(3);
+			// time_hi_and_version
+			var cshar = org_apache_cxf_random_int(0, 0xFF);
+			// clock_seq_hi_and_reserved
+			cshar = ((cshar & ~(1 << 6)) | (1 << 7)).toString(16);
+			var csl = org_apache_cxf_random_hex_string(2);
+			// clock_seq_low
+			var n = org_apache_cxf_random_hex_string(12);
+			// node
+
+			return (tl + '-' + tm + '-' + thav + '-' + cshar + csl + '-' + n);
+
+			// Nil UUID (Section 4.1.7 of RFC 4122)
+		case 'NIL' :
+			return '00000000-0000-0000-0000-000000000000';
+	}
+	return null;
+}
+
+const ORG_APACHE_CXF_MTOM_REQUEST_HEADER = 'Content-Type: application/xop+xml; type="text/xml"; charset=utf-8\r\n';
+
+// Caller must avoid stupid mistakes like 'GET' with a request body.
+// This does not support attempts to cross-script.
+// This imposes a relatively straightforward set of HTTP options.
+function org_apache_cxf_client_request(url, requestXML, method, sync, headers) {
+	this.utils.trace("request " + url);
+
+	this.url = url;
+	this.sync = sync;
+
+	this.req = null;
+
+	if (method) {
+		this.method = method;
+	} else {
+		if (requestXML)
+			this.method = "POST";
+		else
+			this.method = "GET";
+	}
+
+	try {
+		this.req = new XMLHttpRequest();
+	} catch (err) {
+		this.utils.trace("Error creating XMLHttpRequest " + err);
+		this.req = null;
+	}
+
+	if (this.req == null) {
+		if (window.ActiveXObject) {
+			this.req = new ActiveXObject("MSXML2.XMLHTTP.6.0"); // Microsoft's
+			// recommended
+			// version
+		}
+	}
+
+	if (this.req == null) {
+		this.utils.trace("Unable to create request object.");
+		throw "ORG_APACHE_CXF_NO_REQUEST_OBJECT";
+	}
+
+	this.utils.trace("about to open " + this.method + " " + this.url);
+	this.req.open(this.method, this.url, !this.sync);
+
+	var mimeBoundary;
+
+	// we can't do binary MTOM, but we can do 'text/plain' !
+	if (this.mtomparts.length > 0) {
+		var uuid = org_apache_cxf_make_uuid('v4');
+		mimeBoundary = '@_bOuNDaRy_' + uuid;
+		var ctHeader = 'multipart/related; start-info="text/xml"; type="application/xop+xml"; boundary="'
+				+ mimeBoundary + '"';
+		this.req.setRequestHeader("Content-Type", ctHeader);
+
+	} else {
+		this.req.setRequestHeader("Content-Type", "application/xml");
+	}
+
+	if (headers) { // must be array indexed by header field.
+		for (var h in headers) {
+			this.req.setRequestHeader(h, headers[h]);
+		}
+	}
+
+	this.req.setRequestHeader("SOAPAction", this.soapAction);
+	this.req.setRequestHeader("MessageType", this.messageType);
+
+	var requester = this; /* setup a closure */
+
+	this.req.onreadystatechange = function() {
+		requester.onReadyState();
+	}
+
+	// NOTE: we do not call the onerror callback for a synchronous error
+	// at request time. We let the request object throw as it will.
+	// onError will only be called for asynchronous errors.
+	this.utils.trace("about to send data" + this.method + " " + this.url);
+	var dataToSend;
+	if (this.mtomparts.length == 0) {
+		dataToSend = requestXML;
+	} else {
+		dataToSend = "--" + mimeBoundary + "\r\n";
+		dataToSend = dataToSend + ORG_APACHE_CXF_MTOM_REQUEST_HEADER + "\r\n";
+		dataToSend = dataToSend + requestXML;
+		for (var bx in this.mtomparts) {
+			var part = this.mtomparts[bx];
+			dataToSend += "\r\n\r\n--" + mimeBoundary + "\r\n";
+			dataToSend += part;
+		}
+		dataToSend += "--" + mimeBoundary + "--\r\n";
+	}
+
+	this.req.send(dataToSend);
+}
+
+CxfApacheOrgClient.prototype.request = org_apache_cxf_client_request;
+
+function org_apache_cxf_trim_string(str) {
+	return str.replace(/^\s+|\s+$/g, '');
+}
+
+// this gets an array of a=b strings, and produces a dictionary of x[a]=b;
+function org_apache_cxf_parse_mime_keyword_value_pairs(strings) {
+	var result = [];
+	for (var x = 1;x < strings.length; x = x + 1) {
+		var str = strings[x];
+		var valequal = str.indexOf("=");
+		if(valequal != -1) {
+			var k = str.substr(0, valequal);
+			var v = str.substr(valequal+1);
+			v = org_apache_cxf_trim_string(v);
+			if(v.charAt(0) == '"') {
+				v = v.substr(1, v.length-2);
+			}
+			if(v.charAt(0) == "'") {
+				v = v.substr(1, v.length-2);
+			}
+
+			result[org_apache_cxf_trim_string(k.toLowerCase())] = v;
+		}
+	}
+	return result;
+}
+
+function org_apache_cxf_regexp_escape(text) {
+	if (!arguments.callee.sRE) {
+		var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{',
+				'}', '\\'];
+		arguments.callee.sRE = new RegExp('(\\' + specials.join('|\\') + ')',
+				'g');
+	}
+	return text.replace(arguments.callee.sRE, '\\$1');
+}
+
+// Called when we don't have response XML.
+// returns true if we have multipart-related, false if we don't or can't parse
+// it.
+function org_apache_cxf_parse_multipart_related() {
+	var contentType = this.req.getResponseHeader("content-type");
+	if (!contentType)
+		return false; // not bloody likely.
+	var ctPart = contentType.split(/\s*;\s*/);
+	var ctMain = ctPart[0].toLowerCase();
+	if (ctMain != "multipart/related")
+		return false;
+	// now we have keyword-value pairs.
+	var params = org_apache_cxf_parse_mime_keyword_value_pairs(ctPart);
+	// there is a lot of noise we don't care about. all we really want is the
+	// boundary.
+	var boundary = params['boundary'];
+	if (!boundary)
+		return false;
+	boundary = "--" + boundary; // the annoying 'extra-dash' convention.
+	//var boundarySplitter = org_apache_cxf_regexp_escape(boundary);
+	var text = this.req.responseText;
+	// we are willing to use a lot of memory here.
+	var parts = text.split(boundary);
+	// now we have the parts.
+	// now we have to pull headers off the parts.
+	this.parts = [];
+	// the first one is noise due to the initial boundary. The last will just be -- due to MIME.
+	for (var px = 1;px < parts.length-1; px++) {
+		var seenOneHeader = false;
+		var x = 0; // misc index.
+		var parttext = parts[px];
+		var headers = [];
+		nextHeaderLine:
+		for(var endX = parttext.indexOf('\r', x); endX != -1; x = endX + 1, endX = parttext.indexOf('\r', x)) {
+			var headerLine = parttext.slice(x, endX);
+			if (headerLine == "") {
+				if (parttext.charAt(endX + 1) == '\n')
+					endX++;
+				if (seenOneHeader) {
+					break nextHeaderLine;
+				} else {
+					continue nextHeaderLine;
+				}
+			}
+			seenOneHeader = true;
+			var hparts = headerLine.split(":");
+			headers[hparts[0].toLowerCase()] = org_apache_cxf_trim_string(hparts[1]);
+			if (parttext.charAt(endX + 1) == '\n')
+				endX++;
+		} 
+		
+
+		// Now, see about the mime type (if any) and the ID.
+		var thispart = new Object(); // a constructor seems excessive.
+		// at exit, x indicates the start of the blank line.
+		if (parttext.charAt(x + 1) == '\n')
+			x = x + 1;
+		thispart.data = parttext.substr(x);
+		thispart.contentType = headers['content-type'];
+		if (px > 1) {
+			var cid = headers['content-id'];
+			// take of < and >
+			cid = cid.substr(1, cid.length-2);
+			thispart.cid = cid;
+			this.parts[cid] = thispart;
+		} else {
+			// the first part.
+			var doc;
+			if (window.ActiveXObject) {
+				doc = new ActiveXObject("Microsoft.XMLDOM");
+				doc.async = "false";
+				doc.loadXML(thispart.data);
+			} else {
+				var parser = new DOMParser();
+				doc = parser.parseFromString(thispart.data, "text/xml");
+			}
+			this.mpResponseXML = doc;
+		}
+	}
+	return true;
+
+}
+
+CxfApacheOrgClient.prototype.parseMultipartRelated = org_apache_cxf_parse_multipart_related;
+
+function org_apache_cxf_client_onReadyState() {
+	var req = this.req;
+	var ready = req.readyState;
+
+	this.utils.trace("onreadystatechange " + ready);
+
+	if (ready == this.READY_STATE_DONE) {
+		var httpStatus;
+		try {
+			httpStatus = req.status;
+		} catch (e) {
+			// Firefox throws when there was an error here.
+			this.utils
+					.trace("onreadystatechange DONE ERROR retrieving status (connection error?)");
+			if (this.onerror != null) {
+				this.onerror(e);
+			}
+			return;
+
+		}
+
+		this.utils.trace("onreadystatechange DONE " + httpStatus);
+
+		if (httpStatus == 200 || httpStatus == 0) {
+			if (this.onsuccess != null) {
+				// the onSuccess function is generated, and picks apart the
+				// response.
+				if (!req.responseXML) {
+					if (this.parseMultipartRelated()) {
+						this.onsuccess(this.mpResponseXML);
+						return;
+					}
+					if (this.onerror != null) {
+						this.onerror("Could not handle content of response.");
+						return;
+					}
+				}
+				this.onsuccess(req.responseXML);
+			}
+		} else {
+			this.utils.trace("onreadystatechange DONE ERROR "
+					+ req.getAllResponseHeaders() + " " + req.statusText + " "
+					+ req.responseText);
+			if (this.onerror != null)
+				this.onerror(this);
+		}
+	}
+}
+
+CxfApacheOrgClient.prototype.onReadyState = org_apache_cxf_client_onReadyState;
+
+function org_apache_cxf_package_mtom(value) {
+	var uuid = org_apache_cxf_make_uuid('v4');
+	var placeholder = '<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" '
+			+ 'href="cid:' + uuid + '" />';
+	var mtomObject = 'Content-Type: text/plain; charset="utf-8";\r\nContent-ID: <'
+			+ uuid + '>\r\n\r\n' + value + '\r\n';
+	this.client.mtomparts.push(mtomObject);
+	return placeholder;
+}
+
+CxfApacheOrgUtil.prototype.packageMtom = org_apache_cxf_package_mtom;
+
+// Holder object used for xs:any
+// The namespaceURI and localName identify the global element from the schema.
+// The object to go with it goes into object.
+// If the Any is an array, put the array into the object slot.
+
+function org_apache_cxf_any_holder(namespaceURI, localName, object) {
+	this.typeMarker = "org_apache_cxf_any_holder";
+	this.namespaceURI = namespaceURI;
+	this.localName = localName;
+	this.qname = "{" + namespaceURI + "}" + localName;
+	this.object = object;
+	this.raw = false;
+}
+
+// the following will simply dump the supplied XML into the message.
+function org_apache_cxf_raw_any_holder(xml) {
+	this.typeMarker = "org_apache_cxf_raw_any_holder";
+	this.xml = xml;
+	this.raw = true;
+	this.xsiType = false;
+}
+
+// The following will get an xsi:type attribute in addition to dumping the XML
+// into
+// the message.
+function org_apache_cxf_raw_typed_any_holder(namespaceURI, localName, xml) {
+	this.typeMarker = "org_apache_cxf_raw_any_holder";
+	this.namespaceURI = namespaceURI;
+	this.localName = localName;
+	this.xml = xml;
+	this.raw = true;
+	this.xsiType = true;
+}
+
+function org_apache_cxf_get_xsi_type(elementNode) {
+	var attributes = elementNode.attributes;
+	if ((attributes != null) && (attributes.length > 0)) {
+		for (var x = 0;x < attributes.length; x++) {
+			var attributeNodeName = attributes.item(x).nodeName;
+			var attributeNamespacePrefix = org_apache_cxf_getPrefix(attributes
+					.item(x).nodeName);
+			var attributeNamespaceSuffix = org_apache_cxf_getLocalName(attributes
+					.item(x).nodeName);
+			if (attributeNamespaceSuffix == 'type') {
+				// perhaps this is ours
+				var ns = org_apache_cxf_getNamespaceURI(elementNode,
+						attributeNamespacePrefix);
+				if (ns == org_apache_cxf_XSI_namespace_uri) {
+					return attributes.item(x).nodeValue;
+				}
+			}
+		}
+		return null;
+	}
+}
+
+// return the an object if we can deserialize an object, otherwise return the
+// element itself.
+function org_apache_cxf_deserialize_anyType(cxfjsutils, element) {
+	var type = org_apache_cxf_get_xsi_type(element);
+	if (type != null) {
+		// type is a :-qualified name.
+		var namespacePrefix = org_apache_cxf_getPrefix(type);
+		var localName = org_apache_cxf_getLocalName(type);
+		var uri = org_apache_cxf_getNamespaceURI(element, namespacePrefix);
+		if (uri == org_apache_cxf_XSD_namespace_uri) {
+			// we expect a Text node below
+			var textNode = element.firstChild;
+			if (textNode == null)
+				return null;
+			var text = textNode.nodeValue;
+			if (text == null)
+				return null;
+			// For any of the basic types, assume that the nodeValue is what the
+			// doctor ordered,
+			// converted to the appropriate type.
+			// For some of the more interesting types this needs more work.
+			if (localName == "int" || localName == "unsignedInt"
+					|| localName == "long" || localName == "unsignedLong") {
+				return parseInt(text);
+			}
+			if (localName == "float" || localName == "double")
+				return parseFloat(text);
+			if (localName == "boolean")
+				return text == 'true';
+			return text;
+		}
+		var qname = "{" + uri + "}" + localName;
+		var deserializer = cxfjsutils.interfaceObject.globalElementDeserializers[qname];
+		if (deserializer != null) {
+			return deserializer(cxfjsutils, element);
+		}
+	}
+	return element;
+}

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java Tue Jan 22 04:13:22 2008
@@ -143,6 +143,9 @@
             ScriptableObject.defineClass(rhinoScope, JsAssert.class);
             ScriptableObject.defineClass(rhinoScope, Trace.class);
             ScriptableObject.defineClass(rhinoScope, Notifier.class);
+            // so that the stock test for IE can gracefully fail.
+            rhinoContext.evaluateString(rhinoScope, "var window = new Object();", 
+                                        "<internal>", 0, null);
         } catch (IllegalAccessException e) {
             throw new RuntimeException(e);
         } catch (InstantiationException e) {

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomParser.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomParser.java (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsSimpleDomParser.java Tue Jan 22 04:13:22 2008
@@ -72,7 +72,7 @@
     
     //CHECKSTYLE:OFF
     
-    public Object jsFunction_parse(String xml, String mimeType) {
+    public Object jsFunction_parseFromString(String xml, String mimeType) {
         StringReader reader = new StringReader(xml);
         InputSource inputSource = new InputSource(reader);
         Document document;
@@ -86,12 +86,10 @@
         
         Context context = Context.enter();
         JsSimpleDomNode domNode = (JsSimpleDomNode)context.newObject(getParentScope(), "Node");
-        domNode.initialize(document.getDocumentElement(), null);
+        domNode.initialize(document, null);
         return domNode;
     }
-    
-    
-    
+
     //CHECKSTYLE:ON
 
 }

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/MtoMTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/MtoMTest.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/MtoMTest.java (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/MtoMTest.java Tue Jan 22 04:13:22 2008
@@ -22,15 +22,9 @@
 import java.io.IOException;
 import java.io.InputStream;
 
-import javax.activation.DataHandler;
-import javax.mail.util.ByteArrayDataSource;
-
 import org.apache.cxf.javascript.JavascriptTestUtilities.JSRunnable;
 import org.apache.cxf.javascript.JavascriptTestUtilities.Notifier;
-import org.apache.cxf.javascript.fortest.MtoM;
 import org.apache.cxf.javascript.fortest.MtoMImpl;
-import org.apache.cxf.javascript.fortest.MtoMParameterBeanNoDataHandler;
-import org.apache.cxf.javascript.fortest.MtoMParameterBeanWithDataHandler;
 import org.junit.Before;
 import org.junit.Test;
 import org.mozilla.javascript.Context;
@@ -86,41 +80,32 @@
         return null;
     }
 
-    @org.junit.Ignore
-    @Test
-    public void jaxwsClientExperimentExpectAutoBase64() throws Exception {
-        MtoM client = getBean(MtoM.class, "mtom-client");
-        assertNotNull(client);
-        MtoMParameterBeanNoDataHandler param = new MtoMParameterBeanNoDataHandler();
-        param.setOrdinary("blither<blather");
-        param.setNotXml10("<html>\u0027</html>");
-        client.receiveNonXmlNoDH(param);
-        MtoMParameterBeanNoDataHandler got = implementor.getLastBean();
-        assertEquals(param.getOrdinary(), got.getOrdinary());
-        assertEquals(param.getNotXml10(), got.getNotXml10());
+    private Void sendMtoMString(Context context) throws IOException {
+        Notifier notifier = 
+            testUtilities.rhinoCallConvert("testMtoMReply", Notifier.class, 
+                                           testUtilities.javaToJS(getAddress()));
+        boolean notified = notifier.waitForJavascript(1000 * 10);
+        assertTrue(notified);
+        Integer errorStatus = testUtilities.rhinoEvaluateConvert("globalErrorStatus", Integer.class);
+        String errorText = testUtilities.rhinoEvaluateConvert("globalErrorStatusText", String.class);
+        assertNull(errorStatus);
+        assertNull(errorText);
+        // read out the result string and check it.
+        return null;
     }
 
-    // doesn't run right in mvn, only a devo tool, anyhow.
-    @org.junit.Ignore
+    
     @Test
-    public void jaxwsClientExperiment() throws IOException {
-        MtoM client = getBean(MtoM.class, "mtom-client");
-        assertNotNull(client);
-        MtoMParameterBeanWithDataHandler param = new MtoMParameterBeanWithDataHandler();
-        param.setOrdinary("blither<blather");
-        byte[] notXmlBytes = "Hello\u0027Sailor".getBytes("utf-8");
-        DataHandler byteDataHandler = 
-            new DataHandler(new ByteArrayDataSource(notXmlBytes,
-                            "text/plain"));
-        param.setNotXml10(byteDataHandler);
-        client.receiveNonXmlDH(param);
-        MtoMParameterBeanWithDataHandler got = implementor.getLastDHBean();
-        InputStream dis = got.getNotXml10().getInputStream();
-        byte[] bytes = new byte[2048];
-        int byteCount = dis.read(bytes, 0, 2048);
-        String stuff = new String(bytes, 0, byteCount);
-        assertEquals(param.getOrdinary(), got.getOrdinary());
-        assertEquals("Hello\u0027Sailor", stuff);
+    public void sendMtoMStringTest() {
+        testUtilities.runInsideContext(Void.class, new JSRunnable<Void>() {
+            public Void run(Context context) {
+                try {
+                    return sendMtoMString(context);
+                } catch (IOException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        });
     }
     
     @Test

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/MtoM.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/MtoM.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/MtoM.java (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/MtoM.java Tue Jan 22 04:13:22 2008
@@ -31,4 +31,5 @@
 public interface MtoM {
     void receiveNonXmlDH(@WebParam(name = "theArg") MtoMParameterBeanWithDataHandler param);
     void receiveNonXmlNoDH(@WebParam(name = "theArg") MtoMParameterBeanNoDataHandler param);
+    MtoMParameterBeanWithDataHandler sendNonXmlDH();
 }

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/MtoMImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/MtoMImpl.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/MtoMImpl.java (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/MtoMImpl.java Tue Jan 22 04:13:22 2008
@@ -19,19 +19,45 @@
 
 package org.apache.cxf.javascript.fortest;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+
+import javax.activation.DataHandler;
 import javax.jws.WebService;
 import javax.xml.ws.soap.MTOM;
 
+import org.apache.cxf.helpers.IOUtils;
+
 /**
  * 
  */
 @org.apache.cxf.feature.Features(features = "org.apache.cxf.feature.LoggingFeature")   
 @WebService(targetNamespace = "uri:org.apache.cxf.javascript.fortest")
-@MTOM
+@MTOM(enabled = true, threshold = 0)
 public class MtoMImpl implements MtoM {
-    
+
+    private String returnData;
     private MtoMParameterBeanNoDataHandler lastBean;
     private MtoMParameterBeanWithDataHandler lastDHBean;
+    
+    public MtoMImpl() {
+        InputStream someData = 
+            getClass().getClassLoader().getResourceAsStream("org/apache/cxf/javascript/cxf-utils.js");
+        StringWriter sw = new StringWriter();
+        try {
+            InputStreamReader isr = new InputStreamReader(someData, "utf-8");
+            IOUtils.copy(isr, sw, 4096);
+            returnData = sw.toString();
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        
+    }
 
     public void reset() {
         lastBean = null;
@@ -56,5 +82,12 @@
 
     public void receiveNonXmlNoDH(MtoMParameterBeanNoDataHandler param) {
         lastBean = param;
+    }
+
+    public MtoMParameterBeanWithDataHandler sendNonXmlDH() {
+        MtoMParameterBeanWithDataHandler result = new MtoMParameterBeanWithDataHandler();
+        result.setOrdinary("ordinarius");
+        result.setNotXml10(new DataHandler(returnData, "text/plain;charset=utf-8"));
+        return result;
     }
 }

Modified: incubator/cxf/trunk/rt/javascript/src/test/resources/MtoMBeans.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/resources/MtoMBeans.xml?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/resources/MtoMBeans.xml (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/resources/MtoMBeans.xml Tue Jan 22 04:13:22 2008
@@ -32,7 +32,6 @@
   <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
   <import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
   <import resource="classpath:META-INF/cxf/cxf-extension-javascript-client.xml" />
-
               
  <jaxws:server id="mtom-service-endpoint" 
     address="http://localhost:8808/mtom" >

Modified: incubator/cxf/trunk/rt/javascript/src/test/resources/deserializationTests.js
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/resources/deserializationTests.js?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/resources/deserializationTests.js (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/resources/deserializationTests.js Tue Jan 22 04:13:22 2008
@@ -27,12 +27,12 @@
 function parseXml(xmlString) 
 {
 	var parser = new DOMParser();
-	return parser.parse(xmlString, "text/xml");
+	return parser.parseFromString(xmlString, "text/xml").documentElement;
 }
 
-function deserializeTestBean3_1(xml)
+function deserializeTestBean3_1(xmlString)
 {
-	var dom = parseXml(xml);
+	var dom = parseXml(xmlString);
 	var bean = org_apache_cxf_javascript_testns_testBean1_deserialize(jsutils, dom);
 	if(bean.getStringItem() != "bean1>stringItem")
 		assertionFailed("deserializeTestBean3_1 stringItem " + bean.getStringItem());

Modified: incubator/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/MtoMTests.js
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/MtoMTests.js?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/MtoMTests.js (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/MtoMTests.js Tue Jan 22 04:13:22 2008
@@ -59,3 +59,12 @@
 	service.receiveNonXmlDH(successCallback, errorCallback, param);
 	return globalNotifier;
 }
+
+function testMtoMReply(url) {
+	globalNotifier = new org_apache_cxf_notifier();
+
+	var service = new org_apache_cxf_javascript_fortest_MtoM();
+	service.url = url;
+	service.sendNonXmlDH(successCallback, errorCallback);
+	return globalNotifier;
+}

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java?rev=614186&r1=614185&r2=614186&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java Tue Jan 22 04:13:22 2008
@@ -31,7 +31,9 @@
 import org.apache.cxf.BusException;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.attachment.AttachmentDeserializer;
+import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxb.JAXBDataBinding;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.message.ExchangeImpl;
@@ -131,6 +133,7 @@
     @Test
     public void testURLBasedAttachment() throws Exception {
         JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+        JAXBDataBinding db = (JAXBDataBinding)sf.getDataBinding();
         sf.setServiceBean(new EchoService());
         sf.setBus(getBus());
         String address = "http://localhost:9036/EchoService";
@@ -138,7 +141,8 @@
         Map<String, Object> props = new HashMap<String, Object>();
         props.put(Message.MTOM_ENABLED, "true");
         sf.setProperties(props);
-        sf.create();
+        Server server = sf.create();
+        server.getEndpoint().getService().getDataBinding().setMtomThreshold(0);
         
         servStatic(getClass().getResource("mtom-policy.xml"), 
                    "http://localhost:9036/policy.xsd");



Mime
View raw message