[jbossws-commits] JBossWS SVN: r6340 - in stack/metro/trunk/src: test/resources and 1 other directory.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Thu Apr 10 13:54:38 EDT 2008


Author: thomas.diesler at jboss.com
Date: 2008-04-10 13:54:38 -0400 (Thu, 10 Apr 2008)
New Revision: 6340

Added:
   stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceObjectFactory.java
   stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderJAXRPC.java
   stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderJAXWS.java
   stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceReferenceable.java
Removed:
   stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceObjectFactory.java
   stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceRefBinderJAXRPC.java
   stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceRefBinderJAXWS.java
   stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceReferenceable.java
Modified:
   stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderFactoryImpl.java
   stack/metro/trunk/src/test/resources/test-excludes-jboss422.txt
   stack/metro/trunk/src/test/resources/test-excludes-jboss423.txt
   stack/metro/trunk/src/test/resources/test-excludes-jboss500.txt
   stack/metro/trunk/src/test/resources/test-excludes-jboss501.txt
Log:
Update metro excludes

Deleted: stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceObjectFactory.java
===================================================================
--- stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceObjectFactory.java	2008-04-10 14:19:39 UTC (rev 6339)
+++ stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceObjectFactory.java	2008-04-10 17:54:38 UTC (rev 6340)
@@ -1,213 +0,0 @@
-/*
- * 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.wsf.stack.metro.client;
-
-import org.jboss.wsf.spi.WSFException;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-
-import javax.naming.*;
-import javax.naming.spi.ObjectFactory;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.Hashtable;
-import org.jboss.logging.Logger;
-
-/**
- * This ServiceObjectFactory reconstructs a javax.xml.ws.Service
- * for a given WSDL when the webservice client does a JNDI lookup
- *
- * @see MetroServiceReferenceable
- *
- * @author Heiko.Braun at jboss.com
- *         Created: Jul 12, 2007
- * */
-public class MetroServiceObjectFactory implements ObjectFactory
-{
-   protected final Logger log = Logger.getLogger(MetroServiceObjectFactory.class);
-
-   /**
-    * Creates an object using the location or reference information specified.
-    * <p/>
-    *
-    * @param obj         The possibly null object containing location or reference
-    *                    information that can be used in creating an object.
-    * @param name        The name of this object relative to <code>nameCtx</code>,
-    *                    or null if no name is specified.
-    * @param nameCtx     The context relative to which the <code>name</code>
-    *                    parameter is specified, or null if <code>name</code> is
-    *                    relative to the default initial context.
-    * @param environment The possibly null environment that is used in
-    *                    creating the object.
-    * @return The object created; null if an object cannot be created.
-    * @throws Exception if this object factory encountered an exception
-    *                   while attempting to create an object, and no other object factories are
-    *                   to be tried.
-    * @see javax.naming.spi.NamingManager#getObjectInstance
-    * @see javax.naming.spi.NamingManager#getURLContext
-    */
-   public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception
-   {
-      try
-      {
-         Reference ref = (Reference)obj;
-
-         // Get the target class name
-         String targetClassName = (String)ref.get(MetroServiceReferenceable.TARGET_CLASS_NAME).getContent();
-
-         // Unmarshall the UnifiedServiceRef
-         UnifiedServiceRefMetaData serviceRef = unmarshallServiceRef(ref);
-         String serviceRefName = serviceRef.getServiceRefName();
-         QName serviceQName = serviceRef.getServiceQName();
-
-         String serviceImplClass = serviceRef.getServiceImplClass();
-         if (serviceImplClass == null)
-            serviceImplClass = (String)ref.get(MetroServiceReferenceable.SERVICE_IMPL_CLASS).getContent();
-
-         // If the target defaults to javax.xml.ws.Service, use the service as the target
-         if (Service.class.getName().equals(targetClassName))
-            targetClassName = serviceImplClass;
-
-         log.debug("getObjectInstance [name=" + serviceRefName + ",service=" + serviceImplClass + ",target=" + targetClassName + "]");
-
-         // Load the service class
-         ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
-         Class serviceClass = ctxLoader.loadClass(serviceImplClass);
-         Class targetClass = (targetClassName != null ? ctxLoader.loadClass(targetClassName) : null);
-
-         if (Service.class.isAssignableFrom(serviceClass) == false)
-            throw new IllegalArgumentException("WebServiceRef type '" + serviceClass + "' is not assignable to javax.xml.ws.Service");
-
-         // Receives either a javax.xml.ws.Service or a dynamic proxy
-         Object target;
-
-         // Get the URL to the wsdl
-         URL wsdlURL = serviceRef.getWsdlLocation();
-
-         // Generic javax.xml.ws.Service
-         if (serviceClass == Service.class)
-         {
-            if (wsdlURL != null)
-            {
-               target = Service.create(wsdlURL, serviceQName);
-            }
-            else
-            {
-               throw new IllegalArgumentException("Cannot create generic javax.xml.ws.Service without wsdlLocation: " + serviceRefName);
-            }
-         }
-         // Generated javax.xml.ws.Service subclass
-         else
-         {
-            if (wsdlURL != null)
-            {
-               Constructor ctor = serviceClass.getConstructor(new Class[] { URL.class, QName.class });
-               target = ctor.newInstance(new Object[] { wsdlURL, serviceQName });
-            }
-            else
-            {
-               target = (Service)serviceClass.newInstance();
-            }
-         }
-
-         // Configure the service
-         configureService((Service)target, serviceRef);
-
-         if (targetClassName != null && targetClassName.equals(serviceImplClass) == false)
-         {
-            try
-            {
-               Object port = null;
-               if (serviceClass != Service.class)
-               {
-                  for (Method method : serviceClass.getDeclaredMethods())
-                  {
-                     String methodName = method.getName();
-                     Class retType = method.getReturnType();
-                     if (methodName.startsWith("get") && targetClass.isAssignableFrom(retType))
-                     {
-                        port = method.invoke(target, new Object[0]);
-                        target = port;
-                        break;
-                     }
-                  }
-               }
-
-               if (port == null)
-               {
-                  Method method = serviceClass.getMethod("getPort", new Class[] { Class.class });
-                  port = method.invoke(target, new Object[] { targetClass });
-                  target = port;
-               }
-            }
-            catch (InvocationTargetException ex)
-            {
-               throw ex.getTargetException();
-            }
-         }
-
-         return target;
-      }
-      catch (Throwable ex)
-      {
-         WSFException.rethrow("Cannot create service", ex);
-         return null;
-      }
-   }
-
-
-   private void configureService(Service service, UnifiedServiceRefMetaData serviceRef)
-   {
-      log.warn("Service configuration not available in Sun-RI");
-   }
-
-   private UnifiedServiceRefMetaData unmarshallServiceRef(Reference ref) throws ClassNotFoundException, NamingException
-   {
-      UnifiedServiceRefMetaData sref;
-      RefAddr refAddr = ref.get(MetroServiceReferenceable.SERVICE_REF_META_DATA);
-      ByteArrayInputStream bais = new ByteArrayInputStream((byte[])refAddr.getContent());
-      try
-      {
-         ObjectInputStream ois = new ObjectInputStream(bais);
-         sref = (UnifiedServiceRefMetaData)ois.readObject();
-         ois.close();
-      }
-      catch (IOException e)
-      {
-         throw new NamingException("Cannot unmarshall service ref meta data, cause: " + e.toString());
-      }
-
-      // Verify it. There is some know coinstraints
-      if(null == sref.getServiceQName())
-         throw new IllegalArgumentException("ServiceQName may not be null. " +
-           "Specify a service QName in the <service-ref> declaration, or thorugh the @WebServiceClient annotation.");
-
-      return sref;
-   }
-}
-

Deleted: stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceRefBinderJAXRPC.java
===================================================================
--- stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceRefBinderJAXRPC.java	2008-04-10 14:19:39 UTC (rev 6339)
+++ stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceRefBinderJAXRPC.java	2008-04-10 17:54:38 UTC (rev 6340)
@@ -1,42 +0,0 @@
-/*
- * 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.wsf.stack.metro.client;
-
-import java.lang.reflect.AnnotatedElement;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
-
-/**
- * @author Heiko.Braun at jboss.com
- *         Created: Jul 12, 2007
- */
-public class MetroServiceRefBinderJAXRPC implements ServiceRefBinder
-{
-   public void setupServiceRef(Context encCtx, String encName, AnnotatedElement anElement, UnifiedServiceRefMetaData serviceRef, ClassLoader loader) throws NamingException
-   {
-      throw new IllegalArgumentException("Deployed stack doesnt support JAX-RPC service-ref deployments");
-   }
-}

Deleted: stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceRefBinderJAXWS.java
===================================================================
--- stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceRefBinderJAXWS.java	2008-04-10 14:19:39 UTC (rev 6339)
+++ stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceRefBinderJAXWS.java	2008-04-10 17:54:38 UTC (rev 6340)
@@ -1,221 +0,0 @@
-/*
- * 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.wsf.stack.metro.client;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jws.HandlerChain;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.Referenceable;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceClient;
-import javax.xml.ws.WebServiceRef;
-import javax.xml.ws.WebServiceRefs;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.naming.Util;
-import org.jboss.wsf.spi.WSFException;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
-
-/**
- * @author Heiko.Braun at jboss.com
- *         Created: Jul 12, 2007
- */
-public class MetroServiceRefBinderJAXWS implements ServiceRefBinder
-{
-   // logging support
-   private static Logger log = Logger.getLogger(MetroServiceRefBinderJAXWS.class);
-
-   public void setupServiceRef(Context encCtx, String encName, AnnotatedElement anElement, UnifiedServiceRefMetaData serviceRef, ClassLoader loader)
-         throws NamingException
-   {
-      WebServiceRef wsref = null;
-
-      if (null == loader)
-         throw new IllegalArgumentException("There needs to be a classloader available");
-
-      // Build the list of @WebServiceRef relevant annotations
-      List<WebServiceRef> wsrefList = new ArrayList<WebServiceRef>();
-
-      if (anElement != null)
-      {
-         for (Annotation an : anElement.getAnnotations())
-         {
-            if (an instanceof WebServiceRef)
-               wsrefList.add((WebServiceRef)an);
-
-            if (an instanceof WebServiceRefs)
-            {
-               WebServiceRefs wsrefs = (WebServiceRefs)an;
-               for (WebServiceRef aux : wsrefs.value())
-                  wsrefList.add(aux);
-            }
-         }
-      }
-
-      // Use the single @WebServiceRef
-      if (wsrefList.size() == 1)
-      {
-         wsref = wsrefList.get(0);
-      }
-      else
-      {
-         for (WebServiceRef aux : wsrefList)
-         {
-            if (encName.endsWith("/" + aux.name()))
-            {
-               wsref = aux;
-               break;
-            }
-         }
-      }
-
-      Class targetClass = null;
-      if (anElement instanceof Field)
-      {
-         targetClass = ((Field)anElement).getType();
-      }
-      else if (anElement instanceof Method)
-      {
-         targetClass = ((Method)anElement).getParameterTypes()[0];
-      }
-      else
-      {
-         if (wsref != null && (wsref.type() != Object.class))
-            targetClass = wsref.type();
-      }
-
-      String targetClassName = (targetClass != null ? targetClass.getName() : null);
-      String externalName = encCtx.getNameInNamespace() + "/" + encName;
-      log.debug("setupServiceRef [jndi=" + externalName + ",target=" + targetClassName + "]");
-
-      String serviceImplClass = null;
-
-      // #1 Use the explicit @WebServiceRef.value
-      if (wsref != null && wsref.value() != Object.class)
-         serviceImplClass = wsref.value().getName();
-
-      // #2 Use the target ref type
-      if (serviceImplClass == null && targetClass != null && Service.class.isAssignableFrom(targetClass))
-         serviceImplClass = targetClass.getName();
-
-      // #3 Use <service-interface>
-      if (serviceImplClass == null && serviceRef.getServiceInterface() != null)
-         serviceImplClass = serviceRef.getServiceInterface();
-
-      // #4 Use javax.xml.ws.Service
-      if (serviceImplClass == null)
-         serviceImplClass = Service.class.getName();
-
-      // #1 Use the explicit @WebServiceRef.type
-      if (wsref != null && wsref.type() != Object.class)
-         targetClassName = wsref.type().getName();
-
-      // #2 Use the target ref type
-      if (targetClassName == null && targetClass != null && Service.class.isAssignableFrom(targetClass) == false)
-         targetClassName = targetClass.getName();
-
-      // Set the wsdlLocation if there is no override already
-      if (serviceRef.getWsdlOverride() == null && wsref != null && wsref.wsdlLocation().length() > 0)
-         serviceRef.setWsdlOverride(wsref.wsdlLocation());
-
-      // Set the handlerChain from @HandlerChain on the annotated element
-      String handlerChain = serviceRef.getHandlerChain();
-      if (anElement != null)
-      {
-         HandlerChain anHandlerChain = anElement.getAnnotation(HandlerChain.class);
-         if (handlerChain == null && anHandlerChain != null && anHandlerChain.file().length() > 0)
-            handlerChain = anHandlerChain.file();
-      }
-
-      // Resolve path to handler chain
-      if (handlerChain != null)
-      {
-         try
-         {
-            new URL(handlerChain);
-         }
-         catch (MalformedURLException ex)
-         {
-            Class declaringClass = null;
-            if (anElement instanceof Field)
-               declaringClass = ((Field)anElement).getDeclaringClass();
-            else if (anElement instanceof Method)
-               declaringClass = ((Method)anElement).getDeclaringClass();
-            else if (anElement instanceof Class)
-               declaringClass = (Class)anElement;
-
-            handlerChain = declaringClass.getPackage().getName().replace('.', '/') + "/" + handlerChain;
-         }
-
-         serviceRef.setHandlerChain(handlerChain);
-      }
-
-      // Extract service QName for target service
-      if (null == serviceRef.getServiceQName())
-      {
-         try
-         {
-            Class serviceClass = loader.loadClass(serviceImplClass);
-            if (serviceClass.getAnnotation(WebServiceClient.class) != null)
-            {
-               WebServiceClient clientDecl = (WebServiceClient)serviceClass.getAnnotation(WebServiceClient.class);
-               serviceRef.setServiceQName(new QName(clientDecl.targetNamespace(), clientDecl.name()));
-            }
-         }
-         catch (ClassNotFoundException e)
-         {
-            WSFException.rethrow("Cannot extract service QName for target service", e);
-         }
-      }
-
-      // Do not use rebind, the binding should be unique
-      // [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
-      Referenceable serviceReferenceable = buildServiceReferenceable(serviceImplClass, targetClassName, serviceRef);
-      Util.bind(encCtx, encName, serviceReferenceable);
-
-   }
-
-   /**
-    * Create a Sun-RI specific service referenceable.
-    * Most of the setup is done in {@link org.jboss.wsf.framework.serviceref.ServiceRefBinderJAXWS}
-    *
-    * @param serviceImplClass
-    * @param targetClassName
-    * @param serviceRef
-    * @return a Sun-RI specific service referenceable.
-    */
-   protected Referenceable buildServiceReferenceable(String serviceImplClass, String targetClassName, UnifiedServiceRefMetaData serviceRef)
-   {
-      return new MetroServiceReferenceable(serviceImplClass, targetClassName, serviceRef);
-   }
-}

Deleted: stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceReferenceable.java
===================================================================
--- stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceReferenceable.java	2008-04-10 14:19:39 UTC (rev 6339)
+++ stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceReferenceable.java	2008-04-10 17:54:38 UTC (rev 6340)
@@ -1,88 +0,0 @@
-/*
- * 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.wsf.stack.metro.client;
-
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-
-import javax.naming.*;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectOutputStream;
-import java.io.IOException;
-
-/**
- * A JNDI reference to a javax.xml.ws.Service
- *
- * It holds the information to reconstrut the javax.xml.ws.Service
- * when the client does a JNDI lookup.
- *
- * @author Heiko.Braun at jboss.com
- */
-public class MetroServiceReferenceable implements Referenceable
-{
-   public static final String SERVICE_REF_META_DATA = "SERVICE_REF_META_DATA";
-   public static final String SERVICE_IMPL_CLASS = "SERVICE_CLASS_NAME";
-   public static final String TARGET_CLASS_NAME = "TARGET_CLASS_NAME";
-
-   private String serviceImplClass;
-   private String targetClassName;
-   private UnifiedServiceRefMetaData serviceRef;
-
-   public MetroServiceReferenceable(String serviceImplClass, String targetClassName, UnifiedServiceRefMetaData serviceRef)
-   {
-      this.serviceImplClass = serviceImplClass;
-      this.targetClassName = targetClassName;
-      this.serviceRef = serviceRef;
-   }
-
-   /**
-    * Retrieves the Reference of this object.
-    *
-    * @return The non-null Reference of this object.
-    * @throws javax.naming.NamingException If a naming exception was encountered while retrieving the reference.
-    */
-   public Reference getReference() throws NamingException
-   {
-      Reference myRef = new Reference(MetroServiceReferenceable.class.getName(), MetroServiceObjectFactory.class.getName(), null);
-
-      myRef.add(new StringRefAddr(SERVICE_IMPL_CLASS, serviceImplClass));
-      myRef.add(new StringRefAddr(TARGET_CLASS_NAME, targetClassName));
-      myRef.add(new BinaryRefAddr(SERVICE_REF_META_DATA, marshall(serviceRef)));
-
-      return myRef;
-   }
-
-   private byte[] marshall(Object obj) throws NamingException
-   {
-      ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
-      try
-      {
-         ObjectOutputStream oos = new ObjectOutputStream(baos);
-         oos.writeObject(obj);
-         oos.close();
-      }
-      catch (IOException e)
-      {
-         throw new NamingException("Cannot marshall object, cause: " + e.toString());
-      }
-      return baos.toByteArray();
-   }
-}

Copied: stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceObjectFactory.java (from rev 6339, stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceObjectFactory.java)
===================================================================
--- stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceObjectFactory.java	                        (rev 0)
+++ stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceObjectFactory.java	2008-04-10 17:54:38 UTC (rev 6340)
@@ -0,0 +1,217 @@
+/*
+ * 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.wsf.stack.metro.client;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+import javax.naming.spi.ObjectFactory;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+
+/**
+ * This ServiceObjectFactory reconstructs a javax.xml.ws.Service
+ * for a given WSDL when the webservice client does a JNDI lookup
+ *
+ * @see ServiceReferenceable
+ *
+ * @author Heiko.Braun at jboss.com
+ *         Created: Jul 12, 2007
+ * */
+public class ServiceObjectFactory implements ObjectFactory
+{
+   protected final Logger log = Logger.getLogger(ServiceObjectFactory.class);
+
+   /**
+    * Creates an object using the location or reference information specified.
+    * <p/>
+    *
+    * @param obj         The possibly null object containing location or reference
+    *                    information that can be used in creating an object.
+    * @param name        The name of this object relative to <code>nameCtx</code>,
+    *                    or null if no name is specified.
+    * @param nameCtx     The context relative to which the <code>name</code>
+    *                    parameter is specified, or null if <code>name</code> is
+    *                    relative to the default initial context.
+    * @param environment The possibly null environment that is used in
+    *                    creating the object.
+    * @return The object created; null if an object cannot be created.
+    * @throws Exception if this object factory encountered an exception
+    *                   while attempting to create an object, and no other object factories are
+    *                   to be tried.
+    * @see javax.naming.spi.NamingManager#getObjectInstance
+    * @see javax.naming.spi.NamingManager#getURLContext
+    */
+   public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception
+   {
+      try
+      {
+         Reference ref = (Reference)obj;
+
+         // Get the target class name
+         String targetClassName = (String)ref.get(ServiceReferenceable.TARGET_CLASS_NAME).getContent();
+
+         // Unmarshall the UnifiedServiceRef
+         UnifiedServiceRefMetaData serviceRef = unmarshallServiceRef(ref);
+         String serviceRefName = serviceRef.getServiceRefName();
+         QName serviceQName = serviceRef.getServiceQName();
+
+         String serviceImplClass = serviceRef.getServiceImplClass();
+         if (serviceImplClass == null)
+            serviceImplClass = (String)ref.get(ServiceReferenceable.SERVICE_IMPL_CLASS).getContent();
+
+         // If the target defaults to javax.xml.ws.Service, use the service as the target
+         if (Service.class.getName().equals(targetClassName))
+            targetClassName = serviceImplClass;
+
+         log.debug("getObjectInstance [name=" + serviceRefName + ",service=" + serviceImplClass + ",target=" + targetClassName + "]");
+
+         // Load the service class
+         ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+         Class serviceClass = ctxLoader.loadClass(serviceImplClass);
+         Class targetClass = (targetClassName != null ? ctxLoader.loadClass(targetClassName) : null);
+
+         if (Service.class.isAssignableFrom(serviceClass) == false)
+            throw new IllegalArgumentException("WebServiceRef type '" + serviceClass + "' is not assignable to javax.xml.ws.Service");
+
+         // Receives either a javax.xml.ws.Service or a dynamic proxy
+         Object target;
+
+         // Get the URL to the wsdl
+         URL wsdlURL = serviceRef.getWsdlLocation();
+
+         // Generic javax.xml.ws.Service
+         if (serviceClass == Service.class)
+         {
+            if (wsdlURL != null)
+            {
+               target = Service.create(wsdlURL, serviceQName);
+            }
+            else
+            {
+               throw new IllegalArgumentException("Cannot create generic javax.xml.ws.Service without wsdlLocation: " + serviceRefName);
+            }
+         }
+         // Generated javax.xml.ws.Service subclass
+         else
+         {
+            if (wsdlURL != null)
+            {
+               Constructor ctor = serviceClass.getConstructor(new Class[] { URL.class, QName.class });
+               target = ctor.newInstance(new Object[] { wsdlURL, serviceQName });
+            }
+            else
+            {
+               target = (Service)serviceClass.newInstance();
+            }
+         }
+
+         // Configure the service
+         configureService((Service)target, serviceRef);
+
+         if (targetClassName != null && targetClassName.equals(serviceImplClass) == false)
+         {
+            try
+            {
+               Object port = null;
+               if (serviceClass != Service.class)
+               {
+                  for (Method method : serviceClass.getDeclaredMethods())
+                  {
+                     String methodName = method.getName();
+                     Class retType = method.getReturnType();
+                     if (methodName.startsWith("get") && targetClass.isAssignableFrom(retType))
+                     {
+                        port = method.invoke(target, new Object[0]);
+                        target = port;
+                        break;
+                     }
+                  }
+               }
+
+               if (port == null)
+               {
+                  Method method = serviceClass.getMethod("getPort", new Class[] { Class.class });
+                  port = method.invoke(target, new Object[] { targetClass });
+                  target = port;
+               }
+            }
+            catch (InvocationTargetException ex)
+            {
+               throw ex.getTargetException();
+            }
+         }
+
+         return target;
+      }
+      catch (Throwable ex)
+      {
+         WSFException.rethrow("Cannot create service", ex);
+         return null;
+      }
+   }
+
+   private void configureService(Service service, UnifiedServiceRefMetaData serviceRef)
+   {
+      log.warn("Service configuration not available in Sun-RI");
+   }
+
+   private UnifiedServiceRefMetaData unmarshallServiceRef(Reference ref) throws ClassNotFoundException, NamingException
+   {
+      UnifiedServiceRefMetaData sref;
+      RefAddr refAddr = ref.get(ServiceReferenceable.SERVICE_REF_META_DATA);
+      ByteArrayInputStream bais = new ByteArrayInputStream((byte[])refAddr.getContent());
+      try
+      {
+         ObjectInputStream ois = new ObjectInputStream(bais);
+         sref = (UnifiedServiceRefMetaData)ois.readObject();
+         ois.close();
+      }
+      catch (IOException e)
+      {
+         throw new NamingException("Cannot unmarshall service ref meta data, cause: " + e.toString());
+      }
+
+      // WebServiceException: null is not a valid service
+      // http://jira.jboss.org/jira/browse/JBWS-2130
+      if (sref.getServiceQName() == null)
+         throw new IllegalArgumentException("ServiceQName may not be null. "
+               + "Specify a service QName in the <service-ref> declaration, or thorugh the @WebServiceClient annotation.");
+
+      return sref;
+   }
+}

Modified: stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderFactoryImpl.java
===================================================================
--- stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderFactoryImpl.java	2008-04-10 14:19:39 UTC (rev 6339)
+++ stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderFactoryImpl.java	2008-04-10 17:54:38 UTC (rev 6340)
@@ -37,6 +37,6 @@
 {
    public ServiceRefBinder newServiceRefBinder(Type type)
    {
-      return (type == Type.JAXRPC ? new MetroServiceRefBinderJAXRPC() : new MetroServiceRefBinderJAXWS());
+      return (type == Type.JAXRPC ? new ServiceRefBinderJAXRPC() : new ServiceRefBinderJAXWS());
    }
 }

Copied: stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderJAXRPC.java (from rev 6339, stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceRefBinderJAXRPC.java)
===================================================================
--- stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderJAXRPC.java	                        (rev 0)
+++ stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderJAXRPC.java	2008-04-10 17:54:38 UTC (rev 6340)
@@ -0,0 +1,42 @@
+/*
+ * 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.wsf.stack.metro.client;
+
+import java.lang.reflect.AnnotatedElement;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
+
+/**
+ * @author Heiko.Braun at jboss.com
+ *         Created: Jul 12, 2007
+ */
+public class ServiceRefBinderJAXRPC implements ServiceRefBinder
+{
+   public void setupServiceRef(Context encCtx, String encName, AnnotatedElement anElement, UnifiedServiceRefMetaData serviceRef, ClassLoader loader) throws NamingException
+   {
+      throw new IllegalArgumentException("Deployed stack doesnt support JAX-RPC service-ref deployments");
+   }
+}

Copied: stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderJAXWS.java (from rev 6339, stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceRefBinderJAXWS.java)
===================================================================
--- stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderJAXWS.java	                        (rev 0)
+++ stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceRefBinderJAXWS.java	2008-04-10 17:54:38 UTC (rev 6340)
@@ -0,0 +1,221 @@
+/*
+ * 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.wsf.stack.metro.client;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jws.HandlerChain;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.Referenceable;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.WebServiceRefs;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.naming.Util;
+import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
+
+/**
+ * @author Heiko.Braun at jboss.com
+ *         Created: Jul 12, 2007
+ */
+public class ServiceRefBinderJAXWS implements ServiceRefBinder
+{
+   // logging support
+   private static Logger log = Logger.getLogger(ServiceRefBinderJAXWS.class);
+
+   public void setupServiceRef(Context encCtx, String encName, AnnotatedElement anElement, UnifiedServiceRefMetaData serviceRef, ClassLoader loader)
+         throws NamingException
+   {
+      WebServiceRef wsref = null;
+
+      if (null == loader)
+         throw new IllegalArgumentException("There needs to be a classloader available");
+
+      // Build the list of @WebServiceRef relevant annotations
+      List<WebServiceRef> wsrefList = new ArrayList<WebServiceRef>();
+
+      if (anElement != null)
+      {
+         for (Annotation an : anElement.getAnnotations())
+         {
+            if (an instanceof WebServiceRef)
+               wsrefList.add((WebServiceRef)an);
+
+            if (an instanceof WebServiceRefs)
+            {
+               WebServiceRefs wsrefs = (WebServiceRefs)an;
+               for (WebServiceRef aux : wsrefs.value())
+                  wsrefList.add(aux);
+            }
+         }
+      }
+
+      // Use the single @WebServiceRef
+      if (wsrefList.size() == 1)
+      {
+         wsref = wsrefList.get(0);
+      }
+      else
+      {
+         for (WebServiceRef aux : wsrefList)
+         {
+            if (encName.endsWith("/" + aux.name()))
+            {
+               wsref = aux;
+               break;
+            }
+         }
+      }
+
+      Class targetClass = null;
+      if (anElement instanceof Field)
+      {
+         targetClass = ((Field)anElement).getType();
+      }
+      else if (anElement instanceof Method)
+      {
+         targetClass = ((Method)anElement).getParameterTypes()[0];
+      }
+      else
+      {
+         if (wsref != null && (wsref.type() != Object.class))
+            targetClass = wsref.type();
+      }
+
+      String targetClassName = (targetClass != null ? targetClass.getName() : null);
+      String externalName = encCtx.getNameInNamespace() + "/" + encName;
+      log.debug("setupServiceRef [jndi=" + externalName + ",target=" + targetClassName + "]");
+
+      String serviceImplClass = null;
+
+      // #1 Use the explicit @WebServiceRef.value
+      if (wsref != null && wsref.value() != Object.class)
+         serviceImplClass = wsref.value().getName();
+
+      // #2 Use the target ref type
+      if (serviceImplClass == null && targetClass != null && Service.class.isAssignableFrom(targetClass))
+         serviceImplClass = targetClass.getName();
+
+      // #3 Use <service-interface>
+      if (serviceImplClass == null && serviceRef.getServiceInterface() != null)
+         serviceImplClass = serviceRef.getServiceInterface();
+
+      // #4 Use javax.xml.ws.Service
+      if (serviceImplClass == null)
+         serviceImplClass = Service.class.getName();
+
+      // #1 Use the explicit @WebServiceRef.type
+      if (wsref != null && wsref.type() != Object.class)
+         targetClassName = wsref.type().getName();
+
+      // #2 Use the target ref type
+      if (targetClassName == null && targetClass != null && Service.class.isAssignableFrom(targetClass) == false)
+         targetClassName = targetClass.getName();
+
+      // Set the wsdlLocation if there is no override already
+      if (serviceRef.getWsdlOverride() == null && wsref != null && wsref.wsdlLocation().length() > 0)
+         serviceRef.setWsdlOverride(wsref.wsdlLocation());
+
+      // Set the handlerChain from @HandlerChain on the annotated element
+      String handlerChain = serviceRef.getHandlerChain();
+      if (anElement != null)
+      {
+         HandlerChain anHandlerChain = anElement.getAnnotation(HandlerChain.class);
+         if (handlerChain == null && anHandlerChain != null && anHandlerChain.file().length() > 0)
+            handlerChain = anHandlerChain.file();
+      }
+
+      // Resolve path to handler chain
+      if (handlerChain != null)
+      {
+         try
+         {
+            new URL(handlerChain);
+         }
+         catch (MalformedURLException ex)
+         {
+            Class declaringClass = null;
+            if (anElement instanceof Field)
+               declaringClass = ((Field)anElement).getDeclaringClass();
+            else if (anElement instanceof Method)
+               declaringClass = ((Method)anElement).getDeclaringClass();
+            else if (anElement instanceof Class)
+               declaringClass = (Class)anElement;
+
+            handlerChain = declaringClass.getPackage().getName().replace('.', '/') + "/" + handlerChain;
+         }
+
+         serviceRef.setHandlerChain(handlerChain);
+      }
+
+      // Extract service QName for target service
+      if (null == serviceRef.getServiceQName())
+      {
+         try
+         {
+            Class serviceClass = loader.loadClass(serviceImplClass);
+            if (serviceClass.getAnnotation(WebServiceClient.class) != null)
+            {
+               WebServiceClient clientDecl = (WebServiceClient)serviceClass.getAnnotation(WebServiceClient.class);
+               serviceRef.setServiceQName(new QName(clientDecl.targetNamespace(), clientDecl.name()));
+            }
+         }
+         catch (ClassNotFoundException e)
+         {
+            WSFException.rethrow("Cannot extract service QName for target service", e);
+         }
+      }
+
+      // Do not use rebind, the binding should be unique
+      // [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
+      Referenceable serviceReferenceable = buildServiceReferenceable(serviceImplClass, targetClassName, serviceRef);
+      Util.bind(encCtx, encName, serviceReferenceable);
+
+   }
+
+   /**
+    * Create a Sun-RI specific service referenceable.
+    * Most of the setup is done in {@link org.jboss.wsf.framework.serviceref.ServiceRefBinderJAXWS}
+    *
+    * @param serviceImplClass
+    * @param targetClassName
+    * @param serviceRef
+    * @return a Sun-RI specific service referenceable.
+    */
+   protected Referenceable buildServiceReferenceable(String serviceImplClass, String targetClassName, UnifiedServiceRefMetaData serviceRef)
+   {
+      return new ServiceReferenceable(serviceImplClass, targetClassName, serviceRef);
+   }
+}

Copied: stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceReferenceable.java (from rev 6339, stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/MetroServiceReferenceable.java)
===================================================================
--- stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceReferenceable.java	                        (rev 0)
+++ stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/client/ServiceReferenceable.java	2008-04-10 17:54:38 UTC (rev 6340)
@@ -0,0 +1,88 @@
+/*
+ * 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.wsf.stack.metro.client;
+
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+
+import javax.naming.*;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
+import java.io.IOException;
+
+/**
+ * A JNDI reference to a javax.xml.ws.Service
+ *
+ * It holds the information to reconstrut the javax.xml.ws.Service
+ * when the client does a JNDI lookup.
+ *
+ * @author Heiko.Braun at jboss.com
+ */
+public class ServiceReferenceable implements Referenceable
+{
+   public static final String SERVICE_REF_META_DATA = "SERVICE_REF_META_DATA";
+   public static final String SERVICE_IMPL_CLASS = "SERVICE_CLASS_NAME";
+   public static final String TARGET_CLASS_NAME = "TARGET_CLASS_NAME";
+
+   private String serviceImplClass;
+   private String targetClassName;
+   private UnifiedServiceRefMetaData serviceRef;
+
+   public ServiceReferenceable(String serviceImplClass, String targetClassName, UnifiedServiceRefMetaData serviceRef)
+   {
+      this.serviceImplClass = serviceImplClass;
+      this.targetClassName = targetClassName;
+      this.serviceRef = serviceRef;
+   }
+
+   /**
+    * Retrieves the Reference of this object.
+    *
+    * @return The non-null Reference of this object.
+    * @throws javax.naming.NamingException If a naming exception was encountered while retrieving the reference.
+    */
+   public Reference getReference() throws NamingException
+   {
+      Reference myRef = new Reference(ServiceReferenceable.class.getName(), ServiceObjectFactory.class.getName(), null);
+
+      myRef.add(new StringRefAddr(SERVICE_IMPL_CLASS, serviceImplClass));
+      myRef.add(new StringRefAddr(TARGET_CLASS_NAME, targetClassName));
+      myRef.add(new BinaryRefAddr(SERVICE_REF_META_DATA, marshall(serviceRef)));
+
+      return myRef;
+   }
+
+   private byte[] marshall(Object obj) throws NamingException
+   {
+      ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
+      try
+      {
+         ObjectOutputStream oos = new ObjectOutputStream(baos);
+         oos.writeObject(obj);
+         oos.close();
+      }
+      catch (IOException e)
+      {
+         throw new NamingException("Cannot marshall object, cause: " + e.toString());
+      }
+      return baos.toByteArray();
+   }
+}

Modified: stack/metro/trunk/src/test/resources/test-excludes-jboss422.txt
===================================================================
--- stack/metro/trunk/src/test/resources/test-excludes-jboss422.txt	2008-04-10 14:19:39 UTC (rev 6339)
+++ stack/metro/trunk/src/test/resources/test-excludes-jboss422.txt	2008-04-10 17:54:38 UTC (rev 6340)
@@ -11,3 +11,63 @@
 
 # [JBWS-2097] Unlock WS-ReliableMessaging in all stacks
 org/jboss/test/ws/jaxws/wsrm/**
+
+# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
+org/jboss/test/ws/jaxws/binding/**
+
+# [JBWS-2128] DefaultHttpContext is not a supported context.
+org/jboss/test/ws/jaxws/endpoint/**
+
+# [JBWS-2129] Wrapper class is not found
+org/jboss/test/ws/jaxws/handlerscope/**
+org/jboss/test/ws/jaxws/holder/**
+org/jboss/test/ws/jaxws/jbws1283/**
+org/jboss/test/ws/jaxws/jbws1357/**
+org/jboss/test/ws/jaxws/jbws1422/**
+org/jboss/test/ws/jaxws/jbws1505/**
+org/jboss/test/ws/jaxws/jbws1529/**
+org/jboss/test/ws/jaxws/jbws1566/**
+org/jboss/test/ws/jaxws/jbws1694/**
+org/jboss/test/ws/jaxws/jbws1762/**
+org/jboss/test/ws/jaxws/jbws1797/**
+org/jboss/test/ws/jaxws/jbws1799/**
+org/jboss/test/ws/jaxws/jbws1845/**
+org/jboss/test/ws/jaxws/jbws1872/**
+org/jboss/test/ws/jaxws/jbws1904/**
+org/jboss/test/ws/jaxws/jbws1969/**
+org/jboss/test/ws/jaxws/jbws2000/**
+org/jboss/test/ws/jaxws/jbws860/**
+org/jboss/test/ws/jaxws/webfault/**
+
+# [JBWS-2013] Implement standard messge context properties
+org/jboss/test/ws/jaxws/jbws1190/**
+
+# [JBWS-2130] WebServiceException: null is not a valid service
+org/jboss/test/ws/jaxws/jbws1581/**
+org/jboss/test/ws/jaxws/jbws1841/**
+
+# [JBWS-2131] WebServiceException: Failed to build METRO runtime model
+org/jboss/test/ws/jaxws/jbws1702/**
+org/jboss/test/ws/jaxws/jbws1733/**
+org/jboss/test/ws/jaxws/jbws1807/**
+
+# [JBWS-2132] IllegalArgumentException: protocol = http host = null
+org/jboss/test/ws/jaxws/jbws1798/**
+org/jboss/test/ws/jaxws/jbws1843/**
+org/jboss/test/ws/jaxws/jbws2009/**
+
+# [JBWS-2133] Failed to access the WSDL
+org/jboss/test/ws/jaxws/jbws1813/**
+
+# [JBWS-2134] Fault string, and possibly fault code, not set
+org/jboss/test/ws/jaxws/jbws1815/**
+
+# [JBWS-2135] WebServiceException: Undefined port type
+org/jboss/test/ws/jaxws/jbws1822/**
+
+# [JBWS-2136] ClassCastException: com.sun.xml.ws.server.EndpointMessageContextImpl
+org/jboss/test/ws/jaxws/namespace/**
+
+
+
+

Modified: stack/metro/trunk/src/test/resources/test-excludes-jboss423.txt
===================================================================
--- stack/metro/trunk/src/test/resources/test-excludes-jboss423.txt	2008-04-10 14:19:39 UTC (rev 6339)
+++ stack/metro/trunk/src/test/resources/test-excludes-jboss423.txt	2008-04-10 17:54:38 UTC (rev 6340)
@@ -11,3 +11,63 @@
 
 # [JBWS-2097] Unlock WS-ReliableMessaging in all stacks
 org/jboss/test/ws/jaxws/wsrm/**
+
+# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
+org/jboss/test/ws/jaxws/binding/**
+
+# [JBWS-2128] DefaultHttpContext is not a supported context.
+org/jboss/test/ws/jaxws/endpoint/**
+
+# [JBWS-2129] Wrapper class is not found
+org/jboss/test/ws/jaxws/handlerscope/**
+org/jboss/test/ws/jaxws/holder/**
+org/jboss/test/ws/jaxws/jbws1283/**
+org/jboss/test/ws/jaxws/jbws1357/**
+org/jboss/test/ws/jaxws/jbws1422/**
+org/jboss/test/ws/jaxws/jbws1505/**
+org/jboss/test/ws/jaxws/jbws1529/**
+org/jboss/test/ws/jaxws/jbws1566/**
+org/jboss/test/ws/jaxws/jbws1694/**
+org/jboss/test/ws/jaxws/jbws1762/**
+org/jboss/test/ws/jaxws/jbws1797/**
+org/jboss/test/ws/jaxws/jbws1799/**
+org/jboss/test/ws/jaxws/jbws1845/**
+org/jboss/test/ws/jaxws/jbws1872/**
+org/jboss/test/ws/jaxws/jbws1904/**
+org/jboss/test/ws/jaxws/jbws1969/**
+org/jboss/test/ws/jaxws/jbws2000/**
+org/jboss/test/ws/jaxws/jbws860/**
+org/jboss/test/ws/jaxws/webfault/**
+
+# [JBWS-2013] Implement standard messge context properties
+org/jboss/test/ws/jaxws/jbws1190/**
+
+# [JBWS-2130] WebServiceException: null is not a valid service
+org/jboss/test/ws/jaxws/jbws1581/**
+org/jboss/test/ws/jaxws/jbws1841/**
+
+# [JBWS-2131] WebServiceException: Failed to build METRO runtime model
+org/jboss/test/ws/jaxws/jbws1702/**
+org/jboss/test/ws/jaxws/jbws1733/**
+org/jboss/test/ws/jaxws/jbws1807/**
+
+# [JBWS-2132] IllegalArgumentException: protocol = http host = null
+org/jboss/test/ws/jaxws/jbws1798/**
+org/jboss/test/ws/jaxws/jbws1843/**
+org/jboss/test/ws/jaxws/jbws2009/**
+
+# [JBWS-2133] Failed to access the WSDL
+org/jboss/test/ws/jaxws/jbws1813/**
+
+# [JBWS-2134] Fault string, and possibly fault code, not set
+org/jboss/test/ws/jaxws/jbws1815/**
+
+# [JBWS-2135] WebServiceException: Undefined port type
+org/jboss/test/ws/jaxws/jbws1822/**
+
+# [JBWS-2136] ClassCastException: com.sun.xml.ws.server.EndpointMessageContextImpl
+org/jboss/test/ws/jaxws/namespace/**
+
+
+
+

Modified: stack/metro/trunk/src/test/resources/test-excludes-jboss500.txt
===================================================================
--- stack/metro/trunk/src/test/resources/test-excludes-jboss500.txt	2008-04-10 14:19:39 UTC (rev 6339)
+++ stack/metro/trunk/src/test/resources/test-excludes-jboss500.txt	2008-04-10 17:54:38 UTC (rev 6340)
@@ -2,15 +2,75 @@
 # $Id: test-excludes.txt 3907 2007-07-17 12:55:40Z thomas.diesler at jboss.com $
 #
 
+# [EJBTHREE-1152] service-ref in ejb-jar.xml is ignored
+org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.*
+
 # [JBWS-1673] Fix JAXR samples for Metro
 org/jboss/test/ws/jaxws/samples/jaxr/**
 
-# [EJBTHREE-1152] service-ref in ejb-jar.xml is ignored
-org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.*
-
 # [JBWS-2107] Resolve dependency on @SecurityDomain
 org/jboss/test/ws/jaxws/webserviceref/Secure**
 org/jboss/test/ws/jaxws/jbws1840/**
 
 # [JBWS-2097] Unlock WS-ReliableMessaging in all stacks
 org/jboss/test/ws/jaxws/wsrm/**
+
+# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
+org/jboss/test/ws/jaxws/binding/**
+
+# [JBWS-2128] DefaultHttpContext is not a supported context.
+org/jboss/test/ws/jaxws/endpoint/**
+
+# [JBWS-2129] Wrapper class is not found
+org/jboss/test/ws/jaxws/handlerscope/**
+org/jboss/test/ws/jaxws/holder/**
+org/jboss/test/ws/jaxws/jbws1283/**
+org/jboss/test/ws/jaxws/jbws1357/**
+org/jboss/test/ws/jaxws/jbws1422/**
+org/jboss/test/ws/jaxws/jbws1505/**
+org/jboss/test/ws/jaxws/jbws1529/**
+org/jboss/test/ws/jaxws/jbws1566/**
+org/jboss/test/ws/jaxws/jbws1694/**
+org/jboss/test/ws/jaxws/jbws1762/**
+org/jboss/test/ws/jaxws/jbws1797/**
+org/jboss/test/ws/jaxws/jbws1799/**
+org/jboss/test/ws/jaxws/jbws1845/**
+org/jboss/test/ws/jaxws/jbws1872/**
+org/jboss/test/ws/jaxws/jbws1904/**
+org/jboss/test/ws/jaxws/jbws1969/**
+org/jboss/test/ws/jaxws/jbws2000/**
+org/jboss/test/ws/jaxws/jbws860/**
+org/jboss/test/ws/jaxws/webfault/**
+
+# [JBWS-2013] Implement standard messge context properties
+org/jboss/test/ws/jaxws/jbws1190/**
+
+# [JBWS-2130] WebServiceException: null is not a valid service
+org/jboss/test/ws/jaxws/jbws1581/**
+org/jboss/test/ws/jaxws/jbws1841/**
+
+# [JBWS-2131] WebServiceException: Failed to build METRO runtime model
+org/jboss/test/ws/jaxws/jbws1702/**
+org/jboss/test/ws/jaxws/jbws1733/**
+org/jboss/test/ws/jaxws/jbws1807/**
+
+# [JBWS-2132] IllegalArgumentException: protocol = http host = null
+org/jboss/test/ws/jaxws/jbws1798/**
+org/jboss/test/ws/jaxws/jbws1843/**
+org/jboss/test/ws/jaxws/jbws2009/**
+
+# [JBWS-2133] Failed to access the WSDL
+org/jboss/test/ws/jaxws/jbws1813/**
+
+# [JBWS-2134] Fault string, and possibly fault code, not set
+org/jboss/test/ws/jaxws/jbws1815/**
+
+# [JBWS-2135] WebServiceException: Undefined port type
+org/jboss/test/ws/jaxws/jbws1822/**
+
+# [JBWS-2136] ClassCastException: com.sun.xml.ws.server.EndpointMessageContextImpl
+org/jboss/test/ws/jaxws/namespace/**
+
+
+
+

Modified: stack/metro/trunk/src/test/resources/test-excludes-jboss501.txt
===================================================================
--- stack/metro/trunk/src/test/resources/test-excludes-jboss501.txt	2008-04-10 14:19:39 UTC (rev 6339)
+++ stack/metro/trunk/src/test/resources/test-excludes-jboss501.txt	2008-04-10 17:54:38 UTC (rev 6340)
@@ -2,15 +2,15 @@
 # $Id$
 #
 
-# [JBWS-1673] Fix JAXR samples for Metro
-org/jboss/test/ws/jaxws/samples/jaxr/**
-
 # [EJBTHREE-1150] WebServiceContext injection requires mapped-name
 org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.*
 
 # [EJBTHREE-1152] service-ref in ejb-jar.xml is ignored
 org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.*
 
+# [JBWS-1673] Fix JAXR samples for Metro
+org/jboss/test/ws/jaxws/samples/jaxr/**
+
 # TODO: Fix classpath to ClientLauncher
 org/jboss/test/ws/jaxws/samples/webserviceref/**
 org/jboss/test/ws/jaxws/webserviceref/**
@@ -21,3 +21,63 @@
 
 # [JBWS-2097] Unlock WS-ReliableMessaging in all stacks
 org/jboss/test/ws/jaxws/wsrm/**
+
+# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
+org/jboss/test/ws/jaxws/binding/**
+
+# [JBWS-2128] DefaultHttpContext is not a supported context.
+org/jboss/test/ws/jaxws/endpoint/**
+
+# [JBWS-2129] Wrapper class is not found
+org/jboss/test/ws/jaxws/handlerscope/**
+org/jboss/test/ws/jaxws/holder/**
+org/jboss/test/ws/jaxws/jbws1283/**
+org/jboss/test/ws/jaxws/jbws1357/**
+org/jboss/test/ws/jaxws/jbws1422/**
+org/jboss/test/ws/jaxws/jbws1505/**
+org/jboss/test/ws/jaxws/jbws1529/**
+org/jboss/test/ws/jaxws/jbws1566/**
+org/jboss/test/ws/jaxws/jbws1694/**
+org/jboss/test/ws/jaxws/jbws1762/**
+org/jboss/test/ws/jaxws/jbws1797/**
+org/jboss/test/ws/jaxws/jbws1799/**
+org/jboss/test/ws/jaxws/jbws1845/**
+org/jboss/test/ws/jaxws/jbws1872/**
+org/jboss/test/ws/jaxws/jbws1904/**
+org/jboss/test/ws/jaxws/jbws1969/**
+org/jboss/test/ws/jaxws/jbws2000/**
+org/jboss/test/ws/jaxws/jbws860/**
+org/jboss/test/ws/jaxws/webfault/**
+
+# [JBWS-2013] Implement standard messge context properties
+org/jboss/test/ws/jaxws/jbws1190/**
+
+# [JBWS-2130] WebServiceException: null is not a valid service
+org/jboss/test/ws/jaxws/jbws1581/**
+org/jboss/test/ws/jaxws/jbws1841/**
+
+# [JBWS-2131] WebServiceException: Failed to build METRO runtime model
+org/jboss/test/ws/jaxws/jbws1702/**
+org/jboss/test/ws/jaxws/jbws1733/**
+org/jboss/test/ws/jaxws/jbws1807/**
+
+# [JBWS-2132] IllegalArgumentException: protocol = http host = null
+org/jboss/test/ws/jaxws/jbws1798/**
+org/jboss/test/ws/jaxws/jbws1843/**
+org/jboss/test/ws/jaxws/jbws2009/**
+
+# [JBWS-2133] Failed to access the WSDL
+org/jboss/test/ws/jaxws/jbws1813/**
+
+# [JBWS-2134] Fault string, and possibly fault code, not set
+org/jboss/test/ws/jaxws/jbws1815/**
+
+# [JBWS-2135] WebServiceException: Undefined port type
+org/jboss/test/ws/jaxws/jbws1822/**
+
+# [JBWS-2136] ClassCastException: com.sun.xml.ws.server.EndpointMessageContextImpl
+org/jboss/test/ws/jaxws/namespace/**
+
+
+
+




More information about the jbossws-commits mailing list