Author: dkulp
Date: Wed Nov 14 14:26:17 2007
New Revision: 595098
URL: http://svn.apache.org/viewvc?rev=595098&view=rev
Log:
Merged revisions 595027 via svnmerge from
https://svn.apache.org/repos/asf/incubator/cxf/trunk
........
r595027 | dkulp | 2007-11-14 14:57:47 -0500 (Wed, 14 Nov 2007) | 2 lines
[CXF-1199] ServiceResolver stuff from Jeff
........
Added:
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/endpoint/ServiceContactResolver.java
- copied unchanged from r595027,
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContactResolver.java
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistry.java
- copied unchanged from r595027,
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistry.java
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java
- copied unchanged from r595027,
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java
incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImplTest.java
- copied unchanged from r595027,
incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImplTest.java
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/resolver/
- copied from r595027,
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/resolver/
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java
- copied unchanged from r595027,
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/resolver/JarServiceContactResolver.java
- copied unchanged from r595027,
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/resolver/JarServiceContactResolver.java
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/resolver/Server.java
- copied unchanged from r595027,
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/resolver/Server.java
incubator/cxf/branches/2.0.x-fixes/systests/src/test/resources/wsdl/hello_world_resolver.jar
- copied unchanged from r595027,
incubator/cxf/trunk/systests/src/test/resources/wsdl/hello_world_resolver.jar
Modified:
incubator/cxf/branches/2.0.x-fixes/ (props changed)
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml?rev=595098&r1=595097&r2=595098&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml
Wed Nov 14 14:26:17 2007
@@ -115,4 +115,8 @@
<bean id="org.apache.cxf.catalog.OASISCatalogManager"
class="org.apache.cxf.catalog.OASISCatalogManager">
<property name="bus" ref="cxf"/>
</bean>
+
+ <bean id="org.apache.cxf.endpoint.ServiceContractResolverRegistry"
class="org.apache.cxf.endpoint.ServiceContractResolverRegistryImpl">
+ <property name="bus" ref="cxf"/>
+ </bean>
</beans>
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=595098&r1=595097&r2=595098&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
Wed Nov 14 14:26:17 2007
@@ -20,6 +20,7 @@
package org.apache.cxf.jaxws;
import java.net.MalformedURLException;
+import java.net.URI;
import java.net.URL;
import java.util.Collection;
import java.util.HashMap;
@@ -54,6 +55,7 @@
import org.apache.cxf.endpoint.ClientImpl;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.endpoint.EndpointException;
+import org.apache.cxf.endpoint.ServiceContractResolverRegistry;
import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.jaxb.JAXBDataBinding;
import org.apache.cxf.jaxws.binding.soap.JaxWsSoapBindingConfiguration;
@@ -97,11 +99,29 @@
public ServiceImpl(Bus b, URL url, QName name, Class<?> cls) {
bus = b;
- wsdlURL = url == null ? null : url.toString();
this.serviceName = name;
clazz = cls;
handlerResolver = new HandlerResolverImpl(bus, name, clazz);
+
+ if (null == url && null != bus) {
+ ServiceContractResolverRegistry registry =
+ bus.getExtension(ServiceContractResolverRegistry.class);
+ if (null != registry) {
+ URI uri = registry.getContractLocation(name);
+ if (null != uri) {
+ try {
+ url = uri.toURL();
+ } catch (MalformedURLException e) {
+ LOG.log(Level.FINE, "resolve qname failed", name);
+ throw new WebServiceException(e);
+ }
+ }
+ }
+ }
+
+ wsdlURL = url == null ? null : url.toString();
+
if (url != null) {
try {
initializePorts();
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=595098&r1=595097&r2=595098&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Wed Nov 14 14:26:17 2007
@@ -26,6 +26,8 @@
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type;
+import java.net.MalformedURLException;
+import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
@@ -50,6 +52,7 @@
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.endpoint.EndpointException;
import org.apache.cxf.endpoint.EndpointImpl;
+import org.apache.cxf.endpoint.ServiceContractResolverRegistry;
import org.apache.cxf.frontend.FaultInfoException;
import org.apache.cxf.frontend.MethodDispatcher;
import org.apache.cxf.frontend.SimpleMethodDispatcher;
@@ -1599,13 +1602,30 @@
for (AbstractServiceConfiguration c : serviceConfigurations) {
wsdlURL = c.getWsdlURL();
if (wsdlURL != null) {
- //create a unique string so if its an interned string (like
- //from an annotation), caches will clear
- wsdlURL = new String(wsdlURL);
break;
}
}
+ if (null == wsdlURL && getBus() != null) {
+ ServiceContractResolverRegistry registry =
+
getBus().getExtension(ServiceContractResolverRegistry.class);
+ if (null != registry) {
+ URI uri =
registry.getContractLocation(this.getServiceQName());
+ if (null != uri) {
+ try {
+ wsdlURL = uri.toURL().toString();
+ } catch (MalformedURLException e) {
+ LOG.log(Level.FINE, "resolve qname failed",
this.getServiceQName());
+ }
+ }
+ }
+ }
+ if (wsdlURL != null) {
+ //create a unique string so if its an interned string (like
+ //from an annotation), caches will clear
+ wsdlURL = new String(wsdlURL);
+ }
}
+
return wsdlURL;
}