Author: mmao
Date: Wed Jul 11 01:35:53 2007
New Revision: 555204
URL: http://svn.apache.org/viewvc?view=rev&rev=555204
Log:
* WSDLDefinition builder support catalog
* WSDL2Java jaxws frontend support catalog
* Map the ws-addr.xsd from network to the classpath
Added:
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/resources/META-INF/jax-ws-catalog.xml
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/CatalogTest.java
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CatalogTest.java
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/META-INF/jax-ws-catalog.xml
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog.xml
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_messages.wsdl
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_replaceme.wsdl
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_service.wsdl
Modified:
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/Messages.properties
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractWSDLBuilder.java
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java
Modified:
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
(original)
+++
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
Wed Jul 11 01:35:53 2007
@@ -22,7 +22,7 @@
import javax.xml.namespace.QName;
public final class ToolConstants {
-
+
//public static final String TOOLSPECS_BASE =
"/org/apache/cxf/tools/common/toolspec/toolspecs/";
public static final String TOOLSPECS_BASE = "/org/apache/cxf/tools/";
public static final String SCHEMA_URI = "http://www.w3.org/2001/XMLSchema";
@@ -55,13 +55,14 @@
public static final String CFG_DEFAULT_NS = "defaultns";
public static final String CFG_DEFAULT_EX = "defaultex";
public static final String CFG_XJC_ARGS = "xjc";
-
+ public static final String CFG_CATALOG = "catalog";
+
public static final String CFG_VALIDATE_WSDL = "validate";
public static final String CFG_CREATE_XSD_IMPORTS = "createxsdimports";
-
+
public static final String CFG_FRONTEND = "frontend";
-
+
public static final String CFG_DATABINDING = "db";
@@ -73,9 +74,9 @@
public static final String CFG_ANT = "ant";
public static final String CFG_LIB_REF = "library.references";
public static final String CFG_ANT_PROP = "ant.prop";
-
-
-
+
+
+
//Internal Flag to generate
public static final String CFG_IMPL_CLASS = "implClass";
public static final String CFG_GEN_CLIENT = "genClient";
@@ -83,7 +84,7 @@
public static final String CFG_GEN_IMPL = "genImpl";
public static final String CFG_GEN_TYPES = "genTypes";
public static final String CFG_GEN_SEI = "genSEI";
- public static final String CFG_GEN_ANT = "genAnt";
+ public static final String CFG_GEN_ANT = "genAnt";
public static final String CFG_GEN_SERVICE = "genService";
public static final String CFG_GEN_OVERWRITE = "overwrite";
public static final String CFG_GEN_FAULT = "genFault";
@@ -156,7 +157,7 @@
// JMS address
public static final String NS_JMS_ADDRESS =
"http://cxf.apache.org/transports/jms";
public static final QName JMS_ADDRESS = new QName(NS_JMS_ADDRESS,
"address");
-
+
// JBI address
public static final String NS_JBI_ADDRESS =
"http://cxf.apache.org/transports/jbi";
public static final QName JBI_ADDRESS = new QName(NS_JBI_ADDRESS,
"address");
@@ -182,9 +183,9 @@
public static final QName XML_FORMAT = new QName(NS_XML_FORMAT, "body");
public static final QName XML_BINDING_FORMAT = new QName(NS_XML_FORMAT,
"binding");
-
-
-
+
+
+
public static final String SCHEMA_MAP = "schemaMap";
public static final String PORTTYPE_MAP = "portTypeMap";
public static final String SCHEMA_TARGET_NAMESPACES =
"schemaTargetNameSpaces";
@@ -197,7 +198,7 @@
// Tools framework
public static final String FRONTEND_PLUGIN = "frontend";
public static final String DATABINDING_PLUGIN = "databinding";
-
+
public static final String CFG_WSDL_VERSION = "wsdlversion";
// Suppress the code generation, in this case you can just get the
generated code model
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
(original)
+++
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
Wed Jul 11 01:35:53 2007
@@ -34,7 +34,7 @@
private ExtendedURIResolver resolver;
private Catalog catalogResolver;
-
+
public CatalogXmlSchemaURIResolver(OASISCatalogManager catalogManager) {
this.resolver = new ExtendedURIResolver();
this.catalogResolver = catalogManager.getCatalog();
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
(original)
+++
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
Wed Jul 11 01:35:53 2007
@@ -43,8 +43,8 @@
private Catalog resolver;
private Set<URL> loadedCatalogs = Collections.synchronizedSet(new
HashSet<URL>());
- private Bus bus;
-
+ private Bus bus;
+
public OASISCatalogManager() {
CatalogManager catalogManager = new CatalogManager();
catalogManager.setUseStaticCatalog(false);
@@ -52,16 +52,16 @@
CatalogResolver catalogResolver = new CatalogResolver(catalogManager);
this.resolver = catalogResolver.getCatalog();
}
-
+
public Bus getBus() {
return bus;
}
-
+
@Resource
- public void setBus(Bus bus) {
+ public void setBus(Bus bus) {
this.bus = bus;
}
-
+
@PostConstruct
public void register() {
if (null != bus) {
@@ -69,7 +69,7 @@
}
loadContextCatalogs();
}
-
+
public Catalog getCatalog() {
return this.resolver;
}
@@ -84,12 +84,12 @@
LOG.log(Level.WARNING, "Error loading " + name + " catalog files",
e);
}
}
-
+
public void loadCatalogs(ClassLoader classLoader, String name) throws
IOException {
if (classLoader == null) {
return;
}
-
+
Enumeration<URL> catalogs = classLoader.getResources(name);
while (catalogs.hasMoreElements()) {
URL catalogURL = catalogs.nextElement();
@@ -99,7 +99,7 @@
}
}
}
-
+
public void loadCatalog(URL catalogURL) throws IOException {
if (!loadedCatalogs.contains(catalogURL)) {
this.resolver.parseCatalog(catalogURL);
@@ -124,5 +124,5 @@
return catalog;
}
}
-
+
}
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
(original)
+++
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
Wed Jul 11 01:35:53 2007
@@ -41,7 +41,9 @@
import com.ibm.wsdl.extensions.soap.SOAPHeaderImpl;
import com.ibm.wsdl.extensions.soap.SOAPHeaderSerializer;
+import org.apache.cxf.Bus;
import org.apache.cxf.BusException;
+import org.apache.cxf.catalog.OASISCatalogManager;
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.PropertiesLoaderUtils;
@@ -50,34 +52,41 @@
import org.apache.cxf.wsdl.WSDLBuilder;
import org.apache.cxf.wsdl.WSDLExtensibilityPlugin;
-public class WSDLDefinitionBuilder implements WSDLBuilder<Definition> {
-
+public class WSDLDefinitionBuilder implements WSDLBuilder<Definition> {
+
protected static final Logger LOG =
LogUtils.getL7dLogger(WSDLDefinitionBuilder.class);
private static final String EXTENSIONS_RESOURCE =
"META-INF/extensions.xml";
private static final String WSDL_PLUGIN_RESOURCE =
"META-INF/wsdl.plugin.xml";
-
+
protected WSDLReader wsdlReader;
protected Definition wsdlDefinition;
final WSDLFactory wsdlFactory;
- final ExtensionRegistry registry;
+ final ExtensionRegistry registry;
private List<Definition> importedDefinitions = new ArrayList<Definition>();
-
+
private final Map<String, WSDLExtensibilityPlugin> wsdlPlugins
= new HashMap<String, WSDLExtensibilityPlugin>();
-
- public WSDLDefinitionBuilder() {
+
+ private Bus bus;
+
+ public WSDLDefinitionBuilder(Bus b) {
+ this();
+ this.bus = b;
+ }
+
+ public WSDLDefinitionBuilder() {
try {
wsdlFactory = WSDLFactory.newInstance();
registry = wsdlFactory.newPopulatedExtensionRegistry();
QName header = new QName("http://schemas.xmlsoap.org/wsdl/soap/",
"header");
- registry.registerDeserializer(MIMEPart.class,
- header,
+ registry.registerDeserializer(MIMEPart.class,
+ header,
new SOAPHeaderSerializer());
- registry.registerSerializer(MIMEPart.class,
- header,
+ registry.registerSerializer(MIMEPart.class,
+ header,
new SOAPHeaderSerializer());
registry.mapExtensionTypes(MIMEPart.class, header,
SOAPHeaderImpl.class);
-
+
registerInitialExtensions();
wsdlReader = wsdlFactory.newWSDLReader();
// TODO enable the verbose if in verbose mode.
@@ -93,32 +102,29 @@
registerWSDLExtensibilityPlugins();
}
}
-
+
+ public void setBus(Bus b) {
+ this.bus = b;
+ }
+
public Definition build(String wsdlURL) {
parseWSDL(wsdlURL);
return wsdlDefinition;
}
protected void parseWSDL(String wsdlURL) {
- try {
+ try {
wsdlReader.setExtensionRegistry(registry);
-
- // REVIST: URIResolve is to solve the wsdl import and schema
import,
- // but seems it works fine now without URIResolver
- // URIResolve has a bug, it can not resolve the wsdl in
testutils
-
- //URIResolver resolver = new URIResolver(wsdlURL);
- //InputSource insource = new
InputSource(resolver.getInputStream());
- //wsdlURL = resolver.getURI().toString();
- //wsdlDefinition = wsdlReader.readWSDL(new WSDLResolver(wsdlURL,
insource));
+
WSDLLocatorImpl wsdlLocator = new WSDLLocatorImpl(wsdlURL);
- wsdlDefinition = wsdlReader.readWSDL(wsdlLocator);
+
wsdlLocator.setCatalogResolver(OASISCatalogManager.getCatalogManager(bus).getCatalog());
+ wsdlDefinition = wsdlReader.readWSDL(wsdlLocator);
parseImports(wsdlDefinition);
} catch (Exception we) {
Message msg = new Message("FAIL_TO_CREATE_WSDL_DEFINITION",
- LOG,
+ LOG,
wsdlURL,
we.getMessage());
throw new RuntimeException(msg.toString(), we);
@@ -142,7 +148,7 @@
importedDefinitions.add(impt.getDefinition());
}
}
-
+
public List<Definition> getImportedDefinitions() {
return importedDefinitions;
}
@@ -173,7 +179,7 @@
}
}
}
-
+
public ExtensionRegistry getExtenstionRegistry() {
return registry;
}
@@ -181,7 +187,7 @@
public WSDLFactory getWSDLFactory() {
return wsdlFactory;
}
-
+
public WSDLReader getWSDLReader() {
return wsdlReader;
}
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java
(original)
+++
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java
Wed Jul 11 01:35:53 2007
@@ -24,23 +24,46 @@
import org.xml.sax.InputSource;
import org.apache.cxf.resource.ExtendedURIResolver;
+import org.apache.xml.resolver.Catalog;
public class WSDLLocatorImpl implements WSDLLocator {
private String wsdlUrl;
private ExtendedURIResolver resolver;
-
+
private String baseUri;
private String importedUri;
-
+
+ private Catalog catalogResolver;
+
public WSDLLocatorImpl(String wsdlUrl) {
this.wsdlUrl = wsdlUrl;
this.baseUri = this.wsdlUrl;
resolver = new ExtendedURIResolver();
}
-
+
+ public void setCatalogResolver(final Catalog cr) {
+ this.catalogResolver = cr;
+ }
+
+ private InputSource resolve(final String target, final String base) {
+ try {
+ String resolvedLocation = null;
+ if (catalogResolver != null) {
+ resolvedLocation = catalogResolver.resolveSystem(target);
+ }
+ if (resolvedLocation == null) {
+ return this.resolver.resolve(target, base);
+ } else {
+ return this.resolver.resolve(resolvedLocation, base);
+ }
+ } catch (Exception e) {
+ throw new RuntimeException("Catalog resolve failed: ", e);
+ }
+ }
+
public InputSource getBaseInputSource() {
- InputSource result = resolver.resolve(baseUri, null);
+ InputSource result = resolve(baseUri, null);
baseUri = resolver.getURI();
return result;
}
@@ -52,8 +75,8 @@
}
public InputSource getImportInputSource(String parent, String
importLocation) {
this.baseUri = parent;
- this.importedUri = importLocation;
- return resolver.resolve(this.importedUri, this.baseUri);
+ this.importedUri = importLocation;
+ return resolve(this.importedUri, this.baseUri);
}
public void close() {
resolver.close();
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
(original)
+++
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
Wed Jul 11 01:35:53 2007
@@ -320,7 +320,7 @@
String systemId = def.getDocumentBaseURI() + "#types" +
schemaCount;
schemaCol.setBaseUri(def.getDocumentBaseURI());
- CatalogXmlSchemaURIResolver schemaResolver =
+ CatalogXmlSchemaURIResolver schemaResolver =
new
CatalogXmlSchemaURIResolver(OASISCatalogManager.getCatalogManager(bus));
schemaCol.setSchemaResolver(schemaResolver);
XmlSchema xmlSchema = schemaCol.read(schemaElem, systemId);
@@ -671,7 +671,7 @@
if (inputEl.getSchemaType() instanceof XmlSchemaComplexType) {
xsct = (XmlSchemaComplexType)inputEl.getSchemaType();
if (hasAttributes(xsct)
- || !isWrappableSequence(xsct,
inputEl.getQName().getNamespaceURI(),
+ || !isWrappableSequence(xsct,
inputEl.getQName().getNamespaceURI(),
unwrappedInput, allowRefs)) {
passedRule = false;
}
Modified:
incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
(original)
+++
incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
Wed Jul 11 01:35:53 2007
@@ -234,10 +234,14 @@
} catch (MalformedURLException e2) {
return uri.replace("\\", "/");
}
- }
+ }
}
public static String getAbsoluteURI(final String arg) {
+ if (arg == null) {
+ return null;
+ }
+
try {
URL url = new URL(normalize(arg));
if (url.toURI().isOpaque()
@@ -251,5 +255,5 @@
} catch (URISyntaxException e2) {
return normalize(arg);
}
- }
+ }
}
Modified:
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/Messages.properties
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/Messages.properties?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/Messages.properties
(original)
+++
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/Messages.properties
Wed Jul 11 01:35:53 2007
@@ -30,4 +30,6 @@
FOUND_NO_DATABINDING = Can not find databinding
FOUND_NO_FRONTEND = Can not find frontend
-NO_WSDL_URL = WSDL URL can not be null
\ No newline at end of file
+NO_WSDL_URL = WSDL URL can not be null
+
+LOAD_CATALOG_ERROR = Can not load the catalog file {0}
\ No newline at end of file
Modified:
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
(original)
+++
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
Wed Jul 11 01:35:53 2007
@@ -22,6 +22,7 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -39,6 +40,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.apache.cxf.catalog.OASISCatalogManager;
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.PropertiesLoaderUtils;
@@ -66,7 +68,6 @@
import org.apache.cxf.wsdl.WSDLConstants;
import org.apache.cxf.wsdl11.WSDLServiceBuilder;
-
public class WSDLToJavaContainer extends AbstractCXFToolContainer {
protected static final Logger LOG =
LogUtils.getL7dLogger(WSDLToJavaContainer.class);
@@ -92,7 +93,26 @@
}
public Bus getBus() {
- return BusFactory.getDefaultBus();
+ Bus bus = BusFactory.getDefaultBus();
+
+ OASISCatalogManager catalogManager =
bus.getExtension(OASISCatalogManager.class);
+
+ String catalogLocation = getCatalogURL();
+ if (!StringUtils.isEmpty(catalogLocation)) {
+ try {
+ catalogManager.loadCatalog(new URI(catalogLocation).toURL());
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new ToolException(new Message("FOUND_NO_FRONTEND", LOG,
catalogLocation));
+ }
+ }
+
+ return bus;
+ }
+
+ protected String getCatalogURL() {
+ String catalogLocation = (String)
context.get(ToolConstants.CFG_CATALOG);
+ return URIParserUtil.getAbsoluteURI(catalogLocation);
}
@SuppressWarnings("unchecked")
@@ -118,6 +138,7 @@
AbstractWSDLBuilder<Definition> builder =
(AbstractWSDLBuilder<Definition>)frontend
.getWSDLBuilder();
builder.setContext(context);
+ builder.setBus(getBus());
// TODO: Modify builder api, let customized definition make
// sense.
Modified:
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractWSDLBuilder.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractWSDLBuilder.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractWSDLBuilder.java
(original)
+++
incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractWSDLBuilder.java
Wed Jul 11 01:35:53 2007
@@ -19,17 +19,23 @@
package org.apache.cxf.tools.wsdlto.core;
+import org.apache.cxf.Bus;
import org.apache.cxf.tools.common.ToolContext;
import org.apache.cxf.tools.common.ToolException;
import org.apache.cxf.wsdl.WSDLBuilder;
public abstract class AbstractWSDLBuilder<T> implements WSDLBuilder<T> {
protected ToolContext context;
-
+ protected Bus bus;
+
+ public void setBus(Bus b) {
+ this.bus = b;
+ }
+
public void setContext(ToolContext c) {
this.context = c;
}
-
+
public abstract void customize();
public abstract boolean validate(T t) throws ToolException;
Modified:
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
(original)
+++
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
Wed Jul 11 01:35:53 2007
@@ -101,6 +101,16 @@
</associatedArgument>
</option>
+ <option id="catalog" maxOccurs="1">
+ <annotation>
+ Specify catalog file to map the imported wsdl/schema
+ </annotation>
+ <switch>catalog</switch>
+ <associatedArgument placement="afterSpace">
+ <annotation>catalog-file-name</annotation>
+ </associatedArgument>
+ </option>
+
<option id="outputdir" maxOccurs="1">
<annotation>
The directory in which the code is placed</annotation>
@@ -222,7 +232,7 @@
</associatedArgument>
<switch>wsdlLocation</switch>
</option>
-
+
<option id="xjc" maxOccurs="1">
<annotation>
Comma separated arguments that are passed directly to XJC
when the
@@ -234,7 +244,7 @@
</associatedArgument>
<switch>xjc</switch>
</option>
-
+
</optionGroup>
<optionGroup id="common_options">
<option id="help" maxOccurs="1">
Modified:
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
(original)
+++
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
Wed Jul 11 01:35:53 2007
@@ -64,14 +64,14 @@
protected static final Logger LOG =
LogUtils.getL7dLogger(JAXWSDefinitionBuilder.class);
protected CustomizationParser cusParser;
-
+
private WSDLDefinitionBuilder builder;
private WSDLReader wsdlReader;
private Definition wsdlDefinition;
-
+
private List<InputSource> jaxbBindings;
private Element handlerChain;
-
+
public JAXWSDefinitionBuilder() {
builder = new WSDLDefinitionBuilder();
ExtensionRegistry registry = builder.getExtenstionRegistry();
@@ -79,16 +79,17 @@
wsdlReader = builder.getWSDLReader();
wsdlReader.setExtensionRegistry(registry);
}
-
+
public Definition build() {
String wsdlURL = (String)context.get(ToolConstants.CFG_WSDLURL);
return build(wsdlURL);
}
public Definition build(String wsdlURL) {
+ this.builder.setBus(this.bus);
wsdlDefinition = builder.build(wsdlURL);
context.put(ToolConstants.IMPORTED_DEFINITION,
builder.getImportedDefinitions());
- checkSupported(wsdlDefinition);
+ checkSupported(wsdlDefinition);
return wsdlDefinition;
}
@@ -114,10 +115,10 @@
}
cusParser = new CustomizationParser();
cusParser.parse(context);
-
+
jaxbBindings = cusParser.getJaxbBindings();
handlerChain = cusParser.getHandlerChains();
-
+
context.setJaxbBindingFiles(jaxbBindings);
context.put(ToolConstants.HANDLER_CHAIN, handlerChain);
try {
@@ -132,7 +133,7 @@
private void checkSupported(Definition def) throws ToolException {
if (isRPCEncoded(def)) {
- org.apache.cxf.common.i18n.Message msg =
+ org.apache.cxf.common.i18n.Message msg =
new
org.apache.cxf.common.i18n.Message("UNSUPPORTED_RPC_ENCODED"
, LOG);
throw new ToolException(msg);
@@ -169,7 +170,7 @@
}
return false;
}
-
+
private CustomizationParser getCustomizationParer() {
return cusParser;
}
@@ -180,7 +181,7 @@
DOMUtils.writeXml(getCustomizationParer().getCustomizedWSDLElement(),
outs);
InputStream ins = new FileInputStream(new File(tmpFile.toURI()));
Document wsdlDoc = DOMUtils.readXml(ins);
- Definition def =
wsdlReader.readWSDL(this.wsdlDefinition.getDocumentBaseURI(),
+ Definition def =
wsdlReader.readWSDL(this.wsdlDefinition.getDocumentBaseURI(),
wsdlDoc);
FileUtils.delete(tmpFile);
return def;
@@ -191,13 +192,13 @@
this.build();
this.customize();
}
-
+
return this.wsdlDefinition;
}
public WSDLReader getWSDLReader() {
return wsdlReader;
}
-
+
public boolean validate(Definition def) throws ToolException {
return new WSDL11Validator(def, context).isValid();
Added:
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/resources/META-INF/jax-ws-catalog.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/resources/META-INF/jax-ws-catalog.xml?view=auto&rev=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/resources/META-INF/jax-ws-catalog.xml
(added)
+++
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/resources/META-INF/jax-ws-catalog.xml
Wed Jul 11 01:35:53 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
+ <rewriteSystem systemIdStartString="http://www.w3.org/2005/08/addressing"
rewritePrefix="classpath:/schemas/wsdl"/>
+</catalog>
Added:
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/CatalogTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/CatalogTest.java?view=auto&rev=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/CatalogTest.java
(added)
+++
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/CatalogTest.java
Wed Jul 11 01:35:53 2007
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws;
+
+import java.net.URL;
+
+import org.xml.sax.InputSource;
+
+import org.apache.cxf.catalog.OASISCatalogManager;
+import org.apache.cxf.resource.ExtendedURIResolver;
+import org.apache.xml.resolver.Catalog;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class CatalogTest extends Assert {
+ @Test
+ public void testCatalog() throws Exception {
+ OASISCatalogManager catalogManager = new OASISCatalogManager();
+
+ URL jaxwscatalog =
getClass().getResource("/META-INF/jax-ws-catalog.xml");
+ assertNotNull(jaxwscatalog);
+
+ catalogManager.loadCatalog(jaxwscatalog);
+
+ Catalog catalogResolver = catalogManager.getCatalog();
+ assertNotNull(catalogResolver);
+
+ String xsd = "http://www.w3.org/2005/08/addressing/ws-addr.xsd";
+ String resolvedSchemaLocation = catalogResolver.resolveSystem(xsd);
+ assertEquals("classpath:/schemas/wsdl/ws-addr.xsd",
resolvedSchemaLocation);
+
+ ExtendedURIResolver resolver = new ExtendedURIResolver();
+ InputSource in = resolver.resolve(resolvedSchemaLocation, null);
+ assertTrue(in.getSystemId().indexOf("cxf-common-schemas") != -1);
+ }
+}
\ No newline at end of file
Modified:
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java
(original)
+++
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java
Wed Jul 11 01:35:53 2007
@@ -60,7 +60,4 @@
w2j.setArguments(new String[]{"none"});
assertFalse(w2j.isVerbose());
}
-
-
-
}
Added:
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CatalogTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CatalogTest.java?view=auto&rev=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CatalogTest.java
(added)
+++
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CatalogTest.java
Wed Jul 11 01:35:53 2007
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.tools.wsdlto.jaxws;
+
+import org.apache.cxf.tools.common.ProcessorTestBase;
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
+import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
+import org.apache.cxf.tools.wsdlto.core.PluginLoader;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class CatalogTest extends ProcessorTestBase {
+ private JAXWSContainer processor;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ env.put(FrontEndProfile.class,
PluginLoader.getInstance().getFrontEndProfile("jaxws"));
+ env.put(DataBindingProfile.class,
PluginLoader.getInstance().getDataBindingProfile("jaxb"));
+
+ env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
+ processor = new JAXWSContainer(null);
+ }
+
+ @After
+ public void tearDown() {
+ super.tearDown();
+ processor = null;
+ }
+
+ @Test
+ public void testCatalog() {
+ try {
+ env.put(ToolConstants.CFG_WSDLURL,
getLocation("/wsdl2java_wsdl/test_catalog_service.wsdl"));
+ processor.setContext(env);
+
+ processor.execute();
+ } catch (Exception e) {
+ fail("Catalog resolve failed");
+ }
+ }
+}
\ No newline at end of file
Modified:
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java?view=diff&rev=555204&r1=555203&r2=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java
(original)
+++
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenOptionTest.java
Wed Jul 11 01:35:53 2007
@@ -50,7 +50,7 @@
env.put(ToolConstants.CFG_IMPL, "impl");
env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
- processor = new JAXWSContainer(null);
+ processor = new JAXWSContainer(null);
}
@@ -60,8 +60,8 @@
processor = null;
env = null;
}
-
-
+
+
@Test
public void testFlagForGenStandAlone() throws Exception {
env.put(ToolConstants.CFG_GEN_TYPES, ToolConstants.CFG_GEN_TYPES);
@@ -71,31 +71,31 @@
env.put(ToolConstants.CFG_GEN_SERVER, ToolConstants.CFG_GEN_SERVER);
env.put(ToolConstants.CFG_GEN_FAULT, ToolConstants.CFG_GEN_FAULT);
env.put(ToolConstants.CFG_GEN_ANT, ToolConstants.CFG_GEN_ANT);
- env.put(ToolConstants.CFG_WSDLURL,
getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL,
getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
processor.setContext(env);
processor.execute();
-
+
Class greeterServer = classLoader
.loadClass("org.apache.hello_world_soap_http.Greeter_SoapPort_Server");
assertNotNull("Server should be generated", greeterServer);
-
+
}
-
+
@Test
public void testFlagForGenAdditional() throws Exception {
env.put(ToolConstants.CFG_IMPL, ToolConstants.CFG_IMPL);
env.put(ToolConstants.CFG_SERVER, ToolConstants.CFG_SERVER);
-
- env.put(ToolConstants.CFG_WSDLURL,
getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+
+ env.put(ToolConstants.CFG_WSDLURL,
getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
processor.setContext(env);
processor.execute();
-
+
Class greeterServer = classLoader
.loadClass("org.apache.hello_world_soap_http.Greeter_SoapPort_Server");
assertNotNull("Server should be generated", greeterServer);
}
-
-
+
+
@Test
public void testHelloWorldExternalBindingFile() throws Exception {
env.put(ToolConstants.CFG_WSDLURL,
getLocation("/wsdl2java_wsdl/hello_world_jaxws_base.wsdl"));
@@ -114,18 +114,34 @@
assertEquals(3, clz.getMethods().length);
}
-
+
@Test
- public void testGenFault() throws Exception {
+ public void testGenFault() throws Exception {
env.put(ToolConstants.CFG_WSDLURL,
getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
env.remove(ToolConstants.CFG_COMPILE);
env.remove(ToolConstants.CFG_IMPL);
env.put(ToolConstants.CFG_GEN_FAULT, ToolConstants.CFG_GEN_FAULT);
processor.setContext(env);
processor.execute();
-
+
File file = new File(output, "org/apache/hello_world_soap_http");
assertEquals(2, file.list().length);
+ }
+
+ @Test
+ public void testGetCatalog() throws Exception {
+ env.put(ToolConstants.CFG_WSDLURL,
getLocation("/wsdl2java_wsdl/test_catalog_replaceme.wsdl"));
+ env.put(ToolConstants.CFG_CATALOG,
getLocation("/wsdl2java_wsdl/test_catalog.xml"));
+ env.put(ToolConstants.CFG_COMPILE, null);
+ env.put(ToolConstants.CFG_CLASSDIR, null);
+
+ processor.setContext(env);
+ try {
+ processor.execute();
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Catalog not working");
+ }
}
}
Added:
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/META-INF/jax-ws-catalog.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/META-INF/jax-ws-catalog.xml?view=auto&rev=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/META-INF/jax-ws-catalog.xml
(added)
+++
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/META-INF/jax-ws-catalog.xml
Wed Jul 11 01:35:53 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
+ <rewriteSystem systemIdStartString="nosuchpath"
rewritePrefix="../wsdl2java_wsdl"/>
+</catalog>
Added:
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog.xml?view=auto&rev=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog.xml
(added)
+++
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog.xml
Wed Jul 11 01:35:53 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
+ <rewriteSystem systemIdStartString="replaceme"
rewritePrefix="../wsdl2java_wsdl"/>
+</catalog>
Added:
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_messages.wsdl
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_messages.wsdl?view=auto&rev=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_messages.wsdl
(added)
+++
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_messages.wsdl
Wed Jul 11 01:35:53 2007
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world_soap_http"
+ xmlns:x1="http://apache.org/hello_world_soap_http/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/hello_world_soap_http"
name="HelloWorld">
+
+ <wsdl:message name="sayHiRequest">
+ <wsdl:part name="in" element="x1:sayHi"/>
+ </wsdl:message>
+ <wsdl:message name="sayHiResponse">
+ <wsdl:part name="out" element="x1:sayHiResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part name="in" element="x1:greetMe"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part name="out" element="x1:greetMeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeSometimeRequest">
+ <wsdl:part name="in" element="x1:greetMeSometime"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeSometimeResponse">
+ <wsdl:part name="out" element="x1:greetMeSometimeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeOneWayRequest">
+ <wsdl:part name="in" element="x1:greetMeOneWay"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitFaultRequest">
+ <wsdl:part name="in" element="x1:testDocLitFault"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitFaultResponse">
+ <wsdl:part name="out" element="x1:testDocLitFaultResponse"/>
+ </wsdl:message>
+ <wsdl:message name="NoSuchCodeLitFault">
+ <wsdl:part name="NoSuchCodeLit" element="x1:NoSuchCodeLit"/>
+ </wsdl:message>
+ <wsdl:message name="BadRecordLitFault">
+ <wsdl:part name="BadRecordLit" element="x1:BadRecordLit"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitBareRequest">
+ <wsdl:part name="in" element="x1:BareDocument"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitBareResponse">
+ <wsdl:part name="out" element="x1:BareDocumentResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input name="sayHiRequest" message="tns:sayHiRequest"/>
+ <wsdl:output name="sayHiResponse" message="tns:sayHiResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMe">
+ <wsdl:input name="greetMeRequest" message="tns:greetMeRequest"/>
+ <wsdl:output name="greetMeResponse" message="tns:greetMeResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeSometime">
+ <wsdl:input name="greetMeSometimeRequest"
message="tns:greetMeSometimeRequest"/>
+ <wsdl:output name="greetMeSometimeResponse"
message="tns:greetMeSometimeResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeOneWay">
+ <wsdl:input name="greetMeOneWayRequest"
message="tns:greetMeOneWayRequest"/>
+ </wsdl:operation>
+ <wsdl:operation name="testDocLitFault">
+ <wsdl:input name="testDocLitFaultRequest"
message="tns:testDocLitFaultRequest"/>
+ <wsdl:output name="testDocLitFaultResponse"
message="tns:testDocLitFaultResponse"/>
+ <wsdl:fault name="NoSuchCodeLitFault"
message="tns:NoSuchCodeLitFault"/>
+ <wsdl:fault name="BadRecordLitFault"
message="tns:BadRecordLitFault"/>
+ </wsdl:operation>
+ <wsdl:operation name="testDocLitBare">
+ <wsdl:input name="testDocLitBareRequest"
message="tns:testDocLitBareRequest"/>
+ <wsdl:output name="testDocLitBareResponse"
message="tns:testDocLitBareResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="sayHi">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMe">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeSometime">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeOneWay">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ </wsdl:operation>
+ <wsdl:operation name="testDocLitFault">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="NoSuchCodeLitFault">
+ <soap:fault name="NoSuchCodeLitFault" use="literal"/>
+ </wsdl:fault>
+ <wsdl:fault name="BadRecordLitFault">
+ <soap:fault name="BadRecordLitFault" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="testDocLitBare">
+ <soap:operation style="document"
soapAction="http://apache.org/hello_world_soap_http/testDocLitBare"/>
+ <wsdl:input name="testDocLitBareRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="testDocLitBareResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ </wsdl:definitions>
\ No newline at end of file
Added:
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_replaceme.wsdl
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_replaceme.wsdl?view=auto&rev=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_replaceme.wsdl
(added)
+++
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_replaceme.wsdl
Wed Jul 11 01:35:53 2007
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world_soap_http"
+ xmlns:x1="http://apache.org/hello_world_soap_http/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/hello_world_soap_http"
name="HelloWorld">
+ <wsdl:types>
+ <xsd:schema>
+ <xsd:import
namespace="http://apache.org/hello_world_soap_http/types"
schemaLocation="replaceme/schema1.xsd"/>
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:import namespace="http://apache.org/hello_world_soap_http"
location="replaceme/test_catalog_messages.wsdl"/>
+
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address
location="http://localhost:9000/SoapContext/SoapPort"/>
+ <wswa:UsingAddressing
xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="SOAPService_Test1">
+ <wsdl:port name="SoapPort_Test1" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9100"/>
+ </wsdl:port>
+ <wsdl:port name="SoapPort_Test2" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9101"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
Added:
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_service.wsdl
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_service.wsdl?view=auto&rev=555204
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_service.wsdl
(added)
+++
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/test_catalog_service.wsdl
Wed Jul 11 01:35:53 2007
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world_soap_http"
+ xmlns:x1="http://apache.org/hello_world_soap_http/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/hello_world_soap_http"
name="HelloWorld">
+ <wsdl:types>
+ <xsd:schema>
+ <xsd:import
namespace="http://apache.org/hello_world_soap_http/types"
schemaLocation="nosuchpath/schema1.xsd"/>
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:import namespace="http://apache.org/hello_world_soap_http"
location="nosuchpath/test_catalog_messages.wsdl"/>
+
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address
location="http://localhost:9000/SoapContext/SoapPort"/>
+ <wswa:UsingAddressing
xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="SOAPService_Test1">
+ <wsdl:port name="SoapPort_Test1" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9100"/>
+ </wsdl:port>
+ <wsdl:port name="SoapPort_Test2" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9101"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+