Author: thomas.diesler(a)jboss.com
Date: 2007-01-18 06:59:39 -0500 (Thu, 18 Jan 2007)
New Revision: 1992
Added:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/ConfigProvider.java
Removed:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/ServiceConfiguration.java
Modified:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java
trunk/jbossws-core/src/main/java/javax/xml/ws/Service.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/StubExt.java
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/spi/ServiceDelegateImpl.java
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml
Log:
Fix jaxws service configuratuion
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-17
23:09:05 UTC (rev 1991)
+++
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java 2007-01-18
11:59:39 UTC (rev 1992)
@@ -46,8 +46,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.StubExt;
-import org.jboss.ws.core.jaxws.ServiceConfiguration;
+import org.jboss.ws.core.ConfigProvider;
import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
import org.jboss.ws.core.server.UnifiedVirtualFile;
@@ -130,6 +129,17 @@
}
}
+ // 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());
+
+ }
+
if (targetClassName != null && targetClassName.equals(serviceClassName)
== false)
{
try
@@ -159,8 +169,6 @@
throw ex.getTargetException();
}
}
-
- configureInjectionTarget(target, usRef);
return target;
}
@@ -171,22 +179,6 @@
}
}
- private void configureInjectionTarget(Object target, UnifiedServiceRef usRef)
- {
- if (target instanceof ServiceConfiguration)
- {
- ServiceConfiguration service = (ServiceConfiguration)target;
- service.setConfigName(usRef.getConfigName());
- service.setConfigFile(usRef.getConfigFile());
- }
- if (target instanceof StubExt)
- {
- StubExt stub = (StubExt)target;
- stub.setConfigName(usRef.getConfigName());
- stub.setConfigFile(usRef.getConfigFile());
- }
- }
-
private UnifiedServiceRef unmarshallServiceRef(Reference ref) throws
ClassNotFoundException, NamingException
{
UnifiedServiceRef sref;
@@ -209,7 +201,7 @@
{
UnifiedVirtualFile vfsRoot = usRef.getRootFile();
String wsdlLocation = usRef.getWsdlLocation();
-
+
URL wsdlURL = null;
if (wsdlLocation != null)
{
Modified: trunk/jbossws-core/src/main/java/javax/xml/ws/Service.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/ws/Service.java 2007-01-17 23:09:05 UTC
(rev 1991)
+++ trunk/jbossws-core/src/main/java/javax/xml/ws/Service.java 2007-01-18 11:59:39 UTC
(rev 1992)
@@ -23,6 +23,9 @@
// $Id$
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
import java.util.Iterator;
import javax.xml.bind.JAXBContext;
@@ -63,9 +66,8 @@
**/
public class Service
{
+ protected ServiceDelegate delegate;
- private ServiceDelegate delegate;
-
/**
* The orientation of a dynamic client or service. MESSAGE provides
* access to entire protocol message, PAYLOAD to protocol message
@@ -714,9 +716,25 @@
* @throws WebServiceException If any error in creation of the
* specified service.
**/
- public static Service create(java.net.URL wsdlDocumentLocation, QName serviceName)
+ public static Service create(URL wsdlLocation, QName serviceName)
{
- return new Service(wsdlDocumentLocation, serviceName);
+ Service service;
+ try
+ {
+ Class extClass =
Class.forName("org.jboss.ws.core.jaxws.client.ServiceExt");
+ Constructor ctor = extClass.getConstructor(new Class[]{URL.class,
QName.class});
+ service = (Service)ctor.newInstance(new Object[]{wsdlLocation, serviceName});
+ }
+ catch (InvocationTargetException ex)
+ {
+ RuntimeException rte = (RuntimeException)ex.getTargetException();
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ service = new Service(wsdlLocation, serviceName);
+ }
+ return service;
}
/**
@@ -728,6 +746,6 @@
*/
public static Service create(QName serviceName)
{
- return new Service(null, serviceName);
+ return create(null, serviceName);
}
}
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/core/ConfigProvider.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/ConfigProvider.java
(rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/ConfigProvider.java 2007-01-18
11:59:39 UTC (rev 1992)
@@ -0,0 +1,53 @@
+/*
+ * 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;
+
+// $Id$
+
+/**
+ * Provides configuration for JAXRPC/JAXWS ports
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 17-Jan-2006
+ */
+public interface ConfigProvider
+{
+ /**
+ * Get the port configuration file
+ */
+ String getConfigFile();
+
+ /**
+ * Set the port configuration file
+ */
+ void setConfigFile(String configFile);
+
+ /**
+ * Get the port configuration name
+ */
+ String getConfigName();
+
+ /**
+ * Set the port configuration name
+ */
+ void setConfigName(String configName);
+}
Property changes on:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/ConfigProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/StubExt.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/StubExt.java 2007-01-17 23:09:05
UTC (rev 1991)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/StubExt.java 2007-01-18 11:59:39
UTC (rev 1992)
@@ -37,7 +37,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 17-Jan-2007
*/
-public interface StubExt
+public interface StubExt extends ConfigProvider
{
/** ClientTimeout property: org.jboss.ws.timeout */
static final String PROPERTY_CLIENT_TIMEOUT = "org.jboss.ws.timeout";
@@ -126,28 +126,4 @@
* Creates a new empty AttachmentPart object.
*/
AttachmentPart createAttachmentPart();
-
- /**
- * Get the current port configuration file
- * A propriatory extension, that is not part of JAXRPC.
- */
- String getConfigFile();
-
- /**
- * Set the current port configuration file
- * A propriatory extension, that is not part of JAXRPC.
- */
- void setConfigFile(String configFile);
-
- /**
- * Get the current port configuration name
- * A propriatory extension, that is not part of JAXRPC.
- */
- String getConfigName();
-
- /**
- * Set the current port configuration name
- * A propriatory extension, that is not part of JAXRPC.
- */
- void setConfigName(String configName);
}
Deleted:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/ServiceConfiguration.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/ServiceConfiguration.java 2007-01-17
23:09:05 UTC (rev 1991)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/ServiceConfiguration.java 2007-01-18
11:59:39 UTC (rev 1992)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws;
-
-// $Id$
-
-/**
- * Service provider for ServiceDelegate and Endpoint objects.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 17-Jan-2006
- */
-public interface ServiceConfiguration
-{
- /**
- * Get the port configuration file for newly created ports
- */
- String getConfigFile();
-
- /**
- * Set the port configuration file for newly created ports
- */
- void setConfigFile(String configFile);
-
- /**
- * Get the port configuration name for newly created ports
- */
- String getConfigName();
-
- /**
- * Set the port configuration name for newly created ports
- */
- void setConfigName(String configName);
-}
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-17
23:09:05 UTC (rev 1991)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-01-18
11:59:39 UTC (rev 1992)
@@ -63,7 +63,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 04-Jul-2006
*/
-public class ClientImpl extends CommonClient implements BindingProvider, StubExt
+public class ClientImpl extends CommonClient implements BindingProvider
{
// provide logging
private static Logger log = Logger.getLogger(ClientImpl.class);
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-17
23:09:05 UTC (rev 1991)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-18
11:59:39 UTC (rev 1992)
@@ -47,7 +47,6 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.core.StubExt;
-import org.jboss.ws.core.jaxws.ServiceConfiguration;
import org.jboss.ws.core.jaxws.client.ClientImpl;
import org.jboss.ws.core.jaxws.client.ClientProxy;
import org.jboss.ws.core.jaxws.client.DispatchImpl;
@@ -69,7 +68,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 03-May-2006
*/
-public class ServiceDelegateImpl extends ServiceDelegate implements ServiceConfiguration
+public class ServiceDelegateImpl extends ServiceDelegate
{
// provide logging
private final Logger log = Logger.getLogger(ServiceDelegateImpl.class);
@@ -83,10 +82,6 @@
private HandlerResolver handlerResolver = new HandlerResolverImpl();
// The executor service
private ExecutorService executor;
- // The config name for all created ports
- private String configName;
- // The config file for all created ports
- private String configFile;
// A list of annotated ports
private List<QName> annotatedPorts = new ArrayList<QName>();
@@ -106,26 +101,6 @@
}
}
- 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;
- }
-
/**
* 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.
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-17
23:09:05 UTC (rev 1991)
+++
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml 2007-01-18
11:59:39 UTC (rev 1992)
@@ -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:ns1='http://org.jboss.ws/wsref'>ns1:SecureEndpointService</service-qname-->
+ <service-qname
xmlns:nss='http://org.jboss.ws/wsref'>nss:SecureEndpointService</service-qname>
<port-info>
<service-endpoint-interface>org.jboss.test.ws.jaxws.webserviceref.SecureEndpoint</service-endpoint-interface>
- <!--wsdl-port
xmlns:ns1='http://org.jboss.ws/wsref'>ns1:SecureEndpointPort</wsdl-port-->
+ <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>
@@ -27,7 +27,7 @@
<service-ref>
<service-ref-name>SecureService2</service-ref-name>
<port-info>
- <!--wsdl-port
xmlns:ns1='http://org.jboss.ws/wsref'>ns1:SecureEndpointPort</wsdl-port-->
+ <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>