Author: dkulp
Date: Wed Nov 14 14:05:17 2007
New Revision: 595083
URL: http://svn.apache.org/viewvc?rev=595083&view=rev
Log:
Merged revisions 594221 via svnmerge from
https://svn.apache.org/repos/asf/incubator/cxf/trunk
........
r594221 | bimargulies | 2007-11-12 12:23:50 -0500 (Mon, 12 Nov 2007) | 5 lines
First piece of making it harder to create invalid XML Schema models. Wrap
XmlSchemaCollection in our own class.
........
Modified:
incubator/cxf/branches/2.0.x-fixes/ (props changed)
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
incubator/cxf/branches/2.0.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
incubator/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
incubator/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
incubator/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java
Wed Nov 14 14:05:17 2007
@@ -27,7 +27,8 @@
import java.util.concurrent.ConcurrentHashMap;
import javax.xml.namespace.QName;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
+
+import org.apache.cxf.common.xmlschema.SchemaCollection;
public class ServiceInfo extends AbstractDescriptionElement {
QName name;
@@ -37,10 +38,10 @@
Map<QName, EndpointInfo> endpoints = new ConcurrentHashMap<QName,
EndpointInfo>(2);
Map<QName, MessageInfo> messages;
List<SchemaInfo> schemas = new ArrayList<SchemaInfo>(4);
- private XmlSchemaCollection xmlSchemaCollection;
+ private SchemaCollection xmlSchemaCollection;
public ServiceInfo() {
- xmlSchemaCollection = new XmlSchemaCollection();
+ xmlSchemaCollection = new SchemaCollection();
}
public String getTargetNamespace() {
@@ -141,7 +142,7 @@
return Collections.unmodifiableCollection(schemas);
}
- public XmlSchemaCollection getXmlSchemaCollection() {
+ public SchemaCollection getXmlSchemaCollection() {
return xmlSchemaCollection;
}
}
Modified:
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
Wed Nov 14 14:05:17 2007
@@ -58,6 +58,7 @@
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.endpoint.EndpointResolverRegistry;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.endpoint.ServerRegistry;
@@ -72,8 +73,6 @@
import org.apache.cxf.ws.addressing.wsdl.AttributedQNameType;
import org.apache.cxf.ws.addressing.wsdl.ServiceNameType;
import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-
/**
* Provides utility methods for obtaining endpoint references, wsdl
definitions, etc.
@@ -448,7 +447,7 @@
SchemaFactory factory = SchemaFactory.newInstance(
XMLConstants.W3C_XML_SCHEMA_NS_URI);
List<Source> schemaSources = new ArrayList<Source>();
- final XmlSchemaCollection sc =
serviceInfo.getXmlSchemaCollection();
+ final SchemaCollection sc = serviceInfo.getXmlSchemaCollection();
for (SchemaInfo schemaInfo : serviceInfo.getSchemas()) {
Source source = new DOMSource(schemaInfo.getElement());
if (source != null) {
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Wed Nov 14 14:05:17 2007
@@ -58,6 +58,7 @@
import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
import org.apache.cxf.binding.soap.model.SoapOperationInfo;
import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.interceptor.AttachmentInInterceptor;
import org.apache.cxf.interceptor.AttachmentOutInterceptor;
@@ -89,7 +90,6 @@
import org.apache.cxf.wsdl.WSDLConstants;
import org.apache.cxf.wsdl.WSDLManager;
import org.apache.cxf.wsdl11.WSDLServiceBuilder;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
import static org.apache.cxf.helpers.CastUtils.cast;
@@ -389,7 +389,7 @@
if (header != null && serviceInfo.getMessage(header.getMessage()) ==
null) {
Definition def =
(Definition)serviceInfo.getProperty(WSDLServiceBuilder.WSDL_DEFINITION);
- XmlSchemaCollection schemas = serviceInfo.getXmlSchemaCollection();
+ SchemaCollection schemas = serviceInfo.getXmlSchemaCollection();
if (def != null && schemas != null) {
javax.wsdl.Message msg = def.getMessage(header.getMessage());
@@ -397,14 +397,14 @@
addOutOfBandParts(bop, msg, schemas, isInput);
serviceInfo.refresh();
} else {
- //TODO: The header message is not defined in this wsdl,
what to do
+ throw new RuntimeException("Header message not defined in
service model.");
}
}
}
}
private void addOutOfBandParts(final BindingOperationInfo bop, final
javax.wsdl.Message msg,
- final XmlSchemaCollection schemas, boolean
isInput) {
+ final SchemaCollection schemas, boolean
isInput) {
MessageInfo minfo = null;
if (isInput) {
minfo = bop.getOperationInfo().getInput();
@@ -435,7 +435,7 @@
}
private void buildMessage(MessageInfo minfo, javax.wsdl.Message msg,
- XmlSchemaCollection schemas) {
+ SchemaCollection schemas) {
for (Part part : cast(msg.getParts().values(), Part.class)) {
MessagePartInfo pi = minfo.addMessagePart(new
QName(minfo.getName().getNamespaceURI(), part
.getName()));
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/AbstractDataBinding.java
Wed Nov 14 14:05:17 2007
@@ -30,10 +30,10 @@
import org.apache.cxf.common.util.FixedExtensionDeserializer;
import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.service.model.SchemaInfo;
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
public class AbstractDataBinding {
private Collection<DOMSource> schemas;
@@ -45,23 +45,20 @@
public void setSchemas(Collection<DOMSource> schemas) {
this.schemas = schemas;
}
-
- protected XmlSchema addSchemaDocument(ServiceInfo serviceInfo,
- XmlSchemaCollection col,
- Document d,
- String systemId) {
+ protected XmlSchema addSchemaDocument(ServiceInfo serviceInfo,
SchemaCollection col, Document d,
+ String systemId) {
String ns = d.getDocumentElement().getAttribute("targetNamespace");
if (StringUtils.isEmpty(ns)) {
ns = serviceInfo.getInterface().getName().getNamespaceURI();
d.getDocumentElement().setAttribute("targetNamespace", ns);
}
-
+
NodeList nodes = d.getDocumentElement().getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
Node n = nodes.item(i);
if (n instanceof Element) {
- Element e = (Element) n;
+ Element e = (Element)n;
if (e.getLocalName().equals("import")) {
e.removeAttribute("schemaLocation");
}
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
Wed Nov 14 14:05:17 2007
@@ -1,205 +1,205 @@
-/**
- * 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.wsdl11;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Types;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.extensions.schema.Schema;
-import javax.wsdl.extensions.schema.SchemaImport;
-
-import org.w3c.dom.Element;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.catalog.CatalogXmlSchemaURIResolver;
-import org.apache.cxf.catalog.OASISCatalogManager;
-import org.apache.cxf.common.util.FixedExtensionDeserializer;
-import org.apache.cxf.helpers.CastUtils;
-import org.apache.cxf.service.model.SchemaInfo;
-import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-
-import static org.apache.cxf.helpers.CastUtils.cast;
-
-public final class SchemaUtil {
- private final Map<String, Element> schemaList;
- private final Bus bus;
- private Map<String, String> catalogResolvedMap;
-
-
- public SchemaUtil(final Bus b, final Map<String, Element> s) {
- this.bus = b;
- this.schemaList = s;
- }
-
- public void getSchemas(final Definition def, final ServiceInfo
serviceInfo) {
- XmlSchemaCollection schemaCol = serviceInfo.getXmlSchemaCollection();
- schemaCol.getExtReg().setDefaultExtensionDeserializer(
- new FixedExtensionDeserializer());
-
- List<Definition> defList = new ArrayList<Definition>();
- parseImports(def, defList);
- extractSchema(def, schemaCol, serviceInfo);
- // added
- getSchemaList(def);
- for (Definition def2 : defList) {
- extractSchema(def2, schemaCol, serviceInfo);
- // added
- getSchemaList(def2);
- }
- }
-
- private void extractSchema(Definition def, XmlSchemaCollection schemaCol,
ServiceInfo serviceInfo) {
- Types typesElement = def.getTypes();
- if (typesElement != null) {
- int schemaCount = 1;
- for (Object obj : typesElement.getExtensibilityElements()) {
- org.w3c.dom.Element schemaElem = null;
- if (obj instanceof Schema) {
- Schema schema = (Schema)obj;
- schemaElem = schema.getElement();
- } else if (obj instanceof UnknownExtensibilityElement) {
- org.w3c.dom.Element elem =
((UnknownExtensibilityElement)obj).getElement();
- if (elem.getLocalName().equals("schema")) {
- schemaElem = elem;
- }
- }
- if (schemaElem != null) {
- for (Object prefix : def.getNamespaces().keySet()) {
- String ns = (String)def.getNamespaces().get(prefix);
- if (!"".equals(prefix) &&
!schemaElem.hasAttribute("xmlns:" + prefix)) {
-
schemaElem.setAttributeNS(javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI,
- "xmlns:" + prefix, ns);
- }
- }
- String systemId = def.getDocumentBaseURI() + "#types" +
schemaCount;
-
- schemaCol.setBaseUri(def.getDocumentBaseURI());
- CatalogXmlSchemaURIResolver schemaResolver =
- new
CatalogXmlSchemaURIResolver(OASISCatalogManager.getCatalogManager(bus));
- schemaCol.setSchemaResolver(schemaResolver);
-
- XmlSchema xmlSchema = schemaCol.read(schemaElem, systemId);
- SchemaInfo schemaInfo = new SchemaInfo(serviceInfo,
xmlSchema.getTargetNamespace());
- schemaInfo.setElement(schemaElem);
- schemaInfo.setSchema(xmlSchema);
- schemaInfo.setSystemId(systemId);
- serviceInfo.addSchema(schemaInfo);
- schemaCount++;
- }
- }
- }
- }
-
- private void parseImports(Definition def, List<Definition> defList) {
- List<Import> importList = new ArrayList<Import>();
-
- Collection<List<Import>> ilist = cast(def.getImports().values());
- for (List<Import> list : ilist) {
- importList.addAll(list);
- }
- for (Import impt : importList) {
- if (!defList.contains(impt.getDefinition())) {
- defList.add(impt.getDefinition());
- parseImports(impt.getDefinition(), defList);
- }
- }
- }
-
- // Workaround for getting the elements
- private void getSchemaList(Definition def) {
- Types typesElement = def.getTypes();
- if (typesElement != null) {
- Iterator ite = typesElement.getExtensibilityElements().iterator();
- while (ite.hasNext()) {
- Object obj = ite.next();
- if (obj instanceof Schema) {
- Schema schema = (Schema)obj;
- addSchema(schema.getDocumentBaseURI(), schema);
- }
- }
- }
- }
-
- private void addSchema(String docBaseURI, Schema schema) {
- //String docBaseURI = schema.getDocumentBaseURI();
- Element schemaEle = schema.getElement();
- if (schemaList.get(docBaseURI) == null) {
- schemaList.put(docBaseURI, schemaEle);
- } else if (schemaList.get(docBaseURI) != null &&
schemaList.containsValue(schemaEle)) {
- // do nothing
- } else {
- String tns = schema.getDocumentBaseURI() + "#"
- + schema.getElement().getAttribute("targetNamespace");
- if (schemaList.get(tns) == null) {
- schemaList.put(tns, schema.getElement());
- }
- }
-
- Map<String, List> imports = CastUtils.cast(schema.getImports());
- if (imports != null && imports.size() > 0) {
- Collection<String> importKeys = imports.keySet();
- for (String importNamespace : importKeys) {
-
- List<SchemaImport> schemaImports =
CastUtils.cast(imports.get(importNamespace));
-
- for (SchemaImport schemaImport : schemaImports) {
- Schema tempImport = schemaImport.getReferencedSchema();
- String key = schemaImport.getSchemaLocationURI();
- if (importNamespace == null && tempImport != null) {
- importNamespace = tempImport.getDocumentBaseURI();
- }
- if ((catalogResolvedMap == null ||
!catalogResolvedMap.containsKey(key))
- && tempImport != null) {
- key = tempImport.getDocumentBaseURI();
- }
- if (tempImport != null
- && !isSchemaParsed(key, importNamespace)
- && !schemaList.containsValue(tempImport.getElement()))
{
- addSchema(key, tempImport);
- }
- }
-
- }
- }
- }
-
- private boolean isSchemaParsed(String baseUri, String ns) {
- if (schemaList.get(baseUri) != null) {
- Element ele = schemaList.get(baseUri);
- String tns = ele.getAttribute("targetNamespace");
- if (ns.equals(tns)) {
- return true;
- }
- }
- return false;
- }
-
- public void setCatalogResolvedMap(Map<String, String> resolvedMap) {
- catalogResolvedMap = resolvedMap;
- }
-}
+/**
+ * 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.wsdl11;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import javax.wsdl.Definition;
+import javax.wsdl.Import;
+import javax.wsdl.Types;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.wsdl.extensions.schema.Schema;
+import javax.wsdl.extensions.schema.SchemaImport;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.catalog.CatalogXmlSchemaURIResolver;
+import org.apache.cxf.catalog.OASISCatalogManager;
+import org.apache.cxf.common.util.FixedExtensionDeserializer;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.service.model.SchemaInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.ws.commons.schema.XmlSchema;
+
+import static org.apache.cxf.helpers.CastUtils.cast;
+
+public final class SchemaUtil {
+ private final Map<String, Element> schemaList;
+ private final Bus bus;
+ private Map<String, String> catalogResolvedMap;
+
+
+ public SchemaUtil(final Bus b, final Map<String, Element> s) {
+ this.bus = b;
+ this.schemaList = s;
+ }
+
+ public void getSchemas(final Definition def, final ServiceInfo
serviceInfo) {
+ SchemaCollection schemaCol = serviceInfo.getXmlSchemaCollection();
+ schemaCol.getExtReg().setDefaultExtensionDeserializer(
+ new FixedExtensionDeserializer());
+
+ List<Definition> defList = new ArrayList<Definition>();
+ parseImports(def, defList);
+ extractSchema(def, schemaCol, serviceInfo);
+ // added
+ getSchemaList(def);
+ for (Definition def2 : defList) {
+ extractSchema(def2, schemaCol, serviceInfo);
+ // added
+ getSchemaList(def2);
+ }
+ }
+
+ private void extractSchema(Definition def, SchemaCollection schemaCol,
ServiceInfo serviceInfo) {
+ Types typesElement = def.getTypes();
+ if (typesElement != null) {
+ int schemaCount = 1;
+ for (Object obj : typesElement.getExtensibilityElements()) {
+ org.w3c.dom.Element schemaElem = null;
+ if (obj instanceof Schema) {
+ Schema schema = (Schema)obj;
+ schemaElem = schema.getElement();
+ } else if (obj instanceof UnknownExtensibilityElement) {
+ org.w3c.dom.Element elem =
((UnknownExtensibilityElement)obj).getElement();
+ if (elem.getLocalName().equals("schema")) {
+ schemaElem = elem;
+ }
+ }
+ if (schemaElem != null) {
+ for (Object prefix : def.getNamespaces().keySet()) {
+ String ns = (String)def.getNamespaces().get(prefix);
+ if (!"".equals(prefix) &&
!schemaElem.hasAttribute("xmlns:" + prefix)) {
+
schemaElem.setAttributeNS(javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI,
+ "xmlns:" + prefix, ns);
+ }
+ }
+ String systemId = def.getDocumentBaseURI() + "#types" +
schemaCount;
+
+ schemaCol.setBaseUri(def.getDocumentBaseURI());
+ CatalogXmlSchemaURIResolver schemaResolver =
+ new
CatalogXmlSchemaURIResolver(OASISCatalogManager.getCatalogManager(bus));
+ schemaCol.setSchemaResolver(schemaResolver);
+
+ XmlSchema xmlSchema = schemaCol.read(schemaElem, systemId);
+ SchemaInfo schemaInfo = new SchemaInfo(serviceInfo,
xmlSchema.getTargetNamespace());
+ schemaInfo.setElement(schemaElem);
+ schemaInfo.setSchema(xmlSchema);
+ schemaInfo.setSystemId(systemId);
+ serviceInfo.addSchema(schemaInfo);
+ schemaCount++;
+ }
+ }
+ }
+ }
+
+ private void parseImports(Definition def, List<Definition> defList) {
+ List<Import> importList = new ArrayList<Import>();
+
+ Collection<List<Import>> ilist = cast(def.getImports().values());
+ for (List<Import> list : ilist) {
+ importList.addAll(list);
+ }
+ for (Import impt : importList) {
+ if (!defList.contains(impt.getDefinition())) {
+ defList.add(impt.getDefinition());
+ parseImports(impt.getDefinition(), defList);
+ }
+ }
+ }
+
+ // Workaround for getting the elements
+ private void getSchemaList(Definition def) {
+ Types typesElement = def.getTypes();
+ if (typesElement != null) {
+ Iterator ite = typesElement.getExtensibilityElements().iterator();
+ while (ite.hasNext()) {
+ Object obj = ite.next();
+ if (obj instanceof Schema) {
+ Schema schema = (Schema)obj;
+ addSchema(schema.getDocumentBaseURI(), schema);
+ }
+ }
+ }
+ }
+
+ private void addSchema(String docBaseURI, Schema schema) {
+ //String docBaseURI = schema.getDocumentBaseURI();
+ Element schemaEle = schema.getElement();
+ if (schemaList.get(docBaseURI) == null) {
+ schemaList.put(docBaseURI, schemaEle);
+ } else if (schemaList.get(docBaseURI) != null &&
schemaList.containsValue(schemaEle)) {
+ // do nothing
+ } else {
+ String tns = schema.getDocumentBaseURI() + "#"
+ + schema.getElement().getAttribute("targetNamespace");
+ if (schemaList.get(tns) == null) {
+ schemaList.put(tns, schema.getElement());
+ }
+ }
+
+ Map<String, List> imports = CastUtils.cast(schema.getImports());
+ if (imports != null && imports.size() > 0) {
+ Collection<String> importKeys = imports.keySet();
+ for (String importNamespace : importKeys) {
+
+ List<SchemaImport> schemaImports =
CastUtils.cast(imports.get(importNamespace));
+
+ for (SchemaImport schemaImport : schemaImports) {
+ Schema tempImport = schemaImport.getReferencedSchema();
+ String key = schemaImport.getSchemaLocationURI();
+ if (importNamespace == null && tempImport != null) {
+ importNamespace = tempImport.getDocumentBaseURI();
+ }
+ if ((catalogResolvedMap == null ||
!catalogResolvedMap.containsKey(key))
+ && tempImport != null) {
+ key = tempImport.getDocumentBaseURI();
+ }
+ if (tempImport != null
+ && !isSchemaParsed(key, importNamespace)
+ && !schemaList.containsValue(tempImport.getElement()))
{
+ addSchema(key, tempImport);
+ }
+ }
+
+ }
+ }
+ }
+
+ private boolean isSchemaParsed(String baseUri, String ns) {
+ if (schemaList.get(baseUri) != null) {
+ Element ele = schemaList.get(baseUri);
+ String tns = ele.getAttribute("targetNamespace");
+ if (ns.equals(tns)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void setCatalogResolvedMap(Map<String, String> resolvedMap) {
+ catalogResolvedMap = resolvedMap;
+ }
+}
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
Wed Nov 14 14:05:17 2007
@@ -54,6 +54,7 @@
import org.apache.cxf.BusException;
import org.apache.cxf.binding.BindingFactory;
import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.service.model.AbstractMessageContainer;
import org.apache.cxf.service.model.AbstractPropertiesHolder;
@@ -72,7 +73,6 @@
import org.apache.cxf.service.model.UnwrappedOperationInfo;
import org.apache.cxf.transport.DestinationFactory;
import org.apache.cxf.transport.DestinationFactoryManager;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.XmlSchemaComplexType;
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.apache.ws.commons.schema.XmlSchemaObject;
@@ -500,7 +500,7 @@
if (!passedRule) {
return;
}
- XmlSchemaCollection schemas =
opInfo.getInterface().getService().getXmlSchemaCollection();
+ SchemaCollection schemas =
opInfo.getInterface().getService().getXmlSchemaCollection();
XmlSchemaElement inputEl = null;
XmlSchemaElement outputEl = null;
@@ -650,7 +650,7 @@
}
private void buildMessage(AbstractMessageContainer minfo, Message msg) {
- XmlSchemaCollection schemas =
minfo.getOperation().getInterface().getService()
+ SchemaCollection schemas =
minfo.getOperation().getInterface().getService()
.getXmlSchemaCollection();
List orderedParam = msg.getOrderedParts(null);
for (Part part : cast(orderedParam, Part.class)) {
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
Wed Nov 14 14:05:17 2007
@@ -45,6 +45,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.binding.BindingFactoryManager;
import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.helpers.XMLUtils;
import org.apache.cxf.service.model.BindingFaultInfo;
@@ -62,7 +63,6 @@
import org.apache.cxf.transport.DestinationFactory;
import org.apache.cxf.transport.DestinationFactoryManager;
import org.apache.cxf.wsdl.EndpointReferenceUtils;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.easymock.classextension.EasyMock;
import org.easymock.classextension.IMocksControl;
@@ -363,7 +363,7 @@
@Test
public void testSchema() {
- XmlSchemaCollection schemas = serviceInfo.getXmlSchemaCollection();
+ SchemaCollection schemas = serviceInfo.getXmlSchemaCollection();
assertNotNull(schemas);
assertEquals(serviceInfo.getSchemas().size(), 1);
SchemaInfo schemaInfo = serviceInfo.getSchemas().iterator().next();
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
Wed Nov 14 14:05:17 2007
@@ -45,6 +45,7 @@
import org.apache.cxf.aegis.type.basic.BeanType;
import org.apache.cxf.aegis.util.XmlConstants;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.databinding.DataBinding;
import org.apache.cxf.databinding.DataReader;
import org.apache.cxf.databinding.DataWriter;
@@ -61,7 +62,6 @@
import org.apache.cxf.wsdl.WSDLConstants;
import org.apache.ws.commons.schema.XmlSchema;
import org.apache.ws.commons.schema.XmlSchemaAnnotated;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.utils.NamespaceMap;
import org.jdom.Attribute;
import org.jdom.Document;
@@ -274,7 +274,7 @@
protected void initializeMessageTypes(ServiceInfo s,
AbstractMessageContainer container,
int partType) {
- XmlSchemaCollection col = s.getXmlSchemaCollection();
+ SchemaCollection col = s.getXmlSchemaCollection();
for (Iterator itr = container.getMessageParts().iterator();
itr.hasNext();) {
MessagePartInfo part = (MessagePartInfo)itr.next();
if (part.isElement()) {
@@ -311,7 +311,7 @@
types.add(t);
}
for (ServiceInfo si : s.getServiceInfos()) {
- XmlSchemaCollection col = si.getXmlSchemaCollection();
+ SchemaCollection col = si.getXmlSchemaCollection();
if (col.getXmlSchemas().length > 1) {
// someone has already filled in the types
continue;
@@ -371,7 +371,7 @@
org.w3c.dom.Document schema = new DOMOutputter().output(new
Document(e));
for (ServiceInfo si : s.getServiceInfos()) {
- XmlSchemaCollection col = si.getXmlSchemaCollection();
+ SchemaCollection col = si.getXmlSchemaCollection();
col.setNamespaceContext(nsMap);
XmlSchema xmlSchema = addSchemaDocument(si, col, schema,
entry.getKey());
// Work around bug in JDOM DOMOutputter which fails to
correctly
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Wed Nov 14 14:05:17 2007
@@ -59,6 +59,7 @@
import org.apache.cxf.common.util.CacheMap;
import org.apache.cxf.common.util.PackageUtils;
import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.databinding.DataBinding;
import org.apache.cxf.databinding.DataReader;
import org.apache.cxf.databinding.DataWriter;
@@ -69,7 +70,6 @@
import org.apache.cxf.service.factory.ServiceConstructionException;
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.ws.addressing.ObjectFactory;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
public final class JAXBDataBinding extends AbstractDataBinding implements
DataBinding {
public static final String SCHEMA_RESOURCE = "SCHEMRESOURCE";
@@ -205,7 +205,7 @@
for (ServiceInfo serviceInfo : service.getServiceInfos()) {
- XmlSchemaCollection col = serviceInfo.getXmlSchemaCollection();
+ SchemaCollection col = serviceInfo.getXmlSchemaCollection();
if (col.getXmlSchemas().length > 1) {
// someone has already filled in the types
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Wed Nov 14 14:05:17 2007
@@ -33,6 +33,7 @@
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.service.ServiceModelVisitor;
import org.apache.cxf.service.model.FaultInfo;
@@ -41,7 +42,6 @@
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.wsdl.WSDLConstants;
import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.XmlSchemaComplexType;
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.apache.ws.commons.schema.XmlSchemaForm;
@@ -55,10 +55,10 @@
class JAXBSchemaInitializer extends ServiceModelVisitor {
private static final Logger LOG =
LogUtils.getLogger(JAXBSchemaInitializer.class);
- private XmlSchemaCollection schemas;
+ private SchemaCollection schemas;
private JAXBContextImpl context;
- public JAXBSchemaInitializer(ServiceInfo serviceInfo, XmlSchemaCollection
col, JAXBContextImpl context) {
+ public JAXBSchemaInitializer(ServiceInfo serviceInfo, SchemaCollection
col, JAXBContextImpl context) {
super(serviceInfo);
schemas = col;
this.context = context;
@@ -175,7 +175,7 @@
schemaInfo = new SchemaInfo(serviceInfo, qn.getNamespaceURI());
el = createXsElement(part, typeName, schemaInfo);
- XmlSchema schema = new XmlSchema(qn.getNamespaceURI(), schemas);
+ XmlSchema schema =
schemas.newXmlSchemaInCollection(qn.getNamespaceURI());
schemaInfo.setSchema(schema);
schema.getElements().add(el.getQName(), el);
schema.getItems().add(el);
@@ -308,7 +308,7 @@
}
XmlSchema schema;
if (schemaInfo == null) {
- schema = new XmlSchema(part.getElementQName().getNamespaceURI(),
schemas);
+ schema =
schemas.newXmlSchemaInCollection(part.getElementQName().getNamespaceURI());
schema.setElementFormDefault(new
XmlSchemaForm(XmlSchemaForm.QUALIFIED));
NamespaceMap nsMap = new NamespaceMap();
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Wed Nov 14 14:05:17 2007
@@ -19,7 +19,6 @@
package org.apache.cxf.service.factory;
-import java.io.StringReader;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.GenericArrayType;
@@ -47,6 +46,7 @@
import org.apache.cxf.binding.BindingFactoryManager;
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.endpoint.EndpointException;
import org.apache.cxf.endpoint.EndpointImpl;
@@ -77,9 +77,7 @@
import org.apache.cxf.service.model.UnwrappedOperationInfo;
import org.apache.cxf.wsdl.WSDLConstants;
import org.apache.cxf.wsdl11.WSDLServiceFactory;
-import org.apache.ws.commons.schema.ValidationEventHandler;
import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.XmlSchemaComplexType;
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.apache.ws.commons.schema.XmlSchemaForm;
@@ -186,7 +184,7 @@
private void fillInSchemaCrossreferences() {
Service service = getService();
for (ServiceInfo serviceInfo : service.getServiceInfos()) {
- XmlSchemaCollection schemaCollection =
serviceInfo.getXmlSchemaCollection();
+ SchemaCollection schemaCollection =
serviceInfo.getXmlSchemaCollection();
// First pass, fill in any types for which we have a name but no
type.
for (SchemaInfo schemaInfo : serviceInfo.getSchemas()) {
@@ -275,6 +273,7 @@
}
ServiceInfo serviceInfo = new ServiceInfo();
+
ServiceImpl service = new ServiceImpl(serviceInfo);
setService(service);
@@ -931,21 +930,6 @@
}
- /**
- * This is a really ugly trick to get around a bug or oversight in
XmlSchema, which is that
- * there is no way to programmatically construct an XmlSchema instance
that ends up cataloged
- * in a collection. If there is a fix to WSCOMMONS-272, this can go away.
- * @param collection collection to contain new schema
- * @return new schema
- */
- private XmlSchema newXmlSchemaInCollection(XmlSchemaCollection collection,
String namespaceURI) {
- StringBuffer tinyXmlSchemaDocument = new StringBuffer();
- tinyXmlSchemaDocument.append("<xsd:schema
xmlns:xsd='http://www.w3.org/2001/XMLSchema' ");
- tinyXmlSchemaDocument.append("targetNamespace='" + namespaceURI +
"'/>");
- StringReader reader = new
StringReader(tinyXmlSchemaDocument.toString());
- return collection.read(reader, new ValidationEventHandler() { });
- }
-
private SchemaInfo getOrCreateSchema(ServiceInfo serviceInfo,
String namespaceURI,
boolean qualified) {
@@ -956,9 +940,9 @@
}
SchemaInfo schemaInfo = new SchemaInfo(serviceInfo, namespaceURI);
- XmlSchemaCollection col = serviceInfo.getXmlSchemaCollection();
+ SchemaCollection col = serviceInfo.getXmlSchemaCollection();
- XmlSchema schema = newXmlSchemaInCollection(col, namespaceURI);
+ XmlSchema schema = col.newXmlSchemaInCollection(namespaceURI);
if (qualified) {
schema.setElementFormDefault(new
XmlSchemaForm(XmlSchemaForm.QUALIFIED));
}
Modified:
incubator/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
Wed Nov 14 14:05:17 2007
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -44,12 +45,12 @@
import org.apache.cxf.BusFactory;
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.tools.common.ToolException;
import org.apache.cxf.wsdl.WSDLConstants;
import org.apache.cxf.wsdl11.SchemaUtil;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
public final class ValidatorUtil {
private static final Logger LOG =
LogUtils.getL7dLogger(ValidatorUtil.class);
@@ -58,7 +59,7 @@
}
- public static XmlSchemaCollection getSchema(final Definition def) {
+ public static SchemaCollection getSchema(final Definition def) {
ServiceInfo serviceInfo = new ServiceInfo();
new SchemaUtil(BusFactory.getDefaultBus(),
new HashMap<String, Element>()).getSchemas(def,
@@ -77,18 +78,15 @@
* @throws IOException
* @throws SAXException
*/
- public static List<XmlSchemaCollection> getSchemaList(Document document,
+ public static List<SchemaCollection> getSchemaList(Document document,
String baseURI) throws IOException, SAXException {
- List<XmlSchemaCollection> schemaList = new
ArrayList<XmlSchemaCollection>();
+ List<SchemaCollection> schemaList = new ArrayList<SchemaCollection>();
if (document == null) {
return schemaList;
}
- //
- // If we are on windows we may have spaces in the uri
- // which need to be escaped.
- //
- baseURI = baseURI.replaceAll(" ", "%20");
- XmlSchemaCollection schemaCol = new XmlSchemaCollection();
+ // URL might need encoding for special characters.
+ baseURI = URLEncoder.encode(baseURI, "utf-8");
+ SchemaCollection schemaCol = new SchemaCollection();
schemaCol.setBaseUri(baseURI);
NodeList nodes = document.getElementsByTagNameNS(
WSDLConstants.NU_SCHEMA_XSD, "schema");
Modified:
incubator/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
Wed Nov 14 14:05:17 2007
@@ -52,6 +52,7 @@
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.helpers.XPathUtils;
import org.apache.cxf.tools.common.ToolException;
import org.apache.cxf.tools.validator.internal.model.FailureLocation;
@@ -68,7 +69,6 @@
import org.apache.cxf.tools.validator.internal.model.XService;
import org.apache.cxf.wsdl.WSDLConstants;
import org.apache.cxf.wsdl11.WSDLDefinitionBuilder;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.apache.ws.commons.schema.XmlSchemaType;
@@ -85,8 +85,8 @@
private Definition definition;
private List<Definition> importedDefinitions;
- private List<XmlSchemaCollection> schemas = new
ArrayList<XmlSchemaCollection>();
- private XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
+ private List<SchemaCollection> schemas = new ArrayList<SchemaCollection>();
+ private SchemaCollection schemaCollection = new SchemaCollection();
private boolean suppressWarnings;
@@ -566,7 +566,7 @@
} else {
if (isElement) {
- for (XmlSchemaCollection schema : schemas) {
+ for (SchemaCollection schema : schemas) {
if (schema != null && schema.getElementByQName(
new QName(namespace, name)) != null) {
partvalid = true;
@@ -574,7 +574,7 @@
}
}
} else {
- for (XmlSchemaCollection schema : schemas) {
+ for (SchemaCollection schema : schemas) {
if (schema != null && schema.getTypeByQName(
new QName(namespace, name)) != null) {
partvalid = true;
Modified:
incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java?rev=595083&r1=595082&r2=595083&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
Wed Nov 14 14:05:17 2007
@@ -37,6 +37,7 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.helpers.JavaUtils;
import org.apache.cxf.jaxb.JAXBUtils;
@@ -50,7 +51,6 @@
import org.apache.cxf.tools.util.URIParserUtil;
import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.XmlSchemaComplexType;
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.apache.ws.commons.schema.XmlSchemaForm;
@@ -354,7 +354,7 @@
List<WrapperElement> qnames = new ArrayList<WrapperElement>();
ServiceInfo serviceInfo = (ServiceInfo)context.get(ServiceInfo.class);
- XmlSchemaCollection schema = serviceInfo.getXmlSchemaCollection();
+ SchemaCollection schema = serviceInfo.getXmlSchemaCollection();
XmlSchemaElement elementByName = schema.getElementByQName(partElement);
@@ -395,7 +395,7 @@
public static boolean isSchemaFormQualified(ToolContext context, QName
partElement) {
ServiceInfo serviceInfo = (ServiceInfo)context.get(ServiceInfo.class);
- XmlSchemaCollection schemaCol = serviceInfo.getXmlSchemaCollection();
+ SchemaCollection schemaCol = serviceInfo.getXmlSchemaCollection();
for (int i = 0; i < schemaCol.getXmlSchemas().length; i++) {
XmlSchema schema = schemaCol.getXmlSchemas().clone()[i];