[jboss-svn-commits] JBossWS SVN: r681 - in branches/jbossws-1.0.2.GA_JBWS-1122/src: main/java/org/jboss/ws/binding/soap main/java/org/jboss/ws/jaxb main/java/org/jboss/ws/metadata/wsdl main/java/org/jboss/ws/soap main/java/org/jboss/ws/soap/attachment main/java/org/jboss/ws/utils main/java/org/jboss/ws/xop test/java/org/jboss/test/ws test/java/org/jboss/test/ws/samples/mtom test/resources/samples-override/mtom/WEB-INF test/resources/samples-override/mtom/WEB-INF/wsdl

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Aug 4 03:56:09 EDT 2006


Author: heiko.braun at jboss.com
Date: 2006-08-04 03:55:48 -0400 (Fri, 04 Aug 2006)
New Revision: 681

Added:
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDLLocatorImpl.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java
Modified:
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/binding/soap/SOAPBindingProvider.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/jaxb/JBossXBSupport.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11DefinitionFactory.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitionsFactory.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/SOAPContentElement.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/attachment/ContentHandlerRegistry.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/utils/JavaUtils.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/utils/MimeUtils.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPContext.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/JBossWSTestHelper.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/JBossWSTestSetup.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPRpcTestCase.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPTest.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPTestImpl.java
   branches/jbossws-1.0.2.GA_JBWS-1122/src/test/resources/samples-override/mtom/WEB-INF/jaxrpc-mapping.xml
   branches/jbossws-1.0.2.GA_JBWS-1122/src/test/resources/samples-override/mtom/WEB-INF/wsdl/TestService.wsdl
Log:
Fix JBWS-1122

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/binding/soap/SOAPBindingProvider.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/binding/soap/SOAPBindingProvider.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/binding/soap/SOAPBindingProvider.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -613,12 +613,12 @@
 
       if (paramMetaData.isSwA())
       {
-         String swaCID = "<" + partName + "=" + cidGenerator.generateFromCount() + ">";
+         String swaCID = '<' + partName + "=" + cidGenerator.generateFromCount() + '>';
          part.setContentId(swaCID);
       }
       if (paramMetaData.isXOP())
       {
-         String xopCID = "<" + cidGenerator.generateFromName(partName) + ">";
+         String xopCID = '<' + cidGenerator.generateFromName(partName) + '>';
          part.setContentId(xopCID);
       }
 

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/jaxb/JBossXBSupport.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/jaxb/JBossXBSupport.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/jaxb/JBossXBSupport.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -112,6 +112,11 @@
    public static JBossEntityResolver createEntityResolver() {
       JBossEntityResolver resolver = new JBossEntityResolver();
       resolver.registerLocalEntity("http://www.w3.org/2005/08/addressing", "schema/ws-addr.xsd");      
+      resolver.registerLocalEntity("http://www.w3.org/XML/1998/namespace", "schema/xml.xsd"); 
+      resolver.registerLocalEntity("http://schemas.xmlsoap.org/ws/2004/09/policy", "schema/ws-policy.xsd");
+      resolver.registerLocalEntity("http://www.w3.org/2005/05/xmlmime", "schema/xml-media-types.xsd");
+      resolver.registerLocalEntity("http://schemas.xmlsoap.org/ws/2004/08/eventing", "schema/ws-eventing.xsd");
+      resolver.registerLocalEntity("http://schemas.xmlsoap.org/soap/encoding/", "schema/soap-encoding_1_1.xsd");      
       return resolver;
    }
 }

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11DefinitionFactory.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11DefinitionFactory.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11DefinitionFactory.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -24,18 +24,17 @@
 // $Id: WSDL11DefinitionFactory.java 275 2006-05-04 21:36:29Z jason.greene at jboss.com $
 
 import org.jboss.logging.Logger;
-import org.xml.sax.InputSource;
+import org.jboss.ws.jaxb.JBossXBSupport;
+import org.xml.sax.EntityResolver;
 
 import javax.wsdl.Definition;
 import javax.wsdl.WSDLException;
 import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLLocator;
 import javax.wsdl.xml.WSDLReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
 import java.net.URL;
 
+import com.ibm.wsdl.xml.WSDLReaderImpl;
+
 /**
  * A factory that creates a WSDL-1.1 <code>Definition</code> from an URL.
  *
@@ -83,116 +82,13 @@
       if (wsdlLocation == null)
          throw new IllegalArgumentException("URL cannot be null");
 
-      Definition wsdlDefinition = wsdlReader.readWSDL(new WSDLLocatorImpl(wsdlLocation));
-      return wsdlDefinition;
-   }
+      EntityResolver entityResolver = JBossXBSupport.createEntityResolver();
 
-   /* A WSDLLocator that can handle wsdl imports
-   */
-   public static class WSDLLocatorImpl implements WSDLLocator
-   {
-      private URL wsdlURL;
-      private String latestImportURI;
+      // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
+      ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
 
-      public WSDLLocatorImpl(URL wsdlFile)
-      {
-         if (wsdlFile == null)
-            throw new IllegalArgumentException("WSDL file argument cannot be null");
-
-         this.wsdlURL = wsdlFile;
-      }
-
-      public InputSource getBaseInputSource()
-      {
-         log.debug("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
-         try
-         {
-            InputStream is = wsdlURL.openStream();
-            if (is == null)
-               throw new IllegalArgumentException("Cannot obtain wsdl from [" + wsdlURL + "]");
-
-            return new InputSource(is);
-         }
-         catch (IOException e)
-         {
-            throw new RuntimeException("Cannot access wsdl from [" + wsdlURL + "], " + e.getMessage());
-         }
-      }
-
-      public String getBaseURI()
-      {
-         return wsdlURL.toExternalForm();
-      }
-
-      public InputSource getImportInputSource(String parent, String resource)
-      {
-         log.debug("getImportInputSource [parent=" + parent + ",resource=" + resource + "]");
-
-         URL parentURL = null;
-         try
-         {
-            parentURL = new URL(parent);
-         }
-         catch (MalformedURLException e)
-         {
-            log.error("Not a valid URL: " + parent);
-            return null;
-         }
-
-         String wsdlImport = null;
-         String external = parentURL.toExternalForm();
-
-         // An external URL
-         if (resource.startsWith("http://") || resource.startsWith("https://"))
-         {
-            wsdlImport = resource;
-         }
-
-         // Absolute path
-         else if (resource.startsWith("/"))
-         {
-            String beforePath = external.substring(0, external.indexOf(parentURL.getPath()));
-            wsdlImport = beforePath + resource;
-         }
-
-         // A relative path
-         else
-         {
-            String parentDir = external.substring(0, external.lastIndexOf("/"));
-
-            // remove references to current dir
-            while (resource.startsWith("./"))
-               resource = resource.substring(2);
-
-            // remove references to parentdir
-            while (resource.startsWith("../"))
-            {
-               parentDir = parentDir.substring(0, parentDir.lastIndexOf("/"));
-               resource = resource.substring(3);
-            }
-
-            wsdlImport = parentDir + "/" + resource;
-         }
-
-         try
-         {
-            log.debug("Resolved to: " + wsdlImport);
-            InputStream is = new URL(wsdlImport).openStream();
-            if (is == null)
-               throw new IllegalArgumentException("Cannot import wsdl from [" + wsdlImport + "]");
-
-            latestImportURI = wsdlImport;
-            return new InputSource(is);
-         }
-         catch (IOException e)
-         {
-            throw new RuntimeException("Cannot access imported wsdl [" + wsdlImport + "], " + e.getMessage());
-         }
-      }
-
-      public String getLatestImportURI()
-      {
-         return latestImportURI;
-      }
+      Definition wsdlDefinition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver,wsdlLocation));
+      return wsdlDefinition;
    }
+
 }

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitionsFactory.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitionsFactory.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitionsFactory.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -23,33 +23,25 @@
 
 // $Id$
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLLocator;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.parsers.DocumentBuilder;
-
+import com.ibm.wsdl.xml.WSDLReaderImpl;
 import org.jboss.logging.Logger;
 import org.jboss.util.xml.DOMUtils;
-import org.jboss.util.xml.JBossEntityResolver;
 import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
 import org.jboss.ws.jaxb.JBossXBSupport;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
 
-import com.ibm.wsdl.xml.WSDLReaderImpl;
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.parsers.DocumentBuilder;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * A factory that creates a <code>WSDLDefinitions</code> object from an URL.
@@ -214,123 +206,4 @@
       return defaultNamespace;
    }
 
-   /* A WSDLLocator that can handle wsdl imports
-   */
-   public static class WSDLLocatorImpl implements WSDLLocator
-   {
-      private EntityResolver entityResolver;
-      private URL wsdlURL;
-      private String latestImportURI;
-
-      public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlFile)
-      {
-         if (wsdlFile == null)
-            throw new IllegalArgumentException("WSDL file argument cannot be null");
-
-         this.entityResolver = entityResolver;
-         this.wsdlURL = wsdlFile;
-      }
-
-      public InputSource getBaseInputSource()
-      {
-         log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
-         try
-         {
-            InputStream is = wsdlURL.openStream();
-            if (is == null)
-               throw new IllegalArgumentException("Cannot obtain wsdl from [" + wsdlURL + "]");
-
-            return new InputSource(is);
-         }
-         catch (IOException e)
-         {
-            throw new RuntimeException("Cannot access wsdl from [" + wsdlURL + "], " + e.getMessage());
-         }
-      }
-
-      public String getBaseURI()
-      {
-         return wsdlURL.toExternalForm();
-      }
-
-      public InputSource getImportInputSource(String parent, String resource)
-      {
-         log.trace("getImportInputSource [parent=" + parent + ",resource=" + resource + "]");
-
-         URL parentURL = null;
-         try
-         {
-            parentURL = new URL(parent);
-         }
-         catch (MalformedURLException e)
-         {
-            log.error("Not a valid URL: " + parent);
-            return null;
-         }
-
-         String wsdlImport = null;
-         String external = parentURL.toExternalForm();
-
-         // An external URL
-         if (resource.startsWith("http://") || resource.startsWith("https://"))
-         {
-            wsdlImport = resource;
-         }
-
-         // Absolute path
-         else if (resource.startsWith("/"))
-         {
-            String beforePath = external.substring(0, external.indexOf(parentURL.getPath()));
-            wsdlImport = beforePath + resource;
-         }
-
-         // A relative path
-         else
-         {
-            String parentDir = external.substring(0, external.lastIndexOf("/"));
-
-            // remove references to current dir
-            while (resource.startsWith("./"))
-               resource = resource.substring(2);
-
-            // remove references to parentdir
-            while (resource.startsWith("../"))
-            {
-               parentDir = parentDir.substring(0, parentDir.lastIndexOf("/"));
-               resource = resource.substring(3);
-            }
-
-            wsdlImport = parentDir + "/" + resource;
-         }
-
-         try
-         {
-            log.trace("Trying to resolve: " + wsdlImport);
-            InputSource inputSource = entityResolver.resolveEntity(wsdlImport, wsdlImport);
-            if (inputSource != null)
-            {
-               latestImportURI = wsdlImport;
-            }
-            else
-            {
-               throw new IllegalArgumentException("Cannot resolve imported resource: " + wsdlImport);
-            }
-            
-            return inputSource;
-         }
-         catch (RuntimeException rte)
-         {
-            throw rte;
-         }
-         catch (Exception e)
-         {
-            throw new WSException("Cannot access imported wsdl [" + wsdlImport + "], " + e.getMessage());
-         }
-      }
-
-      public String getLatestImportURI()
-      {
-         return latestImportURI;
-      }
-   }
 }

Added: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDLLocatorImpl.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDLLocatorImpl.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDLLocatorImpl.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -0,0 +1,155 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.wsdl;
+
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.jboss.ws.WSException;
+import org.jboss.logging.Logger;
+
+import javax.wsdl.xml.WSDLLocator;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.io.InputStream;
+import java.io.IOException;
+
+/* A WSDLLocator that can handle wsdl imports
+   */
+class WSDLLocatorImpl implements WSDLLocator
+{
+   private static final Logger log = Logger.getLogger(WSDLLocatorImpl.class);
+
+   private EntityResolver entityResolver;
+   private URL wsdlURL;
+   private String latestImportURI;
+
+   public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlFile)
+   {
+      if (wsdlFile == null)
+         throw new IllegalArgumentException("WSDL file argument cannot be null");
+
+      this.entityResolver = entityResolver;
+      this.wsdlURL = wsdlFile;
+   }
+
+   public InputSource getBaseInputSource()
+   {
+      log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
+      try
+      {
+         InputStream is = wsdlURL.openStream();
+         if (is == null)
+            throw new IllegalArgumentException("Cannot obtain wsdl from [" + wsdlURL + "]");
+
+         return new InputSource(is);
+      }
+      catch (IOException e)
+      {
+         throw new RuntimeException("Cannot access wsdl from [" + wsdlURL + "], " + e.getMessage());
+      }
+   }
+
+   public String getBaseURI()
+   {
+      return wsdlURL.toExternalForm();
+   }
+
+   public InputSource getImportInputSource(String parent, String resource)
+   {
+      log.trace("getImportInputSource [parent=" + parent + ",resource=" + resource + "]");
+
+      URL parentURL = null;
+      try
+      {
+         parentURL = new URL(parent);
+      }
+      catch (MalformedURLException e)
+      {
+         log.error("Not a valid URL: " + parent);
+         return null;
+      }
+
+      String wsdlImport = null;
+      String external = parentURL.toExternalForm();
+
+      // An external URL
+      if (resource.startsWith("http://") || resource.startsWith("https://"))
+      {
+         wsdlImport = resource;
+      }
+
+      // Absolute path
+      else if (resource.startsWith("/"))
+      {
+         String beforePath = external.substring(0, external.indexOf(parentURL.getPath()));
+         wsdlImport = beforePath + resource;
+      }
+
+      // A relative path
+      else
+      {
+         String parentDir = external.substring(0, external.lastIndexOf("/"));
+
+         // remove references to current dir
+         while (resource.startsWith("./"))
+            resource = resource.substring(2);
+
+         // remove references to parentdir
+         while (resource.startsWith("../"))
+         {
+            parentDir = parentDir.substring(0, parentDir.lastIndexOf("/"));
+            resource = resource.substring(3);
+         }
+
+         wsdlImport = parentDir + "/" + resource;
+      }
+
+      try
+      {
+         log.trace("Trying to resolve: " + wsdlImport);
+         InputSource inputSource = entityResolver.resolveEntity(wsdlImport, wsdlImport);
+         if (inputSource != null)
+         {
+            latestImportURI = wsdlImport;
+         }
+         else
+         {
+            throw new IllegalArgumentException("Cannot resolve imported resource: " + wsdlImport);
+         }
+
+         return inputSource;
+      }
+      catch (RuntimeException rte)
+      {
+         throw rte;
+      }
+      catch (Exception e)
+      {
+         throw new WSException("Cannot access imported wsdl [" + wsdlImport + "], " + e.getMessage());
+      }
+   }
+
+   public String getLatestImportURI()
+   {
+      return latestImportURI;
+   }
+}


Property changes on: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/metadata/wsdl/WSDLLocatorImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/SOAPContentElement.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/SOAPContentElement.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/SOAPContentElement.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -26,6 +26,7 @@
 import org.jboss.util.xml.DOMWriter;
 import org.jboss.ws.Constants;
 import org.jboss.ws.WSException;
+import org.jboss.ws.xop.XOPUnmarshallerImpl;
 import org.jboss.ws.binding.BindingException;
 import org.jboss.ws.jaxrpc.TypeMappingImpl;
 import org.jboss.ws.jaxrpc.encoding.*;
@@ -39,10 +40,12 @@
 import javax.xml.soap.Name;
 import javax.xml.soap.SOAPElement;
 import javax.xml.soap.SOAPException;
+import javax.activation.DataHandler;
 import java.lang.reflect.Array;
 import java.lang.reflect.Method;
 import java.util.Iterator;
 import java.io.ByteArrayInputStream;
+import java.io.IOException;
 
 /**
  * A SOAPElement that gives access to its content as XML fragment or Java object.
@@ -264,16 +267,23 @@
 
                if (isAssignable == false)
                {
-                  // MSFT hack
+                  // MSFT hack: Force conversion according to the target java parameter
                   Object convertedObj = null;
-                  if(obj instanceof ByteArrayInputStream)
+                  if(obj instanceof DataHandler)
                   {
                     MimeUtils utils = new MimeUtils();
                     MimeUtils.ByteArrayConverter converter = utils.getConverterFor(javaType);
-                    convertedObj = converter.convert( (ByteArrayInputStream)obj );
+                     try
+                     {
+                        convertedObj = converter.convert( ((DataHandler)obj).getInputStream() );
+                     }
+                     catch (IOException e)
+                     {
+                        log.warn("Failed to convert from DataHandler", e);
+                     }
                   }
 
-                  if(null == convertedObj) // conversion failed
+                  if(null == convertedObj || !JavaUtils.isAssignableFrom(javaType, convertedObj.getClass()) ) // conversion failed
                   {
                      throw new WSException("Java type '" + javaType + "' is not assignable from: " + objType.getName());
                   }

Added: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.soap.attachment;
+
+import org.jboss.ws.WSException;
+
+import javax.activation.DataContentHandler;
+import javax.activation.DataSource;
+import javax.activation.ActivationDataFlavor;
+import javax.xml.transform.stream.StreamSource;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.ByteArrayInputStream;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.UnsupportedFlavorException;
+
+/**
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ * @version $Id$
+ * @since Jul 31, 2006
+ */
+public class ByteArrayContentHandler implements DataContentHandler {
+
+   private DataFlavor[] flavors = new ActivationDataFlavor[]
+   {
+         new ActivationDataFlavor(ByteArrayInputStream.class, "application/octet-stream", "OCTETS"),
+   };
+
+   public Object getContent(DataSource dataSource) throws IOException {
+      return dataSource.getInputStream();
+   }
+
+   public Object getTransferData(DataFlavor dataFlavor, DataSource dataSource) throws UnsupportedFlavorException, IOException {
+      return getContent(dataSource);
+   }
+
+   public DataFlavor[] getTransferDataFlavors() {
+      return flavors;
+   }
+
+   public void writeTo(Object object, String string, OutputStream outputStream) throws IOException {
+      throw new WSException("The current implementation is read-only");
+   }
+}


Property changes on: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/attachment/ContentHandlerRegistry.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/attachment/ContentHandlerRegistry.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/soap/attachment/ContentHandlerRegistry.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -49,6 +49,7 @@
    {
       addRegistryEntry(XmlDataContentHandler.class);
       addRegistryEntry(ImageDataContentHandler.class);
+      addRegistryEntry(ByteArrayContentHandler.class);
       addRegistryEntry(text_plain.class);
       addRegistryEntry(text_html.class);
       addRegistryEntry(multipart_mixed.class);

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/utils/JavaUtils.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/utils/JavaUtils.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/utils/JavaUtils.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -27,7 +27,6 @@
 import java.util.HashMap;
 
 import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.wsdl.WSDLUtils;
 
 /** Java utilities
  *

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/utils/MimeUtils.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/utils/MimeUtils.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/utils/MimeUtils.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -25,22 +25,21 @@
 
 
 
-import java.util.Set;
-import java.util.Map;
-import java.util.HashMap;
-import java.io.ByteArrayInputStream;
-import java.awt.image.BufferedImage;
+import com.sun.image.codec.jpeg.JPEGCodec;
+import com.sun.image.codec.jpeg.JPEGImageDecoder;
+import org.jboss.ws.Constants;
 
 import javax.mail.internet.ContentType;
-import javax.mail.internet.ParseException;
 import javax.mail.internet.MimeMultipart;
+import javax.mail.internet.ParseException;
 import javax.xml.namespace.QName;
 import javax.xml.transform.stream.StreamSource;
+import java.awt.image.BufferedImage;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
 
-import org.jboss.ws.Constants;
-import com.sun.image.codec.jpeg.JPEGImageDecoder;
-import com.sun.image.codec.jpeg.JPEGCodec;
-
 /**
  * Generic mime utility class.
  *
@@ -188,7 +187,7 @@
 
    public class ImageConverter implements ByteArrayConverter
    {
-      public Object convert(ByteArrayInputStream in) {
+      public Object convert(InputStream in) {
          Object converted = null;
          try
          {
@@ -208,7 +207,7 @@
 
    public class SourceConverter implements ByteArrayConverter
    {
-      public Object convert(ByteArrayInputStream in) {
+      public Object convert(InputStream in) {
 
          Object converted = null;
          try
@@ -226,7 +225,7 @@
 
    public class StringConverter implements ByteArrayConverter
    {
-      public Object convert(ByteArrayInputStream in) {
+      public Object convert(InputStream in) {
          Object converted = null;
          try
          {
@@ -248,7 +247,7 @@
 
    public interface ByteArrayConverter
    {
-      Object convert(ByteArrayInputStream in);
+      Object convert(InputStream in);
    }
 
 

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPContext.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPContext.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPContext.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -135,7 +135,7 @@
       }
       else if(o instanceof String)
       {
-         dataHandler = new DataHandler(o, "text/xml");
+         dataHandler = new DataHandler(o, "text/plain");
       }
       else if(o instanceof DataHandler)
       {

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -27,6 +27,7 @@
 import org.jboss.ws.soap.SOAPMessageContextImpl;
 import org.jboss.ws.soap.SOAPMessageImpl;
 import org.jboss.ws.soap.attachment.MimeConstants;
+import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
 import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
 import org.jboss.xb.binding.sunday.xop.XOPObject;
 
@@ -51,6 +52,11 @@
 
    private static final Logger log = Logger.getLogger(XOPMarshallerImpl.class);
 
+   static
+   {
+      // Load JAF content handlers
+      ContentHandlerRegistry.register();
+   }
    public boolean isXOPPackage()
    {
       return XOPContext.isXOPPackage();

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -26,14 +26,16 @@
 import org.jboss.ws.soap.MessageContextAssociation;
 import org.jboss.ws.soap.SOAPMessageContextImpl;
 import org.jboss.ws.soap.SOAPMessageImpl;
+import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
+import org.jboss.xb.binding.sunday.xop.XOPObject;
 import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
-import org.jboss.xb.binding.sunday.xop.XOPObject;
 
 import javax.activation.DataHandler;
 import javax.xml.soap.AttachmentPart;
 import javax.xml.soap.SOAPException;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
 
 /**
  * The XOPUnmarshallerImpl allows callbacks from the binding layer towards the
@@ -51,6 +53,11 @@
 
    private static final Logger log = Logger.getLogger(XOPUnmarshallerImpl.class);
 
+   static
+   {
+      // Load JAF content handlers
+      ContentHandlerRegistry.register();
+   }
    public boolean isXOPPackage()
    {
       return XOPContext.isXOPPackage();
@@ -62,7 +69,17 @@
       {
          AttachmentPart part = getAttachementByCID(cid);
 
-         XOPObject xopObject = new XOPObject(part.getDataHandler().getContent());
+         // Let JAF do the conversion
+         Object content = part.getDataHandler().getContent();
+
+         if(content instanceof InputStream)
+         {
+            // JAF doesn't know the content-type
+            // In this case we pass along the DataHandler
+            content = part.getDataHandler();
+         }
+
+         XOPObject xopObject = new XOPObject(content);
          xopObject.setContentType(part.getDataHandler().getContentType());
 
          return xopObject;

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/JBossWSTestHelper.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/JBossWSTestHelper.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/JBossWSTestHelper.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -93,7 +93,7 @@
    }
 
    /** Try to discover the URL for the deployment archive */
-   private URL getArchiveURL(String archive) throws MalformedURLException
+   public URL getArchiveURL(String archive) throws MalformedURLException
    {
       URL url = null;
       try

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/JBossWSTestSetup.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/JBossWSTestSetup.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/JBossWSTestSetup.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -25,6 +25,10 @@
 import junit.framework.TestSuite;
 
 import java.util.StringTokenizer;
+import java.util.List;
+import java.util.ArrayList;
+import java.net.URLClassLoader;
+import java.net.URL;
 
 /**
  * A test setup that deploys/undeploys archives
@@ -55,6 +59,8 @@
 
    protected void setUp() throws Exception
    {
+      List clientJars = new ArrayList();
+
       for (int i = 0; i < archives.length; i++)
       {
          String archive = archives[i];
@@ -71,7 +77,26 @@
                delegate.undeploy(archive);
             }
          }
+
+         if (isJ2EEClient)
+         {
+            URL archiveURL = delegate.getArchiveURL(archive);
+            clientJars.add(archiveURL);
+         }
       }
+
+      // add the client jars to the classloader
+      if( !clientJars.isEmpty() )
+      {
+         ClassLoader parent = Thread.currentThread().getContextClassLoader();
+         URL[] urls = new URL[clientJars.size()];
+         for(int i=0; i<clientJars.size(); i++)
+         {
+            urls[i] = (URL)clientJars.get(i);
+         }
+         URLClassLoader cl = new URLClassLoader(urls, parent);
+         Thread.currentThread().setContextClassLoader(cl);
+      }
    }
 
    protected void tearDown() throws Exception

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPRpcTestCase.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPRpcTestCase.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPRpcTestCase.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -24,30 +24,26 @@
 import junit.framework.Test;
 import org.jboss.test.ws.JBossWSTest;
 import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.test.ws.samples.message.MessageTestService;
 import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
 
 import javax.activation.DataHandler;
-import javax.activation.DataSource;
 import javax.activation.FileDataSource;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMultipart;
 import javax.naming.InitialContext;
 import javax.xml.namespace.QName;
 import javax.xml.rpc.Service;
 import javax.xml.rpc.Stub;
-import javax.xml.transform.stream.StreamSource;
 import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
 import java.awt.*;
-import java.awt.image.PixelGrabber;
-import java.awt.image.MemoryImageSource;
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
 import java.net.URL;
 
 /**
  * Test SOAP with XOP through the JAXRPC dynamic proxy layer.
  *
  * @author Thomas.Diesler at jboss.org
+ * @author Heiko.Braun at jboss.org
  * @since 18-Jan-2006
  */
 public class XOPRpcTestCase extends JBossWSTest
@@ -82,12 +78,15 @@
             port = (XOPTest)service.getPort(XOPTest.class);
             ((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jbossws-samples-mtom");
          }
+
       }
+
+      //((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8081/jbossws-samples-mtom");
    }
 
-   /** Send a multipart message with a text/plain attachment part
+   /** Send a multipart message with a image/gif attachment part
     */
-   public void testSendMimeImageGIF() throws Exception
+   /*public void testSendMimeImageGIF() throws Exception
    {
       URL url = new File("resources/samples/mtom/attach.gif").toURL();
 
@@ -110,23 +109,40 @@
          assertNotNull(value);
          assertTrue("Wrong return value type", value instanceof Image);
       }
+   } */
+
+   /** Send unknown file that actually is converted into a DataHandler
+    */
+   public void testSendOctets() throws Exception
+   {
+      Object value = port.sendOctets("Some text message", new DataHandler(
+          new FileDataSource("resources/samples/mtom/disguised_jpeg.xcf")
+      ));
+      assertNotNull(value);
+      assertTrue("Wrong return value type", value instanceof DataHandler);
    }
 
-   /** Send uknown file that actually is a jpeg that will turns into octet-stream
+   /**
+    * A disguised element is send when the actual SEI java parameter
+    * doesn't map with the content-type set on the mimepart.
+    * .NET loves do this...
+    *
+    * In this case we try to 'force' convert that object according to
+    * the expected java parameter.
+    *
+    * @throws Exception
+    * @see org.jboss.ws.soap.SOAPContentElement#getObjectValue()
     */
    public void testSendDisguised() throws Exception
    {
-      /*Object value = port.sendMimeImageGIF("Some text message", new DataHandler(
+      Object value = port.sendMimeImageGIF("Some text message", new DataHandler(
           new FileDataSource("resources/samples/mtom/disguised_jpeg.xcf")
       ));
       assertNotNull(value);
       assertTrue("Wrong return value type", value instanceof Image);
-      */
-
-      System.out.println("FIXME: testSendDisguised");
    }
 
-   /** Send a multipart message with a text/plain attachment part
+   /** Send a multipart message with a image/jpeg attachment part
     */
   public void testSendMimeImageJPEG() throws Exception
    {
@@ -157,13 +173,11 @@
     */
    public void testSendMimeTextPlain() throws Exception
    {
-      //String value = port.sendMimeTextPlain("Some text message", "This is a plain text attachment.");
-      //assertNotNull(value);
-
-      System.out.println("FIXME 'testSendMimeTextPlain()'");
+      String value = port.sendMimeTextPlain("Some text message", "This is a plain text attachment.");
+      assertNotNull(value);
    }
 
-   /** Send a multipart message with a text/plain attachment part
+   /** Send a multipart message with a multipart attachment part
     */
    public void testSendMimeMultipart() throws Exception
    {
@@ -183,7 +197,7 @@
       System.out.println("FIXME 'testSendMimeMultipart()'");
    }
 
-   /** Send a multipart message with a text/plain attachment part
+   /** Send a multipart message with a text/xml attachment part
     */
   public void testSendMimeTextXML() throws Exception
    {
@@ -195,7 +209,7 @@
       assertTrue("Wrong return value type", value instanceof Source);
    }
 
-   /** Send a multipart message with a text/plain attachment part
+   /** Send a multipart message with a application/xml attachment part
     */
    public void testSendMimeApplicationXML() throws Exception
    {
@@ -206,48 +220,4 @@
       assertNotNull(value);
       assertTrue("Wrong return value type", value instanceof Source);
    }
-
-   private class ObjectDataSource implements DataSource
-   {
-      private Object obj;
-      private byte[] bytes;
-
-      public ObjectDataSource(Object obj) {
-
-         if(! (obj instanceof Serializable) )
-            throw new IllegalArgumentException("Object must be serializable");
-
-         this.obj = obj;
-
-         try
-         {
-            ByteArrayOutputStream bout = new ByteArrayOutputStream();
-            ObjectOutputStream os = new ObjectOutputStream(bout);
-            os.writeObject(obj);
-            this.bytes = bout.toByteArray();
-         }
-         catch (Exception e)
-         {
-            throw new IllegalStateException(e.getMessage());
-         }
-      }
-
-      public String getContentType() {
-         return "application/octet-stream";
-      }
-
-      public InputStream getInputStream() throws IOException {
-         ByteArrayInputStream in = new ByteArrayInputStream(bytes);
-         return new ObjectInputStream(in);
-      }
-
-      public String getName() {
-         return obj.getClass().getName();
-      }
-
-      public OutputStream getOutputStream() throws IOException {
-         ByteArrayOutputStream out = new ByteArrayOutputStream();
-         return new ObjectOutputStream(out) ;
-      }
-   }
 }

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPTest.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPTest.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPTest.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -27,6 +27,7 @@
 
 import javax.mail.internet.MimeMultipart;
 import javax.xml.transform.Source;
+import javax.activation.DataHandler;
 
 /**
  * Service Endpoint Interface for XOP
@@ -66,4 +67,6 @@
    /** Service endpoint method for application/xml
     */
    Object sendMimeApplicationXML(String message, Source xoppart) throws RemoteException;
+
+   DataHandler sendOctets(String message, DataHandler xoppart) throws RemoteException;
 }

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPTestImpl.java
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPTestImpl.java	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/test/java/org/jboss/test/ws/samples/mtom/XOPTestImpl.java	2006-08-04 07:55:48 UTC (rev 681)
@@ -30,6 +30,7 @@
 import javax.xml.soap.AttachmentPart;
 import javax.xml.soap.SOAPMessage;
 import javax.xml.transform.Source;
+import javax.activation.DataHandler;
 import java.awt.*;
 import java.rmi.RemoteException;
 import java.util.Iterator;
@@ -132,6 +133,16 @@
       return xoppart;
    }
 
+   public DataHandler sendOctets(String message, DataHandler xoppart) throws RemoteException {
+      StringBuffer buffer = new StringBuffer();
+      validateStringMessage(buffer, message);
+
+      String expContentType = "application/octet-stream";
+      validateAttachmentPart(buffer, expContentType, xoppart);
+
+      return xoppart;
+   }
+
    private void validateStringMessage(StringBuffer buffer, String message)
    {
       if ("Some text message".equals(message) == false)
@@ -221,6 +232,11 @@
             if ((content instanceof Source) == false)
                buffer.append("[content=" + content + "]");
          }
+         else if (contentType.equals("application/octet-stream") )
+         {
+            if ((content instanceof DataHandler) == false)
+               buffer.append("[content=" + content + "]");
+         }
          else
          {
             throw new IllegalArgumentException("Unsupported mime type: " + contentType);

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/test/resources/samples-override/mtom/WEB-INF/jaxrpc-mapping.xml
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/test/resources/samples-override/mtom/WEB-INF/jaxrpc-mapping.xml	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/test/resources/samples-override/mtom/WEB-INF/jaxrpc-mapping.xml	2006-08-04 07:55:48 UTC (rev 681)
@@ -204,5 +204,40 @@
         <wsdl-message-part-name>result</wsdl-message-part-name>
       </wsdl-return-value-mapping>
     </service-endpoint-method-mapping>
+
+     <service-endpoint-method-mapping>
+        <java-method-name>sendOctets</java-method-name>
+        <wsdl-operation>sendOctets</wsdl-operation>
+        <method-param-parts-mapping>
+           <param-position>0</param-position>
+           <param-type>java.lang.String</param-type>
+           <wsdl-message-mapping>
+              <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeApplicationXML</wsdl-message>
+              <wsdl-message-part-name>message</wsdl-message-part-name>
+              <parameter-mode>IN</parameter-mode>
+           </wsdl-message-mapping>
+        </method-param-parts-mapping>
+
+        <!-- BEGIN manual modification -->
+        <method-param-parts-mapping>
+           <param-position>1</param-position>
+           <param-type>javax.activation.DataHandler</param-type>
+           <wsdl-message-mapping>
+              <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeApplicationXML</wsdl-message>
+              <wsdl-message-part-name>xoppart</wsdl-message-part-name>
+              <parameter-mode>IN</parameter-mode>
+           </wsdl-message-mapping>
+        </method-param-parts-mapping>
+        <!-- END manual modification -->
+
+        <wsdl-return-value-mapping>
+           <method-return-value>javax.activation.DataHandler</method-return-value>
+           <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeApplicationXMLResponse</wsdl-message>
+           <wsdl-message-part-name>result</wsdl-message-part-name>
+        </wsdl-return-value-mapping>
+     </service-endpoint-method-mapping>
+
   </service-endpoint-interface-mapping>
+
+
 </java-wsdl-mapping>
\ No newline at end of file

Modified: branches/jbossws-1.0.2.GA_JBWS-1122/src/test/resources/samples-override/mtom/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- branches/jbossws-1.0.2.GA_JBWS-1122/src/test/resources/samples-override/mtom/WEB-INF/wsdl/TestService.wsdl	2006-08-03 21:04:42 UTC (rev 680)
+++ branches/jbossws-1.0.2.GA_JBWS-1122/src/test/resources/samples-override/mtom/WEB-INF/wsdl/TestService.wsdl	2006-08-04 07:55:48 UTC (rev 681)
@@ -6,8 +6,8 @@
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
 
-  <types>
-      <schema xmlns="http://www.w3.org/2001/XMLSchema"              
+   <types>
+      <schema xmlns="http://www.w3.org/2001/XMLSchema"
               targetNamespace="http://org.jboss.ws/samples/mtom"
               xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
 
@@ -19,6 +19,7 @@
          <element name="multipart" xmime:contentType="multipart/*" type="xmime:base64Binary"/>
          <element name="textxml" xmime:contentType="text/xml" type="xmime:base64Binary"/>
          <element name="applxml" xmime:contentType="application/xml" type="xmime:base64Binary"/>
+         <element name="octets" xmime:contentType="application/octet-stream" type="xmime:base64Binary"/>
 
          <complexType name="XOPBinary" >
             <simpleContent>
@@ -27,143 +28,163 @@
                </extension>
             </simpleContent>
          </complexType>
-    </schema>
-  </types>
+      </schema>
+   </types>
 
-  <message name="XOPTest_sendMimeImageGIF">
-    <part name="message" type="xsd:string"/>
+   <message name="XOPTest_sendMimeImageGIF">
+      <part name="message" type="xsd:string"/>
       <part name="xoppart" element="tns:imagegif"/>
-  </message>
-  <message name="XOPTest_sendMimeImageGIFResponse">
+   </message>
+   <message name="XOPTest_sendMimeImageGIFResponse">
       <part name="result" element="tns:imagegif"/>
-  </message>
+   </message>
 
-  <message name="XOPTest_sendMimeImageJPEG">
-    <part name="message" type="xsd:string"/>
-    <part name="xoppart" element="tns:imagejpeg"/>
-  </message>
-  <message name="XOPTest_sendMimeImageJPEGResponse">
-    <part name="result" element="tns:imagejpeg"/>
-  </message>
-  <message name="XOPTest_sendMimeTextPlain">
-    <part name="message" type="xsd:string"/>
-    <part name="xoppart" element="tns:textplain"/>
-  </message>
-  <message name="XOPTest_sendMimeTextPlainResponse">
-    <part name="result" element="tns:textplain"/>
-  </message>
-  <message name="XOPTest_sendMimeMultipart">
-    <part name="message" type="xsd:string"/>
-    <part name="xoppart" element="tns:multipart"/>
-  </message>
-  <message name="XOPTest_sendMimeMultipartResponse">
-    <part name="result" element="tns:multipart"/>
-  </message>
-  <message name="XOPTest_sendMimeTextXML">
-    <part name="message" type="xsd:string"/>
-    <part name="xoppart" element="tns:textxml"/>
-  </message>
-  <message name="XOPTest_sendMimeTextXMLResponse">
-    <part name="result" element="tns:textxml"/>
-  </message>
-  <message name="XOPTest_sendMimeApplicationXML">
-    <part name="message" type="xsd:string"/>
-    <part name="xoppart" element="tns:applxml"/>
-  </message>
-  <message name="XOPTest_sendMimeApplicationXMLResponse">
-    <part name="result" element="tns:applxml"/>
-  </message>
+   <message name="XOPTest_sendMimeImageJPEG">
+      <part name="message" type="xsd:string"/>
+      <part name="xoppart" element="tns:imagejpeg"/>
+   </message>
+   <message name="XOPTest_sendMimeImageJPEGResponse">
+      <part name="result" element="tns:imagejpeg"/>
+   </message>
+   <message name="XOPTest_sendMimeTextPlain">
+      <part name="message" type="xsd:string"/>
+      <part name="xoppart" element="tns:textplain"/>
+   </message>
+   <message name="XOPTest_sendMimeTextPlainResponse">
+      <part name="result" element="tns:textplain"/>
+   </message>
+   <message name="XOPTest_sendMimeMultipart">
+      <part name="message" type="xsd:string"/>
+      <part name="xoppart" element="tns:multipart"/>
+   </message>
+   <message name="XOPTest_sendMimeMultipartResponse">
+      <part name="result" element="tns:multipart"/>
+   </message>
+   <message name="XOPTest_sendMimeTextXML">
+      <part name="message" type="xsd:string"/>
+      <part name="xoppart" element="tns:textxml"/>
+   </message>
+   <message name="XOPTest_sendMimeTextXMLResponse">
+      <part name="result" element="tns:textxml"/>
+   </message>
+   <message name="XOPTest_sendMimeApplicationXML">
+      <part name="message" type="xsd:string"/>
+      <part name="xoppart" element="tns:applxml"/>
+   </message>
+   <message name="XOPTest_sendMimeApplicationXMLResponse">
+      <part name="result" element="tns:applxml"/>
+   </message>
 
-  <portType name="XOPTest">
-    <operation name="sendMimeImageGIF">
-      <input message="tns:XOPTest_sendMimeImageGIF"/>
-      <output message="tns:XOPTest_sendMimeImageGIFResponse"/>
-    </operation>
-    <operation name="sendMimeImageJPEG">
-      <input message="tns:XOPTest_sendMimeImageJPEG"/>
-      <output message="tns:XOPTest_sendMimeImageJPEGResponse"/>
-    </operation>
-    <operation name="sendMimeTextPlain">
-      <input message="tns:XOPTest_sendMimeTextPlain"/>
-      <output message="tns:XOPTest_sendMimeTextPlainResponse"/>
-    </operation>
-    <operation name="sendMimeMultipart">
-      <input message="tns:XOPTest_sendMimeMultipart"/>
-      <output message="tns:XOPTest_sendMimeMultipartResponse"/>
-    </operation>
-    <operation name="sendMimeTextXML">
-      <input message="tns:XOPTest_sendMimeTextXML"/>
-      <output message="tns:XOPTest_sendMimeTextXMLResponse"/>
-    </operation>
-    <operation name="sendMimeApplicationXML">
-      <input message="tns:XOPTest_sendMimeApplicationXML"/>
-      <output message="tns:XOPTest_sendMimeApplicationXMLResponse"/>
-    </operation>
+   <message name="XOPTest_sendOctets">
+      <part name="message" type="xsd:string"/>
+      <part name="xoppart" element="tns:octets"/>
+   </message>
+   <message name="XOPTest_sendOctetsResponse">
+      <part name="result" element="tns:octets"/>
+   </message>
 
-  </portType>
+   <portType name="XOPTest">
+      <operation name="sendMimeImageGIF">
+         <input message="tns:XOPTest_sendMimeImageGIF"/>
+         <output message="tns:XOPTest_sendMimeImageGIFResponse"/>
+      </operation>
+      <operation name="sendMimeImageJPEG">
+         <input message="tns:XOPTest_sendMimeImageJPEG"/>
+         <output message="tns:XOPTest_sendMimeImageJPEGResponse"/>
+      </operation>
+      <operation name="sendMimeTextPlain">
+         <input message="tns:XOPTest_sendMimeTextPlain"/>
+         <output message="tns:XOPTest_sendMimeTextPlainResponse"/>
+      </operation>
+      <operation name="sendMimeMultipart">
+         <input message="tns:XOPTest_sendMimeMultipart"/>
+         <output message="tns:XOPTest_sendMimeMultipartResponse"/>
+      </operation>
+      <operation name="sendMimeTextXML">
+         <input message="tns:XOPTest_sendMimeTextXML"/>
+         <output message="tns:XOPTest_sendMimeTextXMLResponse"/>
+      </operation>
+      <operation name="sendMimeApplicationXML">
+         <input message="tns:XOPTest_sendMimeApplicationXML"/>
+         <output message="tns:XOPTest_sendMimeApplicationXMLResponse"/>
+      </operation>
 
-  <binding name="XOPTestBinding" type="tns:XOPTest">
-    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
-    <operation name="sendMimeImageGIF">
-      <soap:operation soapAction=""/>
-      <input>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </input>
-      <output>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </output>
-    </operation>
-    <operation name="sendMimeImageJPEG">
-      <soap:operation soapAction=""/>
-      <input>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </input>
-      <output>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </output>
-    </operation>
-    <operation name="sendMimeTextPlain">
-      <soap:operation soapAction=""/>
-      <input>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </input>
-      <output>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </output>
-    </operation>
-    <operation name="sendMimeMultipart">
-      <soap:operation soapAction=""/>
-      <input>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </input>
-      <output>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </output>
-    </operation>
-    <operation name="sendMimeTextXML">
-      <soap:operation soapAction=""/>
-      <input>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </input>
-      <output>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </output>
-    </operation>
-    <operation name="sendMimeApplicationXML">
-      <soap:operation soapAction=""/>
-      <input>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </input>
-      <output>
-        <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
-      </output>
-    </operation>
+      <operation name="sendOctets">
+         <input message="tns:XOPTest_sendOctets"/>
+         <output message="tns:XOPTest_sendOctetsResponse"/>
+      </operation>
+   </portType>
 
-  </binding>
+   <binding name="XOPTestBinding" type="tns:XOPTest">
+      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+      <operation name="sendMimeImageGIF">
+         <soap:operation soapAction=""/>
+         <input>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </input>
+         <output>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </output>
+      </operation>
+      <operation name="sendMimeImageJPEG">
+         <soap:operation soapAction=""/>
+         <input>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </input>
+         <output>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </output>
+      </operation>
+      <operation name="sendMimeTextPlain">
+         <soap:operation soapAction=""/>
+         <input>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </input>
+         <output>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </output>
+      </operation>
+      <operation name="sendMimeMultipart">
+         <soap:operation soapAction=""/>
+         <input>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </input>
+         <output>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </output>
+      </operation>
+      <operation name="sendMimeTextXML">
+         <soap:operation soapAction=""/>
+         <input>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </input>
+         <output>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </output>
+      </operation>
+      <operation name="sendMimeApplicationXML">
+         <soap:operation soapAction=""/>
+         <input>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </input>
+         <output>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </output>
+      </operation>
+      <operation name="sendOctets">
+         <soap:operation soapAction=""/>
+         <input>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </input>
+         <output>
+            <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+         </output>
+      </operation>
+   </binding>
 
-  <service name="XOPTest">
-    <port name="XOPTestPort" binding="tns:XOPTestBinding">
-      <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
-    </port>
-  </service>
+   <service name="XOPTest">
+      <port name="XOPTestPort" binding="tns:XOPTestBinding">
+         <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
+      </port>
+   </service>
 </definitions>




More information about the jboss-svn-commits mailing list