Author: dkulp Date: Fri Nov 14 13:26:26 2008 New Revision: 714151 URL: http://svn.apache.org/viewvc?rev=714151&view=rev Log: Merged revisions 713808 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.1.x-fixes
................ r713808 | dkulp | 2008-11-13 15:07:46 -0500 (Thu, 13 Nov 2008) | 10 lines Merged revisions 713804 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r713804 | dkulp | 2008-11-13 14:57:18 -0500 (Thu, 13 Nov 2008) | 3 lines Remove some unused code Wire in conduits into wsdl/schema resolving so configured https conduits can be used to retrieve wsdls/schemas ........ ................ Added: cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java - copied unchanged from r713808, cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/transport/TransportURIResolver.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/AbstractWrapperWSDLLocator.java - copied unchanged from r713808, cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/AbstractWrapperWSDLLocator.java Removed: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/XmlSchemaURIResolver.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLResolver.java Modified: cxf/branches/2.0.x-fixes/ (props changed) cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/ExtendedURIResolver.java cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/HTTPSClientTest.java cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/resources/resource-key-spec-url.xml cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/wsdl/CrossSchemaImportsTests.java (props changed) cxf/branches/2.0.x-fixes/tools/javato/ws/pom.xml cxf/branches/2.0.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java Propchange: cxf/branches/2.0.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Nov 14 13:26:26 2008 @@ -1,3 +1,3 @@ -/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472,694717,694748-694749,694870,695503,695509,695553,695555,695563,695875-695877,695940,695980,696436,696455,696721,697086,698129,701526,701634,702275,702443,702527,702582,702604,702610,702642-702643,702649,702760,702870,702873,702959,703193,703242,703523,704303,704587,704738,704998,705153,705280-705449,705455,709357,709641,709644,710177,710184,711736,712199,712225,712275,712600,712896,713083,713410,713413,713594,713599 -/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694869,695396,695484,695537,695552,695561,695619,695684,695835,695935,695977,696094,696433,696720,697085,698128,700261,700602,701783,701830,701862,702267,702580,702602,702609,702616,702656,702957,703191,703239,703501,704584,704997,705150,705274,705340,705446,708550,708554,709353-709354,709425,710150,712194,712198,712272,712312,712670,712893,713082,713584,713597 +/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472,694717,694748-694749,694870,695503,695509,695553,695555,695563,695875-695877,695940,695980,696436,696455,696721,697086,698129,701526,701634,702275,702443,702527,702582,702604,702610,702642-702643,702649,702760,702870,702873,702959,703193,703242,703523,704303,704587,704738,704998,705153,705280-705449,705455,709357,709641,709644,710177,710184,711736,712199,712225,712275,712600,712896,713083,713410,713413,713594,713599,713808 +/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694869,695396,695484,695537,695552,695561,695619,695684,695835,695935,695977,696094,696433,696720,697085,698128,700261,700602,701783,701830,701862,702267,702580,702602,702609,702616,702656,702957,703191,703239,703501,704584,704997,705150,705274,705340,705446,708550,708554,709353-709354,709425,710150,712194,712198,712272,712312,712670,712893,713082,713584,713597,713804 /incubator/cxf/trunk:434594-651668 Propchange: cxf/branches/2.0.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/ExtendedURIResolver.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/ExtendedURIResolver.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/ExtendedURIResolver.java (original) +++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/ExtendedURIResolver.java Fri Nov 14 13:26:26 2008 @@ -28,9 +28,9 @@ public class ExtendedURIResolver { - private org.apache.cxf.resource.URIResolver currentResolver; - private String lastestImportUri; - private Stack<InputStream> resourceOpened = new Stack<InputStream>(); + protected org.apache.cxf.resource.URIResolver currentResolver; + protected String lastestImportUri; + protected Stack<InputStream> resourceOpened = new Stack<InputStream>(); public ExtendedURIResolver() { currentResolver = new org.apache.cxf.resource.URIResolver(); Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java (original) +++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java Fri Nov 14 13:26:26 2008 @@ -73,6 +73,11 @@ } } + public void unresolve() { + this.file = null; + this.uri = null; + this.is = null; + } public void resolve(String baseUriStr, String uriStr, Class callingCls) throws IOException { this.calling = (callingCls != null) ? callingCls : getClass(); Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java Fri Nov 14 13:26:26 2008 @@ -25,7 +25,9 @@ import org.xml.sax.InputSource; +import org.apache.cxf.Bus; import org.apache.cxf.resource.ExtendedURIResolver; +import org.apache.cxf.transport.TransportURIResolver; import org.apache.xml.resolver.Catalog; /** @@ -38,15 +40,24 @@ private Catalog catalogResolver; private String baseUri; + public CatalogWSDLLocator(String wsdlUrl) { + this.baseUri = wsdlUrl; + this.resolver = new ExtendedURIResolver(); + } public CatalogWSDLLocator(String wsdlUrl, OASISCatalogManager catalogManager) { this.baseUri = wsdlUrl; this.catalogResolver = catalogManager.getCatalog(); this.resolver = new ExtendedURIResolver(); } + public CatalogWSDLLocator(String wsdlUrl, Bus b) { + this.baseUri = wsdlUrl; + this.catalogResolver = OASISCatalogManager.getCatalogManager(b).getCatalog(); + this.resolver = new TransportURIResolver(b); + } public InputSource getBaseInputSource() { InputSource result = resolver.resolve(baseUri, null); - if (result == null) { + if (result == null && catalogResolver != null) { try { String s = catalogResolver.resolveSystem(baseUri); if (s != null) { @@ -88,17 +99,18 @@ this.baseUri = parent; String resolvedImportLocation = null; - try { - resolvedImportLocation = this.catalogResolver.resolveSystem(importLocation); - if (resolvedImportLocation == null) { - resolvedImportLocation = catalogResolver.resolveURI(importLocation); - } - if (resolvedImportLocation == null) { - resolvedImportLocation = catalogResolver.resolvePublic(importLocation, parent); + if (catalogResolver != null) { + try { + resolvedImportLocation = this.catalogResolver.resolveSystem(importLocation); + if (resolvedImportLocation == null) { + resolvedImportLocation = catalogResolver.resolveURI(importLocation); + } + if (resolvedImportLocation == null) { + resolvedImportLocation = catalogResolver.resolvePublic(importLocation, parent); + } + } catch (IOException e) { + throw new RuntimeException("Catalog resolution failed", e); } - - } catch (IOException e) { - throw new RuntimeException("Catalog resolution failed", e); } InputSource in = null; Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java Fri Nov 14 13:26:26 2008 @@ -18,6 +18,7 @@ */ package org.apache.cxf.catalog; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; @@ -27,6 +28,7 @@ import org.apache.cxf.helpers.IOUtils; import org.apache.cxf.resource.ExtendedURIResolver; +import org.apache.cxf.transport.TransportURIResolver; import org.apache.ws.commons.schema.XmlSchemaException; import org.apache.ws.commons.schema.resolver.URIResolver; import org.apache.xml.resolver.Catalog; @@ -40,6 +42,11 @@ private Catalog catalogResolver; private Map<String, String> resolved = new HashMap<String, String>(); + public CatalogXmlSchemaURIResolver(Bus bus) { + this(OASISCatalogManager.getCatalogManager(bus)); + this.resolver = new TransportURIResolver(bus); + this.catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog(); + } public CatalogXmlSchemaURIResolver(OASISCatalogManager catalogManager) { this.resolver = new ExtendedURIResolver(); this.catalogResolver = catalogManager.getCatalog(); @@ -81,7 +88,8 @@ + (baseUri == null ? "." : ", relative to '" + baseUri + "'.")); - } else if (in.getByteStream() != null) { + } else if (in.getByteStream() != null + && !(in.getByteStream() instanceof ByteArrayInputStream)) { //workaround bug in XmlSchema - XmlSchema is not closing the InputStreams //that are returned for imports. Thus, with a lot of services starting up //or a lot of schemas imported or similar, it's easy to run out of Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java Fri Nov 14 13:26:26 2008 @@ -104,10 +104,13 @@ } public void configureBean(Object beanInstance) { - configureBean(null, beanInstance); + configureBean(null, beanInstance, true); } - public synchronized void configureBean(String bn, Object beanInstance) { + public void configureBean(String bn, Object beanInstance) { + configureBean(bn, beanInstance, true); + } + public synchronized void configureBean(String bn, Object beanInstance, boolean checkWildcards) { if (null == appContexts) { return; @@ -120,8 +123,9 @@ if (null == bn) { return; } - - configureWithWildCard(bn, beanInstance); + if (checkWildcards) { + configureWithWildCard(bn, beanInstance); + } final String beanName = bn; setBeanWiringInfoResolver(new BeanWiringInfoResolver() { @@ -155,7 +159,7 @@ } private void configureWithWildCard(String bn, Object beanInstance) { - if (!wildCardBeanDefinitions.isEmpty() && !isWildcardBeanName(bn)) { + if (!wildCardBeanDefinitions.isEmpty()) { String className = beanInstance.getClass().getName(); List<MatcherHolder> matchers = wildCardBeanDefinitions.get(className); if (matchers != null) { @@ -163,7 +167,7 @@ synchronized (m.matcher) { m.matcher.reset(bn); if (m.matcher.matches()) { - configureBean(m.wildCardId, beanInstance); + configureBean(m.wildCardId, beanInstance, false); return; } } Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java Fri Nov 14 13:26:26 2008 @@ -29,6 +29,7 @@ import org.apache.cxf.Bus; import org.apache.cxf.BusException; +import org.apache.cxf.bus.extension.DeferredMap; import org.apache.cxf.common.i18n.BundleUtils; import org.apache.cxf.common.i18n.Message; import org.apache.cxf.configuration.spring.MapProvider; @@ -110,7 +111,24 @@ } public ConduitInitiator getConduitInitiatorForUri(String uri) { - // TODO Auto-generated method stub + for (ConduitInitiator ci : conduitInitiators.values()) { + for (String prefix : ci.getUriPrefixes()) { + if (uri.startsWith(prefix)) { + return ci; + } + } + } + //looks like we'll need to undefer everything so we can try again. + if (conduitInitiators instanceof DeferredMap) { + ((DeferredMap)conduitInitiators).undefer(); + for (ConduitInitiator df : conduitInitiators.values()) { + for (String prefix : df.getUriPrefixes()) { + if (uri.startsWith(prefix)) { + return df; + } + } + } + } return null; } Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java Fri Nov 14 13:26:26 2008 @@ -136,6 +136,7 @@ if (!mp.containsKey("")) { Definition def = new ServiceWSDLBuilder(bus, endpointInfo.getService()).build(); + mp.put("", def); updateDefinition(def, mp, smp, base, endpointInfo); } Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java Fri Nov 14 13:26:26 2008 @@ -18,7 +18,6 @@ */ package org.apache.cxf.wsdl11; -import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -27,91 +26,39 @@ import org.apache.cxf.Bus; import org.apache.cxf.catalog.CatalogWSDLLocator; -import org.apache.cxf.catalog.OASISCatalogManager; import org.apache.cxf.resource.ResourceManager; -public class ResourceManagerWSDLLocator implements WSDLLocator { - WSDLLocator parent; +public class ResourceManagerWSDLLocator extends AbstractWrapperWSDLLocator { Bus bus; - String wsdlUrl; - InputSource last; - String baseUri; - boolean fromParent; public ResourceManagerWSDLLocator(String wsdlUrl, WSDLLocator parent, Bus bus) { - this.wsdlUrl = wsdlUrl; + super(wsdlUrl, parent); this.bus = bus; - this.parent = parent; } public ResourceManagerWSDLLocator(String wsdlUrl, Bus bus) { - this.wsdlUrl = wsdlUrl; + super(wsdlUrl, new CatalogWSDLLocator(wsdlUrl, bus)); this.bus = bus; - this.parent = new CatalogWSDLLocator(wsdlUrl, OASISCatalogManager.getCatalogManager(bus)); } - public void close() { - if (!fromParent) { - try { - if (last.getByteStream() != null) { - last.getByteStream().close(); - } - } catch (IOException e) { - //ignore - } + public InputSource getInputSource() { + InputStream ins = bus.getExtension(ResourceManager.class).getResourceAsStream(wsdlUrl); + InputSource is = new InputSource(ins); + is.setSystemId(wsdlUrl); + is.setPublicId(wsdlUrl); + + URL url = bus.getExtension(ResourceManager.class).resolveResource(wsdlUrl, URL.class); + if (url != null) { + is.setSystemId(url.toString()); + is.setPublicId(url.toString()); } - parent.close(); - } - - public InputSource getBaseInputSource() { - InputSource is = parent.getBaseInputSource(); - fromParent = true; - if (is == null) { - InputStream ins = bus.getExtension(ResourceManager.class).getResourceAsStream(wsdlUrl); - is = new InputSource(ins); - is.setSystemId(wsdlUrl); - is.setPublicId(wsdlUrl); - - URL url = bus.getExtension(ResourceManager.class).resolveResource(wsdlUrl, URL.class); - if (url != null) { - is.setSystemId(url.toString()); - is.setPublicId(url.toString()); - } - fromParent = false; - baseUri = is.getPublicId(); - } else { - baseUri = is.getSystemId(); - } - last = is; - + baseUri = is.getPublicId(); return is; } - - public String getBaseURI() { - if (last == null) { - getBaseInputSource(); - try { - if (last.getByteStream() != null) { - last.getByteStream().close(); - } - } catch (IOException e) { - //ignore - } - } - return baseUri; - } - - public InputSource getImportInputSource(String parentLocation, String importLocation) { - return parent.getImportInputSource(parentLocation, importLocation); - } - - public String getLatestImportURI() { - return parent.getLatestImportURI(); - } - + } Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java Fri Nov 14 13:26:26 2008 @@ -38,7 +38,6 @@ import org.apache.cxf.Bus; import org.apache.cxf.catalog.CatalogXmlSchemaURIResolver; -import org.apache.cxf.catalog.OASISCatalogManager; import org.apache.cxf.common.xmlschema.SchemaCollection; import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.service.model.SchemaInfo; @@ -119,7 +118,7 @@ schemaCol.setBaseUri(def.getDocumentBaseURI()); CatalogXmlSchemaURIResolver schemaResolver = - new CatalogXmlSchemaURIResolver(OASISCatalogManager.getCatalogManager(bus)); + new CatalogXmlSchemaURIResolver(bus); schemaCol.setSchemaResolver(schemaResolver); XmlSchema xmlSchema = schemaCol.read(schemaElem, systemId); Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java Fri Nov 14 13:26:26 2008 @@ -386,6 +386,39 @@ } protected void buildService(ServiceInfo serviceInfo) { + + Map<QName, MessageInfo> messages = serviceInfo.getMessages(); + for (Map.Entry<QName, MessageInfo> mie : messages.entrySet()) { + if (!mie.getKey().getNamespaceURI().equals(definition.getTargetNamespace())) { + continue; + } + if (definition.getMessage(mie.getKey()) != null) { + continue; + } + Message message = definition.createMessage(); + message.setUndefined(false); + message.setQName(mie.getKey()); + for (MessagePartInfo mpi : mie.getValue().getMessageParts()) { + Part part = definition.createPart(); + boolean elemental = mpi.isElement(); + // RFSB will turn on isElement bogusly. + if (elemental + && null == serviceInfo.getXmlSchemaCollection(). + getElementByQName(mpi.getElementQName())) { + elemental = false; + } + if (elemental) { + part.setElementName(mpi.getElementQName()); + } else { + part.setTypeName(mpi.getTypeQName()); + } + part.setName(mpi.getName().getLocalPart()); + message.addPart(part); + } + + definition.addMessage(message); + } + Service serv = definition.createService(); serv.setQName(serviceInfo.getName()); addNamespace(serviceInfo.getName().getNamespaceURI()); Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java Fri Nov 14 13:26:26 2008 @@ -51,7 +51,6 @@ import org.apache.cxf.Bus; import org.apache.cxf.BusException; import org.apache.cxf.catalog.CatalogWSDLLocator; -import org.apache.cxf.catalog.OASISCatalogManager; import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.common.util.CacheMap; import org.apache.cxf.common.util.PropertiesLoaderUtils; @@ -203,8 +202,7 @@ WSDLReader reader = factory.newWSDLReader(); reader.setFeature("javax.wsdl.verbose", false); reader.setExtensionRegistry(registry); - CatalogWSDLLocator catLocator = - new CatalogWSDLLocator(url, OASISCatalogManager.getCatalogManager(bus)); + CatalogWSDLLocator catLocator = new CatalogWSDLLocator(url, bus); ResourceManagerWSDLLocator wsdlLocator = new ResourceManagerWSDLLocator(url, catLocator, bus); Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Fri Nov 14 13:26:26 2008 @@ -101,10 +101,15 @@ private static final Logger LOG = LogUtils.getL7dLogger(WSDLServiceBuilder.class); private Bus bus; private Map<String, Element> schemaList = new HashMap<String, Element>(); + private boolean recordOriginal = true; public WSDLServiceBuilder(Bus bus) { this.bus = bus; } + public WSDLServiceBuilder(Bus bus, boolean record) { + this.bus = bus; + recordOriginal = record; + } private void copyExtensors(AbstractPropertiesHolder info, List<?> extList) { if (info != null) { @@ -124,7 +129,9 @@ public List<ServiceInfo> buildServices(Definition d) { DescriptionInfo description = new DescriptionInfo(); - description.setProperty(WSDL_DEFINITION, d); + if (recordOriginal) { + description.setProperty(WSDL_DEFINITION, d); + } description.setName(d.getQName()); description.setBaseURI(d.getDocumentBaseURI()); copyExtensors(description, d.getExtensibilityElements()); @@ -169,7 +176,9 @@ if (def.getPortTypes().size() == 0) { DescriptionInfo description = new DescriptionInfo(); - description.setProperty(WSDL_DEFINITION, def); + if (recordOriginal) { + description.setProperty(WSDL_DEFINITION, def); + } description.setName(def.getQName()); description.setBaseURI(def.getDocumentBaseURI()); copyExtensors(description, def.getExtensibilityElements()); @@ -177,7 +186,9 @@ ServiceInfo service = new ServiceInfo(); service.setDescription(description); - service.setProperty(WSDL_DEFINITION, def); + if (recordOriginal) { + service.setProperty(WSDL_DEFINITION, def); + } getSchemas(def, service); service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList); @@ -189,7 +200,9 @@ public ServiceInfo buildMockService(Definition def, PortType p) { DescriptionInfo description = new DescriptionInfo(); - description.setProperty(WSDL_DEFINITION, def); + if (recordOriginal) { + description.setProperty(WSDL_DEFINITION, def); + } description.setName(def.getQName()); description.setBaseURI(def.getDocumentBaseURI()); copyExtensors(description, def.getExtensibilityElements()); @@ -197,7 +210,9 @@ ServiceInfo service = new ServiceInfo(); service.setDescription(description); - service.setProperty(WSDL_DEFINITION, def); + if (recordOriginal) { + service.setProperty(WSDL_DEFINITION, def); + } getSchemas(def, service); service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList); @@ -213,7 +228,9 @@ DescriptionInfo description = d; if (null == description) { description = new DescriptionInfo(); - description.setProperty(WSDL_DEFINITION, def); + if (recordOriginal) { + description.setProperty(WSDL_DEFINITION, def); + } description.setName(def.getQName()); description.setBaseURI(def.getDocumentBaseURI()); copyExtensors(description, def.getExtensibilityElements()); @@ -233,8 +250,10 @@ service = new ServiceInfo(); service.setDescription(description); description.getDescribed().add(service); - service.setProperty(WSDL_DEFINITION, def); - service.setProperty(WSDL_SERVICE, serv); + if (recordOriginal) { + service.setProperty(WSDL_DEFINITION, def); + service.setProperty(WSDL_SERVICE, serv); + } getSchemas(def, service); service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList); @@ -462,7 +481,9 @@ } this.copyExtensors(inf, p.getExtensibilityElements()); this.copyExtensionAttributes(inf, p); - inf.setProperty(WSDL_PORTTYPE, p); + if (recordOriginal) { + inf.setProperty(WSDL_PORTTYPE, p); + } for (Operation op : cast(p.getOperations(), Operation.class)) { buildInterfaceOperation(inf, op); } @@ -471,7 +492,9 @@ private void buildInterfaceOperation(InterfaceInfo inf, Operation op) { OperationInfo opInfo = inf.addOperation(new QName(inf.getName().getNamespaceURI(), op.getName())); - opInfo.setProperty(WSDL_OPERATION, op); + if (recordOriginal) { + opInfo.setProperty(WSDL_OPERATION, op); + } List<String> porderList = CastUtils.cast((List)op.getParameterOrdering()); opInfo.setParameterOrdering(porderList); this.copyExtensors(opInfo, op.getExtensibilityElements()); Modified: cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java Fri Nov 14 13:26:26 2008 @@ -89,7 +89,7 @@ bindingFactoryManager = control.createMock(BindingFactoryManager.class); destinationFactoryManager = control.createMock(DestinationFactoryManager.class); destinationFactory = control.createMock(DestinationFactory.class); - wsdlServiceBuilder = new WSDLServiceBuilder(bus); + wsdlServiceBuilder = new WSDLServiceBuilder(bus, false); for (Service serv : CastUtils.cast(def.getServices().values(), Service.class)) { if (serv != null) { @@ -110,10 +110,7 @@ control.replay(); serviceInfo = wsdlServiceBuilder.buildServices(def, service).get(0); - serviceInfo.setProperty(WSDLServiceBuilder.WSDL_DEFINITION, null); - serviceInfo.setProperty(WSDLServiceBuilder.WSDL_SERVICE, null); newDef = new ServiceWSDLBuilder(bus, serviceInfo).build(); - } @After Modified: cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java (original) +++ cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java Fri Nov 14 13:26:26 2008 @@ -44,6 +44,7 @@ import org.apache.cxf.Bus; import org.apache.cxf.binding.BindingFactoryManager; +import org.apache.cxf.catalog.CatalogWSDLLocator; import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.common.xmlschema.SchemaCollection; import org.apache.cxf.helpers.CastUtils; @@ -112,7 +113,7 @@ WSDLReader wsdlReader = wsdlFactory.newWSDLReader(); wsdlReader.setFeature("javax.wsdl.verbose", false); - def = wsdlReader.readWSDL(new WSDLLocatorImpl(wsdlUrl)); + def = wsdlReader.readWSDL(new CatalogWSDLLocator(wsdlUrl)); int seq = 0; for (Service serv : CastUtils.cast(def.getServices().values(), Service.class)) { Modified: cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java (original) +++ cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java Fri Nov 14 13:26:26 2008 @@ -34,11 +34,11 @@ import org.apache.cxf.Bus; import org.apache.cxf.binding.BindingFactoryManager; +import org.apache.cxf.catalog.CatalogWSDLLocator; import org.apache.cxf.service.model.MessageInfo; import org.apache.cxf.service.model.OperationInfo; import org.apache.cxf.service.model.ServiceInfo; import org.apache.cxf.transport.DestinationFactoryManager; -import org.apache.cxf.wsdl11.WSDLLocatorImpl; import org.apache.cxf.wsdl11.WSDLServiceBuilder; import org.easymock.classextension.EasyMock; import org.easymock.classextension.IMocksControl; @@ -143,7 +143,7 @@ private ServiceInfo getMockedServiceModel(String wsdlUrl) throws Exception { WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); wsdlReader.setFeature("javax.wsdl.verbose", false); - Definition def = wsdlReader.readWSDL(new WSDLLocatorImpl(wsdlUrl)); + Definition def = wsdlReader.readWSDL(new CatalogWSDLLocator(wsdlUrl)); IMocksControl control = EasyMock.createNiceControl(); Bus bus = control.createMock(Bus.class); Modified: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/HTTPSClientTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/HTTPSClientTest.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/HTTPSClientTest.java (original) +++ cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/HTTPSClientTest.java Fri Nov 14 13:26:26 2008 @@ -19,6 +19,8 @@ package org.apache.cxf.systest.http; +import java.net.URL; + import javax.xml.ws.BindingProvider; import org.apache.cxf.BusFactory; @@ -75,12 +77,19 @@ // // tests // - - - public final void testSuccessfulCall(String configuration, String address) throws Exception { + public final void testSuccessfulCall(String configuration, + String address) throws Exception { + testSuccessfulCall(configuration, address, null); + } + public final void testSuccessfulCall(String configuration, + String address, + URL url) throws Exception { setTheConfiguration(configuration); startServers(); - SOAPService service = new SOAPService(); + if (url == null) { + url = SOAPService.WSDL_LOCATION; + } + SOAPService service = new SOAPService(url, SOAPService.SERVICE); assertNotNull("Service is null", service); final Greeter port = service.getHttpsPort(); assertNotNull("Port is null", port); @@ -120,6 +129,7 @@ @Test public final void testResourceKeySpecEndpointURL() throws Exception { testSuccessfulCall("resources/resource-key-spec-url.xml", - "https://localhost:9005/SoapContext/HttpsPort"); + "https://localhost:9005/SoapContext/HttpsPort", + new URL("https://localhost:9005/SoapContext/HttpsPort?wsdl")); } } Modified: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/resources/resource-key-spec-url.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/resources/resource-key-spec-url.xml?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/resources/resource-key-spec-url.xml (original) +++ cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/resources/resource-key-spec-url.xml Fri Nov 14 13:26:26 2008 @@ -80,7 +80,7 @@ <!-- --> <!-- This test exercises the resource attribute in a keyStore and certStore element --> <!-- --> - <http:conduit name="https://localhost:9005/SoapContext/HttpsPort"> + <http:conduit name="https://localhost:9005/SoapContext/HttpsPort.*"> <http:tlsClientParameters disableCNCheck="true"> <sec:keyManagers keyPassword="password"> <sec:keyStore type="pkcs12" password="password" Propchange: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/wsdl/CrossSchemaImportsTests.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Nov 14 13:26:26 2008 @@ -1 +1 @@ -/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/wsdl/CrossSchemaImportsTests.java:712600,713083,713410,713413,713594,713599 +/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/wsdl/CrossSchemaImportsTests.java:712600,713083,713410,713413,713594,713599,713808 Modified: cxf/branches/2.0.x-fixes/tools/javato/ws/pom.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/javato/ws/pom.xml?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/tools/javato/ws/pom.xml (original) +++ cxf/branches/2.0.x-fixes/tools/javato/ws/pom.xml Fri Nov 14 13:26:26 2008 @@ -129,7 +129,12 @@ <artifactId>cxf-rt-databinding-aegis</artifactId> <version>${project.version}</version> </dependency> - + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-transports-http-jetty</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> Modified: cxf/branches/2.0.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java?rev=714151&r1=714150&r2=714151&view=diff ============================================================================== --- cxf/branches/2.0.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java (original) +++ cxf/branches/2.0.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java Fri Nov 14 13:26:26 2008 @@ -24,6 +24,7 @@ import java.util.Collection; import javax.xml.namespace.QName; +import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; import org.apache.cxf.helpers.IOUtils; import org.apache.cxf.jaxb.JAXBDataBinding; @@ -35,6 +36,7 @@ import org.apache.cxf.tools.fortest.withannotation.doc.Hello; import org.apache.cxf.tools.java2wsdl.generator.wsdl11.WSDL11Generator; import org.apache.cxf.tools.util.AnnotationUtil; +import org.apache.cxf.transport.DestinationFactoryManager; import org.apache.hello_world_rpclit.javato.GreeterRPCLit; import org.junit.After; import org.junit.Before; @@ -51,6 +53,10 @@ JAXBDataBinding.clearCaches(); builder.setBus(BusFactory.getDefaultBus()); generator.setBus(builder.getBus()); + + Bus b = builder.getBus(); + assertNotNull(b.getExtension(DestinationFactoryManager.class) + .getDestinationFactory("http://schemas.xmlsoap.org/soap/http")); } @After
