JBossWS SVN: r2016 - in trunk: jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-01-21 08:08:14 -0500 (Sun, 21 Jan 2007)
New Revision: 2016
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextInjector.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointJSE.java
Log:
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextInjector.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextInjector.java 2007-01-21 12:37:13 UTC (rev 2015)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextInjector.java 2007-01-21 13:08:14 UTC (rev 2016)
@@ -50,25 +50,26 @@
try
{
// scan fields that are marked with @Resource
- Field[] fields = epImpl.getClass().getFields();
+ Field[] fields = epImpl.getClass().getDeclaredFields();
for (Field field : fields)
{
Class type = field.getType();
if (type == WebServiceContext.class && field.isAnnotationPresent(Resource.class))
{
+ field.setAccessible(true);
field.set(epImpl, webServiceContext);
}
}
// scan methods that are marked with @Resource
- Method[] methods = epImpl.getClass().getMethods();
+ Method[] methods = epImpl.getClass().getDeclaredMethods();
for (Method method : methods)
{
Class[] paramTypes = method.getParameterTypes();
if (paramTypes.length == 1 && paramTypes[0] == WebServiceContext.class && method.isAnnotationPresent(Resource.class))
{
+ method.setAccessible(true);
method.invoke(epImpl, new Object[] { webServiceContext });
-
}
}
}
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointJSE.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointJSE.java 2007-01-21 12:37:13 UTC (rev 2015)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointJSE.java 2007-01-21 13:08:14 UTC (rev 2016)
@@ -36,7 +36,7 @@
public class EndpointJSE
{
@Resource
- public WebServiceContext wsCtx;
+ WebServiceContext wsCtx;
public String echo(String input)
{
19 years, 3 months
JBossWS SVN: r2015 - in trunk: jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-01-21 07:37:13 -0500 (Sun, 21 Jan 2007)
New Revision: 2015
Added:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java
Removed:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceReferenceable.java
Modified:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
Log:
Move @WebServiceRef handling to core
Fix usRef thread association
Deleted: trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java
===================================================================
--- trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java 2007-01-19 16:17:19 UTC (rev 2014)
+++ trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java 2007-01-21 12:37:13 UTC (rev 2015)
@@ -1,296 +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.
- */
-// $Id$
-package org.jboss.ws.integration.jboss50;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-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.MalformedURLException;
-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.ws.WSException;
-import org.jboss.ws.core.ConfigProvider;
-import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
-import org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl;
-import org.jboss.ws.core.server.UnifiedVirtualFile;
-
-/**
- * This ServiceObjectFactory reconstructs a javax.xml.ws.Service
- * for a given WSDL when the webservice client does a JNDI lookup
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 24-Oct-2004
- */
-public class ServiceObjectFactory implements ObjectFactory
-{
- // provide logging
- private static 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;
-
- // Unmarshall the UnifiedServiceRef
- UnifiedServiceRef usRef = unmarshallServiceRef(ref);
- String serviceRefName = usRef.getServiceRefName();
- QName serviceQName = usRef.getServiceQName();
-
- // Associate the UnifiedServiceRef with this thread
- ServiceDelegateImpl.associateUnifiedServiceRef(usRef);
-
- String serviceClassName = usRef.getServiceClassName();
- if (serviceClassName == null)
- serviceClassName = (String)ref.get(ServiceReferenceable.SERVICE_CLASS_NAME).getContent();
-
- log.debug("Service class name: " + serviceClassName);
-
- // Load the service class
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- Class serviceClass = ctxLoader.loadClass(serviceClassName);
-
- if (Service.class.isAssignableFrom(serviceClass) == false)
- throw new IllegalArgumentException("WebServiceRef type '" + serviceClass + "' is not assignable to javax.xml.ws.Service");
-
- // Load the target class
- String targetClassName = (String)ref.get(ServiceReferenceable.TARGET_CLASS_NAME).getContent();
- Class targetClass = (targetClassName != null ? ctxLoader.loadClass(targetClassName) : null);
-
- log.debug("Target class name: " + serviceClassName);
-
- // Receives either a javax.xml.ws.Service or a dynamic proxy
- Object target;
-
- // Get the URL to the wsdl
- URL wsdlURL = getWsdlLocationURL(targetClass != null ? targetClass : serviceClass, usRef);
-
- // 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, usRef);
-
- if (targetClassName != null && targetClassName.equals(serviceClassName) == 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)
- {
- WSException.rethrow("Cannot create service", ex);
- return null;
- }
- }
-
- private void configureService(Service service, UnifiedServiceRef usRef)
- {
- String configFile = usRef.getConfigFile();
- String configName = usRef.getConfigName();
- if (service instanceof ConfigProvider)
- {
- log.debug("Configure Service: [configName=" + configName + ",configFile=" + configFile + "]");
-
- ConfigProvider cp = (ConfigProvider)service;
- if (configFile != null)
- cp.setConfigFile(configFile);
- if (configName != null)
- cp.setConfigName(configName);
- }
- }
-
- private UnifiedServiceRef unmarshallServiceRef(Reference ref) throws ClassNotFoundException, NamingException
- {
- UnifiedServiceRef sref;
- RefAddr refAddr = ref.get(ServiceReferenceable.UNIFIED_SERVICE_REF);
- ByteArrayInputStream bais = new ByteArrayInputStream((byte[])refAddr.getContent());
- try
- {
- ObjectInputStream ois = new ObjectInputStream(bais);
- sref = (UnifiedServiceRef)ois.readObject();
- ois.close();
- }
- catch (IOException e)
- {
- throw new NamingException("Cannot unmarshall service ref meta data, cause: " + e.toString());
- }
- return sref;
- }
-
- private URL getWsdlLocationURL(Class userClass, UnifiedServiceRef usRef)
- {
- UnifiedVirtualFile vfsRoot = usRef.getRootFile();
- String wsdlLocation = usRef.getWsdlLocation();
-
- URL wsdlURL = null;
- if (wsdlLocation != null)
- {
- // Try the wsdlLocation as URL
- try
- {
- wsdlURL = new URL(wsdlLocation);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try the filename as File
- if (wsdlURL == null)
- {
- try
- {
- File file = new File(wsdlLocation);
- if (file.exists())
- wsdlURL = file.toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- // Try the filename as Resource
- if (wsdlURL == null)
- {
- try
- {
- wsdlURL = vfsRoot.findChild(wsdlLocation).toURL();
- }
- catch (Exception ex)
- {
- // ignore
- }
- }
-
- // Try the filename relative to class
- if (wsdlURL == null)
- {
- String packagePath = userClass.getPackage().getName().replace('.', '/');
- String wsdlPath = packagePath + "/" + wsdlLocation;
- try
- {
- wsdlURL = vfsRoot.findChild(wsdlPath).toURL();
- }
- catch (Exception ex)
- {
- // ignore
- }
- }
-
- if (wsdlURL == null)
- throw new IllegalArgumentException("Cannot get URL for: " + wsdlLocation);
- }
- return wsdlURL;
- }
-}
Deleted: trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceReferenceable.java
===================================================================
--- trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceReferenceable.java 2007-01-19 16:17:19 UTC (rev 2014)
+++ trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceReferenceable.java 2007-01-21 12:37:13 UTC (rev 2015)
@@ -1,97 +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.
- */
-// $Id$
-package org.jboss.ws.integration.jboss50;
-
-// $Id$
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-
-import javax.naming.BinaryRefAddr;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
-
-import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
-
-/**
- * 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 Thomas.Diesler(a)jboss.org
- * @since 24-Oct-2006
- */
-public class ServiceReferenceable implements Referenceable
-{
- public static final String UNIFIED_SERVICE_REF = "UNIFIED_SERVICE_REF";
- public static final String SERVICE_CLASS_NAME = "SERVICE_CLASS_NAME";
- public static final String TARGET_CLASS_NAME = "TARGET_CLASS_NAME";
-
- private String serviceClassName;
- private String targetClassName;
- private UnifiedServiceRef usRef;
-
- public ServiceReferenceable(String serviceClassName, String targetClassName, UnifiedServiceRef usRef)
- {
- this.serviceClassName = serviceClassName;
- this.targetClassName = targetClassName;
- this.usRef = usRef;
- }
-
- /**
- * 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_CLASS_NAME, serviceClassName));
- myRef.add(new StringRefAddr(TARGET_CLASS_NAME, targetClassName));
- myRef.add(new BinaryRefAddr(UNIFIED_SERVICE_REF, marshall(usRef)));
-
- 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();
- }
-}
\ No newline at end of file
Modified: trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java
===================================================================
--- trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java 2007-01-19 16:17:19 UTC (rev 2014)
+++ trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java 2007-01-21 12:37:13 UTC (rev 2015)
@@ -35,6 +35,7 @@
import org.jboss.util.naming.Util;
import org.jboss.virtual.VirtualFile;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.client.ServiceReferenceable;
import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
/**
Copied: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java (from rev 2014, trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java)
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java 2007-01-21 12:37:13 UTC (rev 2015)
@@ -0,0 +1,310 @@
+/*
+ * 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.
+ */
+// $Id$
+package org.jboss.ws.core.jaxws.client;
+
+// $Id$
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+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.MalformedURLException;
+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.ws.WSException;
+import org.jboss.ws.core.ConfigProvider;
+import org.jboss.ws.core.server.UnifiedVirtualFile;
+
+/**
+ * This ServiceObjectFactory reconstructs a javax.xml.ws.Service
+ * for a given WSDL when the webservice client does a JNDI lookup
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 24-Oct-2004
+ */
+public class ServiceObjectFactory implements ObjectFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServiceObjectFactory.class);
+
+ // The UnifiedServiceRef association
+ private static ThreadLocal serviceRefAssociation = new ThreadLocal();
+
+ /**
+ * 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;
+
+ // Unmarshall the UnifiedServiceRef
+ UnifiedServiceRef usRef = unmarshallServiceRef(ref);
+ String serviceRefName = usRef.getServiceRefName();
+ QName serviceQName = usRef.getServiceQName();
+
+ String serviceClassName = usRef.getServiceClassName();
+ if (serviceClassName == null)
+ serviceClassName = (String)ref.get(ServiceReferenceable.SERVICE_CLASS_NAME).getContent();
+
+ log.debug("Service class name: " + serviceClassName);
+
+ // Load the service class
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ Class serviceClass = ctxLoader.loadClass(serviceClassName);
+
+ if (Service.class.isAssignableFrom(serviceClass) == false)
+ throw new IllegalArgumentException("WebServiceRef type '" + serviceClass + "' is not assignable to javax.xml.ws.Service");
+
+ // Load the target class
+ String targetClassName = (String)ref.get(ServiceReferenceable.TARGET_CLASS_NAME).getContent();
+ Class targetClass = (targetClassName != null ? ctxLoader.loadClass(targetClassName) : null);
+
+ log.debug("Target class name: " + serviceClassName);
+
+ // Receives either a javax.xml.ws.Service or a dynamic proxy
+ Object target;
+
+ // Get the URL to the wsdl
+ URL wsdlURL = getWsdlLocationURL(targetClass != null ? targetClass : serviceClass, usRef);
+
+ try
+ {
+ // Associate the UnifiedServiceRef with this thread
+ serviceRefAssociation.set(usRef);
+
+ // 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();
+ }
+ }
+ }
+ finally
+ {
+ serviceRefAssociation.set(null);
+ }
+
+ // Configure the service
+ configureService((Service)target, usRef);
+
+ if (targetClassName != null && targetClassName.equals(serviceClassName) == 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)
+ {
+ WSException.rethrow("Cannot create service", ex);
+ return null;
+ }
+ }
+
+ public static UnifiedServiceRef getUnifiedServiceRefAssociation()
+ {
+ // The ServiceDelegateImpl get the usRef at ctor time
+ return (UnifiedServiceRef)serviceRefAssociation.get();
+ }
+
+ private void configureService(Service service, UnifiedServiceRef usRef)
+ {
+ String configFile = usRef.getConfigFile();
+ String configName = usRef.getConfigName();
+ if (service instanceof ConfigProvider)
+ {
+ log.debug("Configure Service: [configName=" + configName + ",configFile=" + configFile + "]");
+
+ ConfigProvider cp = (ConfigProvider)service;
+ if (configFile != null)
+ cp.setConfigFile(configFile);
+ if (configName != null)
+ cp.setConfigName(configName);
+ }
+ }
+
+ private UnifiedServiceRef unmarshallServiceRef(Reference ref) throws ClassNotFoundException, NamingException
+ {
+ UnifiedServiceRef sref;
+ RefAddr refAddr = ref.get(ServiceReferenceable.UNIFIED_SERVICE_REF);
+ ByteArrayInputStream bais = new ByteArrayInputStream((byte[])refAddr.getContent());
+ try
+ {
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ sref = (UnifiedServiceRef)ois.readObject();
+ ois.close();
+ }
+ catch (IOException e)
+ {
+ throw new NamingException("Cannot unmarshall service ref meta data, cause: " + e.toString());
+ }
+ return sref;
+ }
+
+ private URL getWsdlLocationURL(Class userClass, UnifiedServiceRef usRef)
+ {
+ UnifiedVirtualFile vfsRoot = usRef.getRootFile();
+ String wsdlLocation = usRef.getWsdlLocation();
+
+ URL wsdlURL = null;
+ if (wsdlLocation != null)
+ {
+ // Try the wsdlLocation as URL
+ try
+ {
+ wsdlURL = new URL(wsdlLocation);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try the filename as File
+ if (wsdlURL == null)
+ {
+ try
+ {
+ File file = new File(wsdlLocation);
+ if (file.exists())
+ wsdlURL = file.toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ // Try the filename as Resource
+ if (wsdlURL == null)
+ {
+ try
+ {
+ wsdlURL = vfsRoot.findChild(wsdlLocation).toURL();
+ }
+ catch (Exception ex)
+ {
+ // ignore
+ }
+ }
+
+ // Try the filename relative to class
+ if (wsdlURL == null)
+ {
+ String packagePath = userClass.getPackage().getName().replace('.', '/');
+ String wsdlPath = packagePath + "/" + wsdlLocation;
+ try
+ {
+ wsdlURL = vfsRoot.findChild(wsdlPath).toURL();
+ }
+ catch (Exception ex)
+ {
+ // ignore
+ }
+ }
+
+ if (wsdlURL == null)
+ throw new IllegalArgumentException("Cannot get URL for: " + wsdlLocation);
+ }
+ return wsdlURL;
+ }
+}
Copied: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java (from rev 2014, trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceReferenceable.java)
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java 2007-01-21 12:37:13 UTC (rev 2015)
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+// $Id$
+package org.jboss.ws.core.jaxws.client;
+
+// $Id$
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+
+import javax.naming.BinaryRefAddr;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
+import javax.naming.StringRefAddr;
+
+
+/**
+ * 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 Thomas.Diesler(a)jboss.org
+ * @since 24-Oct-2006
+ */
+public class ServiceReferenceable implements Referenceable
+{
+ public static final String UNIFIED_SERVICE_REF = "UNIFIED_SERVICE_REF";
+ public static final String SERVICE_CLASS_NAME = "SERVICE_CLASS_NAME";
+ public static final String TARGET_CLASS_NAME = "TARGET_CLASS_NAME";
+
+ private String serviceClassName;
+ private String targetClassName;
+ private UnifiedServiceRef usRef;
+
+ public ServiceReferenceable(String serviceClassName, String targetClassName, UnifiedServiceRef usRef)
+ {
+ this.serviceClassName = serviceClassName;
+ this.targetClassName = targetClassName;
+ this.usRef = usRef;
+ }
+
+ /**
+ * 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_CLASS_NAME, serviceClassName));
+ myRef.add(new StringRefAddr(TARGET_CLASS_NAME, targetClassName));
+ myRef.add(new BinaryRefAddr(UNIFIED_SERVICE_REF, marshall(usRef)));
+
+ 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();
+ }
+}
\ No newline at end of file
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-19 16:17:19 UTC (rev 2014)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-21 12:37:13 UTC (rev 2015)
@@ -23,6 +23,28 @@
// $Id$
+import java.lang.reflect.Proxy;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import javax.jws.WebService;
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.spi.ServiceDelegate;
+
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.core.StubExt;
@@ -31,32 +53,16 @@
import org.jboss.ws.core.jaxws.client.DispatchImpl;
import org.jboss.ws.core.jaxws.client.NameValuePair;
import org.jboss.ws.core.jaxws.client.PortInfo;
+import org.jboss.ws.core.jaxws.client.ServiceObjectFactory;
import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
import org.jboss.ws.core.jaxws.handler.HandlerResolverImpl;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-import javax.jws.WebService;
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.*;
-import javax.xml.ws.Service.Mode;
-import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.spi.ServiceDelegate;
-import java.lang.reflect.Proxy;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
/**
* Service delegates are used internally by Service objects to allow pluggability of JAX-WS implementations.
*
@@ -73,10 +79,10 @@
// The executor service
private static ExecutorService defaultExecutor = Executors.newCachedThreadPool();
- // The UnifiedServiceRef association
- private static ThreadLocal serviceRefAssociation = new ThreadLocal();
// The service meta data that is associated with this JAXWS Service
private ServiceMetaData serviceMetaData;
+ // The UnifiedServiceRef supplied by the ServiceObjectFactory
+ private UnifiedServiceRef usRef;
// The handler resolver
private HandlerResolver handlerResolver = new HandlerResolverImpl();
// The executor service
@@ -87,6 +93,10 @@
public ServiceDelegateImpl(URL wsdlURL, QName serviceName)
{
+ // If this Service was constructed through the ServiceObjectFactory
+ // this thread local association should be available
+ usRef = ServiceObjectFactory.getUnifiedServiceRefAssociation();
+
if (wsdlURL != null)
{
JAXWSClientMetaDataBuilder builder = new JAXWSClientMetaDataBuilder();
@@ -100,11 +110,6 @@
}
}
- public static void associateUnifiedServiceRef(UnifiedServiceRef usRef)
- {
- serviceRefAssociation.set(usRef);
- }
-
/**
* The getPort method returns a stub. A service client uses this stub to invoke operations on the target service endpoint.
* The serviceEndpointInterface specifies the service endpoint interface that is supported by the created dynamic proxy or stub instance.
@@ -330,7 +335,6 @@
String seiName = epMetaData.getServiceEndpointInterfaceName();
QName portName = epMetaData.getPortName();
- UnifiedServiceRef usRef = (UnifiedServiceRef)serviceRefAssociation.get();
if(usRef == null || usRef.getPortInfos().size() == 0)
{
log.debug("No port configuration for: " + portName);
19 years, 3 months
JBossWS SVN: r2014 - in trunk: jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wseventing and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-19 11:17:19 -0500 (Fri, 19 Jan 2007)
New Revision: 2014
Added:
trunk/build/etc/hudson/AS-5.x.config.xml
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wseventing/SimpleServer.java
Modified:
trunk/build/etc/hudson/JBossWS-TRUNK.config.xml
Log:
config backup
Added: trunk/build/etc/hudson/AS-5.x.config.xml
===================================================================
--- trunk/build/etc/hudson/AS-5.x.config.xml (rev 0)
+++ trunk/build/etc/hudson/AS-5.x.config.xml 2007-01-19 16:17:19 UTC (rev 2014)
@@ -0,0 +1,31 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+ <builders class="vector">
+ <hudson.tasks.Shell>
+ <command>cd trunk
+rm -f thirdparty/libraries.ent
+./build/build.sh clean
+./build/build.sh</command>
+ </hudson.tasks.Shell>
+ </builders>
+ <publishers class="vector">
+ <hudson.tasks.Mailer>
+ <recipients>heiko.braun(a)jboss.com</recipients>
+ <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
+ <sendToIndividuals>false</sendToIndividuals>
+ </hudson.tasks.Mailer>
+ </publishers>
+ <buildWrappers class="vector"/>
+ <scm class="hudson.scm.SubversionSCM">
+ <modules>https://svn.jboss.org/repos/jbossas/trunk</modules>
+ <useUpdate>true</useUpdate>
+ </scm>
+ <canRoam>true</canRoam>
+ <disabled>false</disabled>
+ <enableRemoteTrigger>false</enableRemoteTrigger>
+ <triggers class="vector"/>
+ <description></description>
+ <keepDependencies>false</keepDependencies>
+ <properties/>
+ <actions class="vector"/>
+</project>
\ No newline at end of file
Modified: trunk/build/etc/hudson/JBossWS-TRUNK.config.xml
===================================================================
--- trunk/build/etc/hudson/JBossWS-TRUNK.config.xml 2007-01-19 14:42:37 UTC (rev 2013)
+++ trunk/build/etc/hudson/JBossWS-TRUNK.config.xml 2007-01-19 16:17:19 UTC (rev 2014)
@@ -18,7 +18,7 @@
#
# build core modules (and update thirdparty libs)
#
-ant -propertyfile etc/hudson/AS-5.x.properties -Dforce.thirdparty.get=true main
+ant -propertyfile $WORKSPACE/trunk/build/etc/hudson/AS-5.x.properties -Dforce.thirdparty.get=true main
#
# build test suite
@@ -39,8 +39,7 @@
#
# execute tests
#
-ant -propertyfile $WORKSPACE/trunk/build/etc/hudson/AS-5.x.properties
--Djboss50.home=$HUDSON/jobs/AS-5.x/workspace/trunk/build/output/jboss-5.0.0.Beta2 tests
+ant -propertyfile $WORKSPACE/trunk/build/etc/hudson/AS-5.x.properties -Djboss50.home=$HUDSON/jobs/AS-5.x/workspace/trunk/build/output/jboss-5.0.0.Beta2 tests
#
# stop jbossas
@@ -66,7 +65,7 @@
<useUpdate>true</useUpdate>
</scm>
<canRoam>true</canRoam>
- <disabled>true</disabled>
+ <disabled>false</disabled>
<enableRemoteTrigger>false</enableRemoteTrigger>
<triggers class="vector">
<hudson.triggers.SCMTrigger>
@@ -77,4 +76,4 @@
<keepDependencies>false</keepDependencies>
<properties/>
<actions class="vector"/>
-</project>
+</project>
\ No newline at end of file
Added: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wseventing/SimpleServer.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wseventing/SimpleServer.java (rev 0)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wseventing/SimpleServer.java 2007-01-19 16:17:19 UTC (rev 2014)
@@ -0,0 +1,106 @@
+/*
+ * 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.test.ws.jaxws.wseventing;
+
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.ServerInvoker;
+import org.jboss.remoting.ServerInvocationHandler;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.transport.Connector;
+
+import javax.management.MBeanServer;
+import java.util.HashMap;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id$
+ * @since 19.01.2007
+ */
+public class SimpleServer implements Runnable {
+
+ private String locatorURI;
+ private boolean running = true;
+
+ public SimpleServer(String locatorURI) {
+ this.locatorURI = locatorURI;
+ }
+
+ public static void main(String[] args) throws Exception
+ {
+ SimpleServer server = new SimpleServer("socket://localhost:20000");
+ Thread t = new Thread(server);
+ t.start();
+
+ }
+
+ public void run() {
+ try {
+ String params = "/?clientLeasePeriod=10000";
+ locatorURI += params;
+ InvokerLocator locator = new InvokerLocator(locatorURI);
+ HashMap config = new HashMap();
+ //config.put(ServerInvoker.TIMEOUT, 120000);
+ //config.put(ServerInvoker.SERVER_SOCKET_FACTORY, new MyServerSocketFactory());
+ Connector connector = new Connector(locator, config);
+ connector.create();
+
+ connector.addInvocationHandler("eventing", new DebugHandler());
+ connector.start();
+
+ while(running)
+ {
+ Thread.currentThread().sleep(2000);
+ System.out.println(".");
+ }
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ class DebugHandler implements ServerInvocationHandler
+ {
+ public void setMBeanServer(MBeanServer mBeanServer) {
+
+ }
+
+ public void setInvoker(ServerInvoker serverInvoker) {
+
+ }
+
+ public Object invoke(InvocationRequest invocationRequest) throws Throwable {
+ System.out.println("Invocation on "+invocationRequest.getSubsystem());
+ System.out.println(invocationRequest.getRequestPayload());
+ return null;
+ }
+
+ public void addListener(InvokerCallbackHandler invokerCallbackHandler) {
+ System.out.println("addListener: "+invokerCallbackHandler);
+ }
+
+ public void removeListener(InvokerCallbackHandler invokerCallbackHandler) {
+ System.out.println("removeListener: "+invokerCallbackHandler);
+ }
+ }
+
+}
19 years, 3 months
JBossWS SVN: r2013 - in trunk: jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-19 09:42:37 -0500 (Fri, 19 Jan 2007)
New Revision: 2013
Added:
trunk/build/etc/hudson/JBossWS-TRUNK.config.xml
Modified:
trunk/build/etc/hudson/AS-5.x.properties
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
Log:
Call config provider from client impl
Modified: trunk/build/etc/hudson/AS-5.x.properties
===================================================================
--- trunk/build/etc/hudson/AS-5.x.properties 2007-01-19 14:36:35 UTC (rev 2012)
+++ trunk/build/etc/hudson/AS-5.x.properties 2007-01-19 14:42:37 UTC (rev 2013)
@@ -31,7 +31,7 @@
jboss.local.repository=/tmp
# Force thirdparty HTTP get
-force.thirdparty.get=true
+#force.thirdparty.get=true
# Java Compiler options
javac.debug=yes
Added: trunk/build/etc/hudson/JBossWS-TRUNK.config.xml
===================================================================
--- trunk/build/etc/hudson/JBossWS-TRUNK.config.xml (rev 0)
+++ trunk/build/etc/hudson/JBossWS-TRUNK.config.xml 2007-01-19 14:42:37 UTC (rev 2013)
@@ -0,0 +1,80 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+ <builders class="vector">
+ <hudson.tasks.Shell>
+ <command># common script settings
+pwd
+
+#
+# Module settings
+#
+HUDSON="/home/hbraun/hudson"
+MODULE="JBossWS-TRUNK"
+WORKSPACE=$HUDSON/jobs/$MODULE/workspace
+
+cd $WORKSPACE/trunk/build
+pwd
+
+#
+# build core modules (and update thirdparty libs)
+#
+ant -propertyfile etc/hudson/AS-5.x.properties -Dforce.thirdparty.get=true main
+
+#
+# build test suite
+#
+cd $WORKSPACE/trunk/jbossws-tests
+pwd
+ant -propertyfile $WORKSPACE/trunk/build/etc/hudson/AS-5.x.properties main
+ant -propertyfile $WORKSPACE/trunk/build/etc/hudson/AS-5.x.properties deploy-jboss50
+
+#
+# start jbossas
+#(make sure it's stopped first)
+#
+$WORKSPACE/trunk/build/etc/hudson/AS-5.x-init.sh stop
+$WORKSPACE/trunk/build/etc/hudson/AS-5.x-init.sh start
+sleep 30
+
+#
+# execute tests
+#
+ant -propertyfile $WORKSPACE/trunk/build/etc/hudson/AS-5.x.properties
+-Djboss50.home=$HUDSON/jobs/AS-5.x/workspace/trunk/build/output/jboss-5.0.0.Beta2 tests
+
+#
+# stop jbossas
+#
+$WORKSPACE/trunk/build/etc/hudson/AS-5.x-init.sh stop
+
+</command>
+ </hudson.tasks.Shell>
+ </builders>
+ <publishers class="vector">
+ <hudson.tasks.junit.JUnitResultArchiver>
+ <testResults>trunk/jbossws-tests/output/reports/*.xml</testResults>
+ </hudson.tasks.junit.JUnitResultArchiver>
+ <hudson.tasks.Mailer>
+ <recipients>heiko(a)openj.net</recipients>
+ <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
+ <sendToIndividuals>false</sendToIndividuals>
+ </hudson.tasks.Mailer>
+ </publishers>
+ <buildWrappers class="vector"/>
+ <scm class="hudson.scm.SubversionSCM">
+ <modules>https://svn.jboss.org/repos/jbossws/trunk</modules>
+ <useUpdate>true</useUpdate>
+ </scm>
+ <canRoam>true</canRoam>
+ <disabled>true</disabled>
+ <enableRemoteTrigger>false</enableRemoteTrigger>
+ <triggers class="vector">
+ <hudson.triggers.SCMTrigger>
+ <spec>* * * * *</spec>
+ </hudson.triggers.SCMTrigger>
+ </triggers>
+ <description>Builds JBossWS-TRUNK against AS 5.0 TRUNK</description>
+ <keepDependencies>false</keepDependencies>
+ <properties/>
+ <actions class="vector"/>
+</project>
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-01-19 14:36:35 UTC (rev 2012)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-01-19 14:42:37 UTC (rev 2013)
@@ -315,9 +315,7 @@
public void setConfigName(String configName)
{
- EndpointMetaData epMetaData = getEndpointMetaData();
- epMetaData.setConfigName(configName);
- // TODO: Handlers not re-initialized
- log.warn("Handlers not re-initialized");
+ ConfigurationProvider configProvider = (ConfigurationProvider)getEndpointMetaData();
+ configProvider.setConfigName(configName);
}
}
19 years, 3 months
JBossWS SVN: r2012 - in trunk: jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-01-19 09:36:35 -0500 (Fri, 19 Jan 2007)
New Revision: 2012
Modified:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml
Log:
Change qname layout in <service-ref> to QName.valueOf()
Modified: trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java
===================================================================
--- trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java 2007-01-19 13:42:58 UTC (rev 2011)
+++ trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java 2007-01-19 14:36:35 UTC (rev 2012)
@@ -25,6 +25,7 @@
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
+import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
@@ -104,7 +105,7 @@
}
else if (localName.equals("service-qname"))
{
- ref.setServiceQName(navigator.resolveQName(value));
+ ref.setServiceQName(QName.valueOf(value));
}
else if (localName.equals("config-name"))
{
@@ -143,7 +144,7 @@
}
else if (localName.equals("port-qname"))
{
- portInfo.setPortQName(navigator.resolveQName(value));
+ portInfo.setPortQName(QName.valueOf(value));
}
else if (localName.equals("config-name"))
{
Modified: trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml 2007-01-19 13:42:58 UTC (rev 2011)
+++ trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml 2007-01-19 14:36:35 UTC (rev 2012)
@@ -5,14 +5,13 @@
<jboss-client>
<jndi-name>jbossws-client</jndi-name>
-
<!--
@WebServiceRef(name = "Service1")
-->
<service-ref>
<service-ref-name>Service1</service-ref-name>
<service-class-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointService</service-class-name>
- <service-qname xmlns:nss="http://org.jboss.ws/wsref">nss:TestEndpointService</service-qname>
+ <service-qname>{http://org.jboss.ws/wsref}TestEndpointService</service-qname>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -32,7 +31,7 @@
<service-ref>
<service-ref-name>Service3</service-ref-name>
<service-class-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointService</service-class-name>
- <service-qname xmlns:nss="http://org.jboss.ws/wsref">nss:TestEndpointService</service-qname>
+ <service-qname>{http://org.jboss.ws/wsref}TestEndpointService</service-qname>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -55,7 +54,7 @@
<service-ref>
<service-ref-name>Port1</service-ref-name>
<port-info>
- <port-qname xmlns:nsp='http://org.jboss.ws/wsref'>nsp:TestEndpointPort</port-qname>
+ <port-qname>{http://org.jboss.ws/wsref}TestEndpointPort</port-qname>
<config-name>Custom Client</config-name>
<config-file>META-INF/jbossws-client-config.xml</config-file>
</port-info>
@@ -82,7 +81,7 @@
<service-ref-name>Port3</service-ref-name>
<port-info>
<service-endpoint-interface>org.jboss.test.ws.jaxws.webserviceref.TestEndpoint</service-endpoint-interface>
- <port-qname xmlns:nsp='http://org.jboss.ws/wsref'>nsp:TestEndpointPort</port-qname>
+ <port-qname>{http://org.jboss.ws/wsref}TestEndpointPort</port-qname>
<stub-property>
<name>javax.xml.ws.security.auth.username</name>
<value>kermit</value>
Modified: trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml 2007-01-19 13:42:58 UTC (rev 2011)
+++ trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml 2007-01-19 14:36:35 UTC (rev 2012)
@@ -8,10 +8,10 @@
<service-ref>
<service-ref-name>SecureService1</service-ref-name>
<service-class-name>org.jboss.test.ws.jaxws.webserviceref.SecureEndpointService</service-class-name>
- <service-qname xmlns:nss='http://org.jboss.ws/wsref'>nss:SecureEndpointService</service-qname>
+ <service-qname>{http://org.jboss.ws/wsref}SecureEndpointService</service-qname>
<port-info>
<service-endpoint-interface>org.jboss.test.ws.jaxws.webserviceref.SecureEndpoint</service-endpoint-interface>
- <port-qname xmlns:nsp='http://org.jboss.ws/wsref'>nsp:SecureEndpointPort</port-qname>
+ <port-qname>{http://org.jboss.ws/wsref}SecureEndpointPort</port-qname>
<stub-property>
<name>javax.xml.ws.security.auth.username</name>
<value>kermit</value>
@@ -27,7 +27,7 @@
<service-ref>
<service-ref-name>SecureService2</service-ref-name>
<port-info>
- <port-qname xmlns:nsp='http://org.jboss.ws/wsref'>nsp:SecureEndpointPort</port-qname>
+ <port-qname>{http://org.jboss.ws/wsref}SecureEndpointPort</port-qname>
<stub-property>
<name>javax.xml.ws.security.auth.username</name>
<value>kermit</value>
19 years, 3 months
JBossWS SVN: r2011 - trunk/build/etc/hudson.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-19 08:42:58 -0500 (Fri, 19 Jan 2007)
New Revision: 2011
Modified:
trunk/build/etc/hudson/AS-5.x-init.sh
trunk/build/etc/hudson/AS-5.x.properties
Log:
Try and error hudson
Modified: trunk/build/etc/hudson/AS-5.x-init.sh
===================================================================
--- trunk/build/etc/hudson/AS-5.x-init.sh 2007-01-19 12:18:22 UTC (rev 2010)
+++ trunk/build/etc/hudson/AS-5.x-init.sh 2007-01-19 13:42:58 UTC (rev 2011)
@@ -1,7 +1,7 @@
#!/bin/sh
#define where jboss is - this is the directory containing directories log, bin, conf etc
-JBOSS_INSTANCE=../../../../AS-5.x/workspace/trunk/build/output/jboss-5.0.0.Beta2/
+JBOSS_INSTANCE=../../../../AS-5.x/workspace/trunk/build/output/jboss-5.0.0.Beta2
case "$1" in
start)
Modified: trunk/build/etc/hudson/AS-5.x.properties
===================================================================
--- trunk/build/etc/hudson/AS-5.x.properties 2007-01-19 12:18:22 UTC (rev 2010)
+++ trunk/build/etc/hudson/AS-5.x.properties 2007-01-19 13:42:58 UTC (rev 2011)
@@ -7,7 +7,7 @@
# Required JBoss Home
-jboss50.home=../../../../AS-5.x/workspace/trunk/build/output/jboss-5.0.0.Beta2/
+jboss50.home=../../../../AS-5.x/workspace/trunk/build/output/jboss-5.0.0.Beta2
#jboss42.home=/home/hbraun/dev/prj/jbossas/branches/Branch_4_0/build/output/jboss-4.0.5.SP1-ejb3/
#jboss40.home=/home/hbraun/dev/prj/jbossas/branches/Branch_4_0/build/output/jboss-4.0.5.SP1-ejb3/
19 years, 3 months
JBossWS SVN: r2010 - trunk/build/etc/hudson.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-19 07:18:22 -0500 (Fri, 19 Jan 2007)
New Revision: 2010
Modified:
trunk/build/etc/hudson/AS-5.x-init.sh
Log:
Simplified start script
Modified: trunk/build/etc/hudson/AS-5.x-init.sh
===================================================================
--- trunk/build/etc/hudson/AS-5.x-init.sh 2007-01-19 12:13:27 UTC (rev 2009)
+++ trunk/build/etc/hudson/AS-5.x-init.sh 2007-01-19 12:18:22 UTC (rev 2010)
@@ -1,92 +1,16 @@
#!/bin/sh
-#
-# $Id: jboss_init_redhat.sh 46554 2006-07-28 10:29:13Z dimitris $
-#
-# JBoss Control Script
-#
-# To use this script run it as root - it will switch to the specified user
-#
-# Here is a little (and extremely primitive) startup/shutdown script
-# for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,
-# it's run by user 'jboss' and JDK binaries are in /usr/local/jdk/bin.
-# All this can be changed in the script itself.
-#
-# Either modify this script for your requirements or just ensure that
-# the following variables are set correctly before calling the script.
#define where jboss is - this is the directory containing directories log, bin, conf etc
-JBOSS_HOME=../../../../AS-5.x/workspace/trunk/build/output/jboss-5.0.0.Beta2/
+JBOSS_INSTANCE=../../../../AS-5.x/workspace/trunk/build/output/jboss-5.0.0.Beta2/
-#define the user under which jboss will run, or use 'RUNASIS' to run as the current user
-JBOSS_USER=RUNASIS
-
-#make sure java is in your path
-JAVAPTH=${JAVAPTH:-"/usr/local/jdk/bin"}
-
-#configuration to use, usually one of 'minimal', 'default', 'all'
-JBOSS_CONF=${JBOSS_CONF:-"default"}
-
-#bind address for jboss services, by default bind to *all* NICs
-JBOSS_HOST=${JBOSS_HOST:-"0.0.0.0"}
-
-#define the classpath for the shutdown class
-JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"}
-
-#define the script to use to start jboss
-JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF -b $JBOSS_HOST"}
-
-if [ "$JBOSS_USER" = "RUNASIS" ]; then
- SUBIT=""
-else
- SUBIT="su - $JBOSS_USER -c "
-fi
-
-if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
- # ensure the file exists
- touch $JBOSS_CONSOLE
- if [ ! -z "$SUBIT" ]; then
- chown $JBOSS_USER $JBOSS_CONSOLE
- fi
-fi
-
-if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then
- echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"
- echo "WARNING: ignoring it and using /dev/null"
- JBOSS_CONSOLE="/dev/null"
-fi
-
-#define what will be done with the console log
-JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}
-
-JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
-JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}
-
-if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
- export PATH=$PATH:$JAVAPTH
-fi
-
-if [ ! -d "$JBOSS_HOME" ]; then
- echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME
- exit 1
-fi
-
-echo JBOSS_CMD_START = $JBOSS_CMD_START
-
case "$1" in
start)
- cd $JBOSS_HOME/bin
- if [ -z "$SUBIT" ]; then
- eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
- else
- $SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &"
- fi
+ cd $JBOSS_INSTANCE/bin
+ ./run.sh > /dev/null &
;;
stop)
- if [ -z "$SUBIT" ]; then
- $JBOSS_CMD_STOP
- else
- $SUBIT "$JBOSS_CMD_STOP"
- fi
+ cd $JBOSS_INSTANCE/bin
+ ./shutdown.sh -S > /dev/null &
;;
restart)
$0 stop
19 years, 3 months
JBossWS SVN: r2009 - in trunk: jbossws-core and 12 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-01-19 07:13:27 -0500 (Fri, 19 Jan 2007)
New Revision: 2009
Added:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/NameValuePair.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/PortInfo.java
trunk/jbossws-core/src/main/resources/jboss-jaxws.jar/
trunk/jbossws-core/src/main/resources/jboss-jaxws.jar/META-INF/
trunk/jbossws-core/src/main/resources/jboss-jaxws.jar/META-INF/services/
trunk/jbossws-core/src/main/resources/jboss-jaxws.jar/META-INF/services/javax.xml.ws.spi.Provider
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jbossws-client-config.xml
Modified:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java
trunk/jbossws-core/build.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
trunk/jbossws-tests/.classpath
trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/StubPropertyTestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml
Log:
Implement full support for @WebServiceRef overrides in service-ref_5_0.dtd
Modified: trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java
===================================================================
--- trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java 2007-01-19 12:13:27 UTC (rev 2009)
@@ -48,6 +48,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.ConfigProvider;
import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
+import org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl;
import org.jboss.ws.core.server.UnifiedVirtualFile;
/**
@@ -88,19 +89,34 @@
{
Reference ref = (Reference)obj;
- String serviceClassName = (String)ref.get(ServiceReferenceable.SERVICE_CLASS_NAME).getContent();
- String targetClassName = (String)ref.get(ServiceReferenceable.TARGET_CLASS_NAME).getContent();
+ // Unmarshall the UnifiedServiceRef
UnifiedServiceRef usRef = unmarshallServiceRef(ref);
String serviceRefName = usRef.getServiceRefName();
+ QName serviceQName = usRef.getServiceQName();
+ // Associate the UnifiedServiceRef with this thread
+ ServiceDelegateImpl.associateUnifiedServiceRef(usRef);
+
+ String serviceClassName = usRef.getServiceClassName();
+ if (serviceClassName == null)
+ serviceClassName = (String)ref.get(ServiceReferenceable.SERVICE_CLASS_NAME).getContent();
+
+ log.debug("Service class name: " + serviceClassName);
+
+ // Load the service class
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
Class serviceClass = ctxLoader.loadClass(serviceClassName);
- 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 JAXWS dynamic proxy
+ // Load the target class
+ String targetClassName = (String)ref.get(ServiceReferenceable.TARGET_CLASS_NAME).getContent();
+ Class targetClass = (targetClassName != null ? ctxLoader.loadClass(targetClassName) : null);
+
+ log.debug("Target class name: " + serviceClassName);
+
+ // Receives either a javax.xml.ws.Service or a dynamic proxy
Object target;
// Get the URL to the wsdl
@@ -111,7 +127,7 @@
{
if (wsdlURL != null)
{
- target = Service.create(wsdlURL, null);
+ target = Service.create(wsdlURL, serviceQName);
}
else
{
@@ -124,7 +140,7 @@
if (wsdlURL != null)
{
Constructor ctor = serviceClass.getConstructor(new Class[] { URL.class, QName.class });
- target = ctor.newInstance(new Object[] { wsdlURL, null });
+ target = ctor.newInstance(new Object[] { wsdlURL, serviceQName });
}
else
{
@@ -133,30 +149,25 @@
}
// Configure the service
- if (target instanceof ConfigProvider)
- {
- ConfigProvider cp = (ConfigProvider)target;
- if (usRef.getConfigFile() != null)
- cp.setConfigFile(usRef.getConfigFile());
- if (usRef.getConfigName() != null)
- cp.setConfigName(usRef.getConfigName());
+ configureService((Service)target, usRef);
- }
-
if (targetClassName != null && targetClassName.equals(serviceClassName) == false)
{
try
{
Object port = null;
- for (Method method : serviceClass.getMethods())
+ if (serviceClass != Service.class)
{
- String methodName = method.getName();
- Class retType = method.getReturnType();
- if (methodName.startsWith("get") && targetClass.isAssignableFrom(retType))
+ for (Method method : serviceClass.getDeclaredMethods())
{
- port = method.invoke(target, new Object[0]);
- target = port;
- break;
+ 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;
+ }
}
}
@@ -182,6 +193,22 @@
}
}
+ private void configureService(Service service, UnifiedServiceRef usRef)
+ {
+ String configFile = usRef.getConfigFile();
+ String configName = usRef.getConfigName();
+ if (service instanceof ConfigProvider)
+ {
+ log.debug("Configure Service: [configName=" + configName + ",configFile=" + configFile + "]");
+
+ ConfigProvider cp = (ConfigProvider)service;
+ if (configFile != null)
+ cp.setConfigFile(configFile);
+ if (configName != null)
+ cp.setConfigName(configName);
+ }
+ }
+
private UnifiedServiceRef unmarshallServiceRef(Reference ref) throws ClassNotFoundException, NamingException
{
UnifiedServiceRef sref;
Added: trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java
===================================================================
--- trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java (rev 0)
+++ trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java 2007-01-19 12:13:27 UTC (rev 2009)
@@ -0,0 +1,182 @@
+/*
+ * 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.integration.jboss50;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.client.NameValuePair;
+import org.jboss.ws.core.jaxws.client.PortInfo;
+import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * An ObjectModelFactory for UnifiedServiceRef
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 17-Jan-2007
+ */
+public class UnifiedServiceRefObjectFactory implements ObjectModelFactory
+{
+ // Hide constructor
+ private UnifiedServiceRefObjectFactory()
+ {
+ }
+
+ public static UnifiedServiceRefObjectFactory newInstance()
+ {
+ return new UnifiedServiceRefObjectFactory();
+ }
+
+ public UnifiedServiceRef parse(Source source)
+ {
+ // setup the XML binding Unmarshaller
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ StreamResult result = new StreamResult(baos);
+ TransformerFactory tf = TransformerFactory.newInstance();
+ tf.newTransformer().transform(source, result);
+
+ InputStream is = new ByteArrayInputStream(baos.toByteArray());
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ return (UnifiedServiceRef)unmarshaller.unmarshal(is, this, null);
+ }
+ catch (Exception ex)
+ {
+ WSException.rethrow(ex);
+ return null;
+ }
+ }
+
+ /**
+ * This method is called on the factory by the object model builder when the parsing starts.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return new UnifiedServiceRef();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
+ {
+ return root;
+ }
+
+ public void setValue(UnifiedServiceRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("service-ref-name"))
+ {
+ ref.setServiceRefName(value);
+ }
+ else if (localName.equals("service-class-name"))
+ {
+ ref.setServiceClassName(value);
+ }
+ else if (localName.equals("service-qname"))
+ {
+ ref.setServiceQName(navigator.resolveQName(value));
+ }
+ else if (localName.equals("config-name"))
+ {
+ ref.setConfigName(value);
+ }
+ else if (localName.equals("config-file"))
+ {
+ ref.setConfigFile(value);
+ }
+ else if (localName.equals("wsdl-override"))
+ {
+ ref.setWsdlLocation(value);
+ }
+ }
+
+ public Object newChild(UnifiedServiceRef parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+
+ if (localName.equals("port-info"))
+ child = new PortInfo(parent);
+
+ return child;
+ }
+
+ public void addChild(UnifiedServiceRef parent, PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ parent.getPortInfos().add(portInfo);
+ }
+
+ public void setValue(PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("service-endpoint-interface"))
+ {
+ portInfo.setServiceEndpointInterface(value);
+ }
+ else if (localName.equals("port-qname"))
+ {
+ portInfo.setPortQName(navigator.resolveQName(value));
+ }
+ else if (localName.equals("config-name"))
+ {
+ portInfo.setConfigName(value);
+ }
+ else if (localName.equals("config-file"))
+ {
+ portInfo.setConfigFile(value);
+ }
+ }
+
+ public Object newChild(PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if (localName.equals("stub-property"))
+ child = new NameValuePair();
+ return child;
+ }
+
+ public void addChild(PortInfo parent, NameValuePair stubProp, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ parent.getStubProperties().add(stubProp);
+ }
+
+ public void setValue(NameValuePair nvPair, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("name"))
+ {
+ nvPair.setName(value);
+ }
+ else if (localName.equals("value"))
+ {
+ nvPair.setValue(value);
+ }
+ }
+}
Property changes on: trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java
===================================================================
--- trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java 2007-01-19 12:13:27 UTC (rev 2009)
@@ -23,15 +23,10 @@
// $Id$
-import java.net.URL;
-
import javax.management.MBeanServer;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceRef;
@@ -41,9 +36,6 @@
import org.jboss.virtual.VirtualFile;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
/**
* Binds a JAXWS Service object in the client's ENC
@@ -87,7 +79,9 @@
try
{
- UnifiedServiceRef usRef = getUnifiedServiceRef(vfsRoot, metadata);
+ UnifiedServiceRefObjectFactory factory = UnifiedServiceRefObjectFactory.newInstance();
+ UnifiedServiceRef usRef = factory.parse(metadata);
+ usRef.setRootFile(new VirtualFileAdaptor(vfsRoot));
// Set the wsdlLocation if there is no override already
if (usRef.getWsdlLocation() == null && wsref.wsdlLocation().length() > 0)
@@ -105,38 +99,6 @@
}
}
- private UnifiedServiceRef getUnifiedServiceRef(VirtualFile vfsRoot, Source metadata) throws TransformerException
- {
- Element root = getElementFromSource(metadata);
-
- String encName = DOMUtils.getTextContent(DOMUtils.getFirstChildElement(root, "service-ref-name"));
- UnifiedServiceRef ref = new UnifiedServiceRef(new VirtualFileAdaptor(vfsRoot), encName);
-
- Element refEl = DOMUtils.getFirstChildElement(root, "config-name");
- if (refEl != null)
- ref.setConfigName(DOMUtils.getTextContent(refEl));
-
- refEl = DOMUtils.getFirstChildElement(root, "config-file");
- if (refEl != null)
- ref.setConfigFile(DOMUtils.getTextContent(refEl));
-
- refEl = DOMUtils.getFirstChildElement(root, "wsdl-override");
- if (refEl != null)
- ref.setWsdlLocation(DOMUtils.getTextContent(refEl));
-
- return ref;
- }
-
- private Element getElementFromSource(Source retObj) throws TransformerException
- {
- DOMResult domResult = new DOMResult();
- TransformerFactory tf = TransformerFactory.newInstance();
- tf.newTransformer().transform(retObj, domResult);
- Document doc = (Document)domResult.getNode();
- Element docElement = doc.getDocumentElement();
- return docElement;
- }
-
public void create() throws Exception
{
MBeanServer server = MBeanServerLocator.locateJBoss();
Modified: trunk/jbossws-core/build.xml
===================================================================
--- trunk/jbossws-core/build.xml 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/jbossws-core/build.xml 2007-01-19 12:13:27 UTC (rev 2009)
@@ -126,6 +126,7 @@
<include name="javax/xml/ws/**"/>
<include name="org/jboss/ws/jaxws/injection/**"/>
</fileset>
+ <metainf dir="${core.resources.dir}/jboss-jaxws.jar/META-INF"/>
</jar>
<!-- Build jbossws-core.jar -->
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-01-19 12:13:27 UTC (rev 2009)
@@ -53,7 +53,6 @@
import org.jboss.ws.core.soap.SOAPConnectionImpl;
import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.core.utils.HolderUtils;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/NameValuePair.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/NameValuePair.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/NameValuePair.java 2007-01-19 12:13:27 UTC (rev 2009)
@@ -0,0 +1,69 @@
+/*
+ * 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.core.jaxws.client;
+
+//$Id$
+
+import java.io.Serializable;
+
+/**
+ * Represents a name value pair
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ */
+public class NameValuePair implements Serializable
+{
+ private static final long serialVersionUID = -7833097600256899477L;
+
+ private String name;
+ private String value;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb = new StringBuffer(100);
+ sb.append('[');
+ sb.append("name=").append(name);
+ sb.append(",value=").append(value);
+ sb.append(']');
+ return sb.toString();
+ }
+}
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/NameValuePair.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/PortInfo.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/PortInfo.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/PortInfo.java 2007-01-19 12:13:27 UTC (rev 2009)
@@ -0,0 +1,102 @@
+/*
+ * 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.core.jaxws.client;
+
+//$Id$
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Represents a <port-info> element in <service-ref>
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ */
+public class PortInfo implements Serializable
+{
+ private static final long serialVersionUID = -5517739021682888778L;
+
+ private UnifiedServiceRef serviceRef;
+ private String serviceEndpointInterface;
+ private QName portQName;
+ private String configName;
+ private String configFile;
+ private List<NameValuePair> stubProperties = new ArrayList<NameValuePair>();
+
+ public PortInfo(UnifiedServiceRef serviceRef)
+ {
+ this.serviceRef = serviceRef;
+ }
+
+ public UnifiedServiceRef getServiceRef()
+ {
+ return serviceRef;
+ }
+
+ public QName getPortQName()
+ {
+ return portQName;
+ }
+
+ public void setPortQName(QName portName)
+ {
+ this.portQName = portName;
+ }
+
+ public String getServiceEndpointInterface()
+ {
+ return serviceEndpointInterface;
+ }
+
+ public void setServiceEndpointInterface(String serviceEndpointInterface)
+ {
+ this.serviceEndpointInterface = serviceEndpointInterface;
+ }
+
+ public String getConfigFile()
+ {
+ return configFile;
+ }
+
+ public void setConfigFile(String configFile)
+ {
+ this.configFile = configFile;
+ }
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ }
+
+ public List<NameValuePair> getStubProperties()
+ {
+ return stubProperties;
+ }
+}
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/PortInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java 2007-01-19 12:13:27 UTC (rev 2009)
@@ -24,7 +24,11 @@
//$Id$
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.namespace.QName;
+
import org.jboss.ws.core.server.UnifiedVirtualFile;
/**
@@ -35,30 +39,62 @@
*/
public class UnifiedServiceRef implements Serializable
{
- private static final long serialVersionUID = -5518998734737147195L;
+ private static final long serialVersionUID = -6242639118713373752L;
private UnifiedVirtualFile vfsRoot;
private String serviceRefName;
- private String wsdlLocation;
+ private String serviceClassName;
+ private QName serviceQName;
private String configName;
private String configFile;
+ private List<PortInfo> portInfos = new ArrayList<PortInfo>();
+ private String wsdlLocation;
- public UnifiedServiceRef(UnifiedVirtualFile vfsRoot, String name)
+ public UnifiedVirtualFile getRootFile()
{
+ return vfsRoot;
+ }
+
+ public void setRootFile(UnifiedVirtualFile vfsRoot)
+ {
this.vfsRoot = vfsRoot;
+ }
+
+ public String getServiceRefName()
+ {
+ return serviceRefName;
+ }
+
+ public void setServiceRefName(String name)
+ {
this.serviceRefName = name;
}
- public UnifiedVirtualFile getRootFile()
+ public String getServiceClassName()
{
- return vfsRoot;
+ return serviceClassName;
}
- public String getServiceRefName()
+ public void setServiceClassName(String serviceClassName)
{
- return serviceRefName;
+ this.serviceClassName = serviceClassName;
}
+ public QName getServiceQName()
+ {
+ return serviceQName;
+ }
+
+ public void setServiceQName(QName serviceQName)
+ {
+ this.serviceQName = serviceQName;
+ }
+
+ public List<PortInfo> getPortInfos()
+ {
+ return portInfos;
+ }
+
public String getWsdlLocation()
{
return wsdlLocation;
@@ -91,12 +127,9 @@
public String toString()
{
- StringBuilder sb = new StringBuilder();
+ StringBuffer sb = new StringBuffer(100);
sb.append("[");
sb.append("name=").append(serviceRefName);
- sb.append(",config-name=").append(configName);
- sb.append(",config-file=").append(configFile);
- sb.append(",wsdl=").append(wsdlLocation);
sb.append("]");
return sb.toString();
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-19 12:13:27 UTC (rev 2009)
@@ -29,6 +29,9 @@
import org.jboss.ws.core.jaxws.client.ClientImpl;
import org.jboss.ws.core.jaxws.client.ClientProxy;
import org.jboss.ws.core.jaxws.client.DispatchImpl;
+import org.jboss.ws.core.jaxws.client.NameValuePair;
+import org.jboss.ws.core.jaxws.client.PortInfo;
+import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
import org.jboss.ws.core.jaxws.handler.HandlerResolverImpl;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
@@ -49,6 +52,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -69,7 +73,8 @@
// The executor service
private static ExecutorService defaultExecutor = Executors.newCachedThreadPool();
-
+ // The UnifiedServiceRef association
+ private static ThreadLocal serviceRefAssociation = new ThreadLocal();
// The service meta data that is associated with this JAXWS Service
private ServiceMetaData serviceMetaData;
// The handler resolver
@@ -95,6 +100,11 @@
}
}
+ public static void associateUnifiedServiceRef(UnifiedServiceRef usRef)
+ {
+ serviceRefAssociation.set(usRef);
+ }
+
/**
* The getPort method returns a stub. A service client uses this stub to invoke operations on the target service endpoint.
* The serviceEndpointInterface specifies the service endpoint interface that is supported by the created dynamic proxy or stub instance.
@@ -298,6 +308,10 @@
ClientProxy handler = new ClientProxy(executor, new ClientImpl(epMetaData, handlerResolver));
ClassLoader cl = epMetaData.getClassLoader();
T proxy = (T)Proxy.newProxyInstance(cl, new Class[] { seiClass, BindingProvider.class, StubExt.class }, handler);
+
+ // Configure the stub
+ configureStub((StubExt)proxy);
+
return proxy;
}
catch (WebServiceException ex)
@@ -309,7 +323,64 @@
throw new WebServiceException("Cannot create proxy", ex);
}
}
+
+ private void configureStub(StubExt stub)
+ {
+ EndpointMetaData epMetaData = stub.getEndpointMetaData();
+ String seiName = epMetaData.getServiceEndpointInterfaceName();
+ QName portName = epMetaData.getPortName();
+ UnifiedServiceRef usRef = (UnifiedServiceRef)serviceRefAssociation.get();
+ if(usRef == null || usRef.getPortInfos().size() == 0)
+ {
+ log.debug("No port configuration for: " + portName);
+ return;
+ }
+
+ String configFile = usRef.getConfigFile();
+ String configName = usRef.getConfigName();
+
+ boolean match = false;
+ for (PortInfo pi : usRef.getPortInfos())
+ {
+ String piSEI = pi.getServiceEndpointInterface();
+ QName piPort = pi.getPortQName();
+ match = (piSEI == null && piPort == null);
+ if (match == false)
+ {
+ if (piSEI != null && piPort != null)
+ match = seiName.equals(piSEI) && portName.equals(piPort);
+ else
+ match = seiName.equals(piSEI) || portName.equals(piPort);
+ }
+ if (match == true)
+ {
+ if (pi.getConfigFile() != null)
+ configFile = pi.getConfigFile();
+ if (pi.getConfigName() != null)
+ configName = pi.getConfigName();
+
+ BindingProvider bp = (BindingProvider)stub;
+ Map<String, Object> reqCtx = bp.getRequestContext();
+ for (NameValuePair nvp : pi.getStubProperties())
+ {
+ log.debug("Set stub property: " + nvp);
+ reqCtx.put(nvp.getName(), nvp.getValue());
+ }
+ break;
+ }
+ }
+
+ if (match == false)
+ log.debug("No matching port configuration for: [portName=" + portName + ",seiName=" + seiName + "]");
+
+ log.debug("Configure Stub: [configName=" + configName + ",configFile=" + configFile + "]");
+ if (configFile != null)
+ stub.setConfigFile(configFile);
+ if (configName != null)
+ stub.setConfigName(configName);
+ }
+
@Override
public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode, WebServiceFeature... features)
{
Added: trunk/jbossws-core/src/main/resources/jboss-jaxws.jar/META-INF/services/javax.xml.ws.spi.Provider
===================================================================
--- trunk/jbossws-core/src/main/resources/jboss-jaxws.jar/META-INF/services/javax.xml.ws.spi.Provider (rev 0)
+++ trunk/jbossws-core/src/main/resources/jboss-jaxws.jar/META-INF/services/javax.xml.ws.spi.Provider 2007-01-19 12:13:27 UTC (rev 2009)
@@ -0,0 +1 @@
+org.jboss.ws.core.jaxws.spi.ProviderImpl
\ No newline at end of file
Modified: trunk/jbossws-tests/.classpath
===================================================================
--- trunk/jbossws-tests/.classpath 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/jbossws-tests/.classpath 2007-01-19 12:13:27 UTC (rev 2009)
@@ -28,8 +28,6 @@
<classpathentry kind="lib" path="/build/thirdparty/jboss-xml-binding.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/wsdl4j.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/xmlsec.jar"/>
- <classpathentry kind="lib" path="/build/thirdparty/ejb3.deployer/jboss-annotations-ejb3.jar"/>
- <classpathentry kind="lib" path="/build/thirdparty/ejb3.deployer/jboss-ejb3x.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jaxb-xjc.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-dependency.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-microcontainer.jar"/>
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-01-19 12:13:27 UTC (rev 2009)
@@ -20,6 +20,16 @@
<mkdir dir="${tests.output.dir}/libs"/>
+ <!-- jaxws-anonymous -->
+ <war warfile="${tests.output.dir}/libs/jaxws-anonymous.war" webxml="${tests.output.dir}/resources/jaxws/anonymous/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/anonymous/Anonymous.class"/>
+ <include name="org/jboss/test/ws/jaxws/anonymous/AnonymousRequest.class"/>
+ <include name="org/jboss/test/ws/jaxws/anonymous/AnonymousResponse.class"/>
+ <include name="org/jboss/test/ws/jaxws/anonymous/AnonymousImpl.class"/>
+ </classes>
+ </war>
+
<!-- jaxws-asynchronous -->
<war warfile="${tests.output.dir}/libs/jaxws-asynchronous.war" webxml="${tests.output.dir}/resources/jaxws/asynchronous/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
@@ -98,6 +108,15 @@
</webinf>
</war>
+ <!-- jaxws-exception -->
+ <war warfile="${tests.output.dir}/libs/jaxws-exception.war" webxml="${tests.output.dir}/resources/jaxws/exception/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/exception/ExceptionEndpoint.class"/>
+ <include name="org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.class"/>
+ <include name="org/jboss/test/ws/jaxws/exception/UserException.class"/>
+ </classes>
+ </war>
+
<!-- jaxws-handlerscope -->
<war warfile="${tests.output.dir}/libs/jaxws-handlerscope.war" webxml="${tests.output.dir}/resources/jaxws/handlerscope/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
@@ -503,28 +522,21 @@
</metainf>
</jar>
- <!-- jaxws-xop-doclit -->
- <jar jarfile="${tests.output.dir}/libs/jaxws-xop-doclit.jar">
- <fileset dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/xop/doclit/**/*.class"/>
- </fileset>
- <!--metainf dir="${tests.output.dir}/resources/jaxws/xop/doclit/META-INF">
- <include name="wsdl/*"/>
- <include name="jaxws-handler.xml"/>
- </metainf-->
- </jar>
- <jar jarfile="${tests.output.dir}/libs/jaxws-xop-doclit-client.jar">
- <fileset dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/xop/doclit/**/*.class"/>
- <exclude name="org/jboss/test/ws/jaxws/xop/doclit/**/*Bean.class"/>
- </fileset>
- <!--metainf dir="${tests.output.dir}/resources/jaxws/xop/doclit/META-INF">
- <include name="application-client.xml"/>
- <include name="jboss-client.xml"/>
- <include name="wsdl/**"/>
- </metainf-->
- </jar>
-
+ <!-- jaxws-samples-wseventing.war -->
+ <war warfile="${tests.output.dir}/libs/jaxws-samples-wseventing.war"
+ webxml="${tests.output.dir}/resources/jaxws/samples/wseventing/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wseventing/*.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/samples/wseventing/WEB-INF">
+ <include name="wsdl/jboss-web.xml"/>
+ <include name="wsdl/sysmon.wsdl"/>
+ <include name="wsdl/ws-eventing.wsdl"/>
+ <include name="wsdl/ws-eventing.xsd"/>
+ <include name="wsdl/ws-addr.xsd"/>
+ </webinf>
+ </war>
+
<!-- jaxws-webserviceref -->
<war warfile="${tests.output.dir}/libs/jaxws-webserviceref.war" webxml="${tests.output.dir}/resources/jaxws/webserviceref/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
@@ -599,6 +611,7 @@
<include name="org/jboss/test/ws/jaxws/webserviceref/TestEndpoint.class"/>
</fileset>
<metainf dir="${tests.output.dir}/resources/jaxws/webserviceref/META-INF-override">
+ <include name="jbossws-client-config.xml"/>
<include name="application-client.xml"/>
<include name="jboss-client.xml"/>
</metainf>
@@ -619,25 +632,6 @@
</classes>
</war>
- <!-- jaxws-anonymous -->
- <war warfile="${tests.output.dir}/libs/jaxws-anonymous.war" webxml="${tests.output.dir}/resources/jaxws/anonymous/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/anonymous/Anonymous.class"/>
- <include name="org/jboss/test/ws/jaxws/anonymous/AnonymousRequest.class"/>
- <include name="org/jboss/test/ws/jaxws/anonymous/AnonymousResponse.class"/>
- <include name="org/jboss/test/ws/jaxws/anonymous/AnonymousImpl.class"/>
- </classes>
- </war>
-
- <!-- jaxws-exception -->
- <war warfile="${tests.output.dir}/libs/jaxws-exception.war" webxml="${tests.output.dir}/resources/jaxws/exception/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/exception/ExceptionEndpoint.class"/>
- <include name="org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.class"/>
- <include name="org/jboss/test/ws/jaxws/exception/UserException.class"/>
- </classes>
- </war>
-
<!-- jaxws-wsaddressing-action -->
<war warfile="${tests.output.dir}/libs/jaxws-wsaddressing-action-rpc.war" webxml="${tests.output.dir}/resources/jaxws/wsaddressing/action/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
@@ -712,10 +706,7 @@
</classes>
</war>
- <!-- Please add alphabetically -->
-
-
- <!-- jaxws-wseventing -->
+ <!-- jaxws-wseventing -->
<war warfile="${tests.output.dir}/libs/jaxws-wseventing.war"
webxml="${tests.output.dir}/resources/jaxws/wseventing/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
@@ -726,22 +717,31 @@
<include name="wsdl/**"/>
</webinf>
</war>
-
- <!-- jaxws-samples-wseventing.war -->
- <war warfile="${tests.output.dir}/libs/jaxws-samples-wseventing.war"
- webxml="${tests.output.dir}/resources/jaxws/samples/wseventing/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/samples/wseventing/*.class"/>
- </classes>
- <webinf dir="${tests.output.dir}/resources/jaxws/samples/wseventing/WEB-INF">
- <include name="wsdl/jboss-web.xml"/>
- <include name="wsdl/sysmon.wsdl"/>
- <include name="wsdl/ws-eventing.wsdl"/>
- <include name="wsdl/ws-eventing.xsd"/>
- <include name="wsdl/ws-addr.xsd"/>
- </webinf>
- </war>
-
+
+ <!-- jaxws-xop-doclit -->
+ <jar jarfile="${tests.output.dir}/libs/jaxws-xop-doclit.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/xop/doclit/**/*.class"/>
+ </fileset>
+ <!--metainf dir="${tests.output.dir}/resources/jaxws/xop/doclit/META-INF">
+ <include name="wsdl/*"/>
+ <include name="jaxws-handler.xml"/>
+ </metainf-->
+ </jar>
+ <jar jarfile="${tests.output.dir}/libs/jaxws-xop-doclit-client.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/xop/doclit/**/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/xop/doclit/**/*Bean.class"/>
+ </fileset>
+ <!--metainf dir="${tests.output.dir}/resources/jaxws/xop/doclit/META-INF">
+ <include name="application-client.xml"/>
+ <include name="jboss-client.xml"/>
+ <include name="wsdl/**"/>
+ </metainf-->
+ </jar>
+
+ <!-- Please add alphabetically -->
+
</target>
</project>
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/StubPropertyTestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/StubPropertyTestCase.java 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/StubPropertyTestCase.java 2007-01-19 12:13:27 UTC (rev 2009)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxws.webserviceref;
-import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
@@ -32,7 +31,6 @@
import junit.framework.Test;
import org.jboss.ejb3.client.ClientLauncher;
-import org.jboss.ejb3.metamodel.JBossClientDDObjectFactory;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
@@ -67,7 +65,7 @@
QName qname = new QName("http://org.jboss.ws/wsref", "SecureEndpointService");
Service service = Service.create(wsdlURL, qname);
SecureEndpoint port = (SecureEndpoint)service.getPort(SecureEndpoint.class);
-
+
BindingProvider bindingProvider = (BindingProvider)port;
bindingProvider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "kermit");
bindingProvider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
@@ -80,7 +78,14 @@
public void testUnconfiguredStub() throws Throwable
{
String reqMsg = "Hello World";
- new ClientLauncher().launch(SecureEndpointClient.class.getName(), "jbossws-client", new String[]{reqMsg, "kermit", "thefrog"});
+ new ClientLauncher().launch(SecureEndpointClient.class.getName(), "jbossws-client", new String[] { reqMsg, "kermit", "thefrog" });
assertEquals("Hello World|Hello World|Hello World", SecureEndpointClient.retStr);
}
+
+ public void testConfiguredStub() throws Throwable
+ {
+ String reqMsg = "Hello World";
+ new ClientLauncher().launch(SecureEndpointClient.class.getName(), "jbossws-client", new String[] { reqMsg });
+ assertEquals("Hello World|Hello World|Hello World", SecureEndpointClient.retStr);
+ }
}
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java 2007-01-19 12:13:27 UTC (rev 2009)
@@ -21,21 +21,29 @@
*/
package org.jboss.test.ws.jaxws.webserviceref;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import javax.naming.InitialContext;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceRef;
import javax.xml.ws.WebServiceRefs;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.ConfigProvider;
+
//Test on type
@WebServiceRef(name = "Service1")
// Test multiple on type
@WebServiceRefs( { @WebServiceRef(name = "Service2"), @WebServiceRef(name = "Port1", type = TestEndpoint.class) })
public class TestEndpointClientTwo
{
+ // provide logging
+ private static final Logger log = Logger.getLogger(TestEndpointClientTwo.class);
+
// Test on field
@WebServiceRef(name = "Service3")
public static Service service3;
@@ -65,73 +73,136 @@
String retStr = (String)method.invoke(client, testName);
testResult.put(testName, retStr);
}
+ catch (InvocationTargetException ex)
+ {
+ log.error("Invocation error", ex);
+ testResult.put(testName, ex.getTargetException().toString());
+ }
catch (Exception ex)
{
+ log.error("Error", ex);
testResult.put(testName, ex.toString());
}
}
+ /**
+ * Customize service-class-name, service-qname
+ */
public String testService1(String reqStr) throws Exception
{
- Service service = (Service)iniCtx.lookup("java:comp/env/Service1");
- TestEndpoint port = service.getPort(TestEndpoint.class);
+ TestEndpointService service = (TestEndpointService)iniCtx.lookup("java:comp/env/Service1");
+ TestEndpoint port = service.getTestEndpointPort();
return port.echo(reqStr);
}
+ /**
+ * Customize config-name, config-file
+ */
public String testService2(String reqStr) throws Exception
{
Service service = (Service)iniCtx.lookup("java:comp/env/Service2");
+ verifyConfig((ConfigProvider)service);
+
TestEndpoint port = service.getPort(TestEndpoint.class);
+ verifyConfig((ConfigProvider)port);
+
return port.echo(reqStr);
}
+ /**
+ * Customize service-class-name, service-qname
+ */
public String testService3(String reqStr) throws Exception
{
- TestEndpoint port = service3.getPort(TestEndpoint.class);
+ TestEndpoint port = ((TestEndpointService)service3).getTestEndpointPort();
String resStr1 = port.echo(reqStr);
- Service service = (Service)iniCtx.lookup("java:comp/env/Service3");
- port = service.getPort(TestEndpoint.class);
+ TestEndpointService service = (TestEndpointService)iniCtx.lookup("java:comp/env/Service3");
+ port = service.getTestEndpointPort();
+
String resStr2 = port.echo(reqStr);
return resStr1 + resStr2;
}
+ /**
+ * Customize config-name, config-file
+ */
public String testService4(String reqStr) throws Exception
{
- TestEndpoint port = service4.getPort(TestEndpoint.class);
+ TestEndpoint port = service4.getTestEndpointPort();
String resStr1 = port.echo(reqStr);
+ verifyConfig((ConfigProvider)port);
- Service service = (Service)iniCtx.lookup("java:comp/env/Service4");
- port = service.getPort(TestEndpoint.class);
+ TestEndpointService service = (TestEndpointService)iniCtx.lookup("java:comp/env/Service4");
+ port = service.getTestEndpointPort();
+ verifyConfig((ConfigProvider)port);
+
String resStr2 = port.echo(reqStr);
return resStr1 + resStr2;
}
+ /**
+ * Customize port-info: port-qname, config-name, config-file
+ */
public String testPort1(String reqStr) throws Exception
{
TestEndpoint port = (TestEndpoint)iniCtx.lookup("java:comp/env/Port1");
+ verifyConfig((ConfigProvider)port);
+
return port.echo(reqStr);
}
+ /**
+ * Customize port-info: service-endpoint-interface, config-name, config-file
+ */
public String testPort2(String reqStr) throws Exception
{
+ verifyConfig((ConfigProvider)port2);
String resStr1 = port2.echo(reqStr);
TestEndpoint port = (TestEndpoint)iniCtx.lookup("java:comp/env/Port2");
+ verifyConfig((ConfigProvider)port);
+
String resStr2 = port.echo(reqStr);
return resStr1 + resStr2;
}
+ /**
+ * Customize port-info: service-endpoint-interface, port-qname, stub-property
+ */
public String testPort3(String reqStr) throws Exception
{
String resStr1 = port3.echo(reqStr);
+
+ BindingProvider bp = (BindingProvider)port3;
+ verifyProperties(bp.getRequestContext());
TestEndpoint port = (TestEndpoint)iniCtx.lookup("java:comp/env/Port3");
String resStr2 = port.echo(reqStr);
return resStr1 + resStr2;
}
+
+ private void verifyProperties(Map<String, Object> ctx)
+ {
+ String username = (String)ctx.get(BindingProvider.USERNAME_PROPERTY);
+ if ("kermit".equals(username) == false)
+ throw new RuntimeException("Invalid username: " + username);
+
+ String password = (String)ctx.get(BindingProvider.PASSWORD_PROPERTY);
+ if ("thefrog".equals(password) == false)
+ throw new RuntimeException("Invalid password: " + password);
+ }
+
+ private void verifyConfig(ConfigProvider cp)
+ {
+ if ("Custom Client".equals(cp.getConfigName()) == false)
+ throw new RuntimeException("Invalid config name: " + cp.getConfigName());
+
+ if ("META-INF/jbossws-client-config.xml".equals(cp.getConfigFile()) == false)
+ throw new RuntimeException("Invalid config file: " + cp.getConfigFile());
+ }
}
Modified: trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml 2007-01-19 12:13:27 UTC (rev 2009)
@@ -11,6 +11,8 @@
-->
<service-ref>
<service-ref-name>Service1</service-ref-name>
+ <service-class-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointService</service-class-name>
+ <service-qname xmlns:nss="http://org.jboss.ws/wsref">nss:TestEndpointService</service-qname>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -19,6 +21,8 @@
-->
<service-ref>
<service-ref-name>Service2</service-ref-name>
+ <config-name>Custom Client</config-name>
+ <config-file>META-INF/jbossws-client-config.xml</config-file>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -27,6 +31,8 @@
-->
<service-ref>
<service-ref-name>Service3</service-ref-name>
+ <service-class-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointService</service-class-name>
+ <service-qname xmlns:nss="http://org.jboss.ws/wsref">nss:TestEndpointService</service-qname>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -35,6 +41,11 @@
-->
<service-ref>
<service-ref-name>Service4</service-ref-name>
+ <port-info>
+ <service-endpoint-interface>org.jboss.test.ws.jaxws.webserviceref.TestEndpoint</service-endpoint-interface>
+ <config-name>Custom Client</config-name>
+ <config-file>META-INF/jbossws-client-config.xml</config-file>
+ </port-info>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -43,6 +54,11 @@
-->
<service-ref>
<service-ref-name>Port1</service-ref-name>
+ <port-info>
+ <port-qname xmlns:nsp='http://org.jboss.ws/wsref'>nsp:TestEndpointPort</port-qname>
+ <config-name>Custom Client</config-name>
+ <config-file>META-INF/jbossws-client-config.xml</config-file>
+ </port-info>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -51,6 +67,11 @@
-->
<service-ref>
<service-ref-name>Port2</service-ref-name>
+ <port-info>
+ <service-endpoint-interface>org.jboss.test.ws.jaxws.webserviceref.TestEndpoint</service-endpoint-interface>
+ <config-name>Custom Client</config-name>
+ <config-file>META-INF/jbossws-client-config.xml</config-file>
+ </port-info>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -59,6 +80,18 @@
-->
<service-ref>
<service-ref-name>Port3</service-ref-name>
+ <port-info>
+ <service-endpoint-interface>org.jboss.test.ws.jaxws.webserviceref.TestEndpoint</service-endpoint-interface>
+ <port-qname xmlns:nsp='http://org.jboss.ws/wsref'>nsp:TestEndpointPort</port-qname>
+ <stub-property>
+ <name>javax.xml.ws.security.auth.username</name>
+ <value>kermit</value>
+ </stub-property>
+ <stub-property>
+ <name>javax.xml.ws.security.auth.password</name>
+ <value>thefrog</value>
+ </stub-property>
+ </port-info>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
Added: trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jbossws-client-config.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jbossws-client-config.xml (rev 0)
+++ trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jbossws-client-config.xml 2007-01-19 12:13:27 UTC (rev 2009)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+
+<jaxrpc-config xmlns="urn:jboss:jaxrpc-config:2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+ xsi:schemaLocation="urn:jboss:jaxrpc-config:2.0 jaxrpc-config_2_0.xsd">
+
+ <client-config>
+ <config-name>Custom Client</config-name>
+ </client-config>
+
+</jaxrpc-config>
\ No newline at end of file
Property changes on: trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jbossws-client-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml 2007-01-19 11:00:41 UTC (rev 2008)
+++ trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml 2007-01-19 12:13:27 UTC (rev 2009)
@@ -13,12 +13,12 @@
<service-endpoint-interface>org.jboss.test.ws.jaxws.webserviceref.SecureEndpoint</service-endpoint-interface>
<port-qname xmlns:nsp='http://org.jboss.ws/wsref'>nsp:SecureEndpointPort</port-qname>
<stub-property>
- <name>javax.xml.ws.security.auth.password</name>
- <value>j2ee</value>
+ <name>javax.xml.ws.security.auth.username</name>
+ <value>kermit</value>
</stub-property>
<stub-property>
- <name>javax.xml.ws.security.auth.username</name>
- <value>j2ee</value>
+ <name>javax.xml.ws.security.auth.password</name>
+ <value>thefrog</value>
</stub-property>
</port-info>
<wsdl-override>http://@jbosstest.host.name@:8080/jaxws-webserviceref-secure/SecureEndpoint?wsdl</wsdl-override>
@@ -29,12 +29,12 @@
<port-info>
<port-qname xmlns:nsp='http://org.jboss.ws/wsref'>nsp:SecureEndpointPort</port-qname>
<stub-property>
- <name>javax.xml.ws.security.auth.password</name>
- <value>j2ee</value>
+ <name>javax.xml.ws.security.auth.username</name>
+ <value>kermit</value>
</stub-property>
<stub-property>
- <name>javax.xml.ws.security.auth.username</name>
- <value>j2ee</value>
+ <name>javax.xml.ws.security.auth.password</name>
+ <value>thefrog</value>
</stub-property>
</port-info>
<wsdl-override>http://@jbosstest.host.name@:8080/jaxws-webserviceref-secure/SecureEndpoint?wsdl</wsdl-override>
@@ -45,12 +45,12 @@
<port-info>
<service-endpoint-interface>org.jboss.test.ws.jaxws.webserviceref.SecureEndpoint</service-endpoint-interface>
<stub-property>
- <name>javax.xml.ws.security.auth.password</name>
- <value>j2ee</value>
+ <name>javax.xml.ws.security.auth.username</name>
+ <value>kermit</value>
</stub-property>
<stub-property>
- <name>javax.xml.ws.security.auth.username</name>
- <value>j2ee</value>
+ <name>javax.xml.ws.security.auth.password</name>
+ <value>thefrog</value>
</stub-property>
</port-info>
<wsdl-override>http://@jbosstest.host.name@:8080/jaxws-webserviceref-secure/SecureEndpoint?wsdl</wsdl-override>
19 years, 3 months
JBossWS SVN: r2008 - trunk/build/etc/hudson.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-19 06:00:41 -0500 (Fri, 19 Jan 2007)
New Revision: 2008
Added:
trunk/build/etc/hudson/AS-5.x-init.sh
Log:
custom start/stop script for the hudson build environment
Added: trunk/build/etc/hudson/AS-5.x-init.sh
===================================================================
--- trunk/build/etc/hudson/AS-5.x-init.sh (rev 0)
+++ trunk/build/etc/hudson/AS-5.x-init.sh 2007-01-19 11:00:41 UTC (rev 2008)
@@ -0,0 +1,98 @@
+#!/bin/sh
+#
+# $Id: jboss_init_redhat.sh 46554 2006-07-28 10:29:13Z dimitris $
+#
+# JBoss Control Script
+#
+# To use this script run it as root - it will switch to the specified user
+#
+# Here is a little (and extremely primitive) startup/shutdown script
+# for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,
+# it's run by user 'jboss' and JDK binaries are in /usr/local/jdk/bin.
+# All this can be changed in the script itself.
+#
+# Either modify this script for your requirements or just ensure that
+# the following variables are set correctly before calling the script.
+
+#define where jboss is - this is the directory containing directories log, bin, conf etc
+JBOSS_HOME=../../../../AS-5.x/workspace/trunk/build/output/jboss-5.0.0.Beta2/
+
+#define the user under which jboss will run, or use 'RUNASIS' to run as the current user
+JBOSS_USER=RUNASIS
+
+#make sure java is in your path
+JAVAPTH=${JAVAPTH:-"/usr/local/jdk/bin"}
+
+#configuration to use, usually one of 'minimal', 'default', 'all'
+JBOSS_CONF=${JBOSS_CONF:-"default"}
+
+#bind address for jboss services, by default bind to *all* NICs
+JBOSS_HOST=${JBOSS_HOST:-"0.0.0.0"}
+
+#define the classpath for the shutdown class
+JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"}
+
+#define the script to use to start jboss
+JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF -b $JBOSS_HOST"}
+
+if [ "$JBOSS_USER" = "RUNASIS" ]; then
+ SUBIT=""
+else
+ SUBIT="su - $JBOSS_USER -c "
+fi
+
+if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
+ # ensure the file exists
+ touch $JBOSS_CONSOLE
+ if [ ! -z "$SUBIT" ]; then
+ chown $JBOSS_USER $JBOSS_CONSOLE
+ fi
+fi
+
+if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then
+ echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"
+ echo "WARNING: ignoring it and using /dev/null"
+ JBOSS_CONSOLE="/dev/null"
+fi
+
+#define what will be done with the console log
+JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}
+
+JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
+JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}
+
+if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
+ export PATH=$PATH:$JAVAPTH
+fi
+
+if [ ! -d "$JBOSS_HOME" ]; then
+ echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME
+ exit 1
+fi
+
+echo JBOSS_CMD_START = $JBOSS_CMD_START
+
+case "$1" in
+start)
+ cd $JBOSS_HOME/bin
+ if [ -z "$SUBIT" ]; then
+ eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
+ else
+ $SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &"
+ fi
+ ;;
+stop)
+ if [ -z "$SUBIT" ]; then
+ $JBOSS_CMD_STOP
+ else
+ $SUBIT "$JBOSS_CMD_STOP"
+ fi
+ ;;
+restart)
+ $0 stop
+ $0 start
+ ;;
+*)
+ echo "usage: $0 (start|stop|restart|help)"
+esac
+
Property changes on: trunk/build/etc/hudson/AS-5.x-init.sh
___________________________________________________________________
Name: svn:executable
+ *
19 years, 3 months
JBossWS SVN: r2007 - trunk/build/etc/hudson.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-19 05:39:28 -0500 (Fri, 19 Jan 2007)
New Revision: 2007
Modified:
trunk/build/etc/hudson/AS-5.x.properties
Log:
always check thirdparty updates
Modified: trunk/build/etc/hudson/AS-5.x.properties
===================================================================
--- trunk/build/etc/hudson/AS-5.x.properties 2007-01-19 10:11:35 UTC (rev 2006)
+++ trunk/build/etc/hudson/AS-5.x.properties 2007-01-19 10:39:28 UTC (rev 2007)
@@ -31,7 +31,7 @@
jboss.local.repository=/tmp
# Force thirdparty HTTP get
-#force.thirdparty.get=true
+force.thirdparty.get=true
# Java Compiler options
javac.debug=yes
19 years, 3 months