diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 23:07:19 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 23:07:19 +0000 |
commit | 6fadbc9cd1fcf03d0b3630f772d91df149b70428 (patch) | |
tree | 32752e491abb97fc8ef4f246455e3b5fd2814862 /branches/sca-java-1.0.1/modules/interface-wsdl-xml | |
parent | 5559ef5edbf8d3616f7a4b497b2a459b0ee4082b (diff) |
Moving 1.x branches
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835123 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.0.1/modules/interface-wsdl-xml')
40 files changed, 0 insertions, 3381 deletions
diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/DISCLAIMER b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software
-Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
-required of all newly accepted projects until a further review indicates that
-the infrastructure, communications, and decision making process have stabilized
-in a manner consistent with other successful ASF projects. While incubation
-status is not necessarily a reflection of the completeness or stability of the
-code, it does indicate that the project has yet to be fully endorsed by the ASF.
-
diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/LICENSE b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. - - - diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/NOTICE b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/pom.xml b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/pom.xml deleted file mode 100644 index 6a1f6b2545..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?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. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-modules</artifactId> - <version>1.0.1-incubating-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>tuscany-interface-wsdl-xml</artifactId> - <name>Apache Tuscany SCA WSDL Interface XML Model</name> - - <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution</artifactId> - <version>1.0.1-incubating-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-namespace</artifactId> - <version>1.0.1-incubating-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-impl</artifactId> - <version>1.0.1-incubating-SNAPSHOT</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-assembly-xml</artifactId> - <version>1.0.1-incubating-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-interface-wsdl</artifactId> - <version>1.0.1-incubating-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-sca</artifactId> - <version>1.0.1-incubating-SNAPSHOT</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java deleted file mode 100644 index 7de5d5349f..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.xml.Constants; - -public interface WSDLConstants { - - String INTERFACE_WSDL = "interface.wsdl"; - QName INTERFACE_WSDL_QNAME = new QName(Constants.SCA10_NS, "interface.wsdl"); - String INTERFACE = "interface"; - String CALLBACK_INTERFACE = "callbackInterface"; - String WSDL_LOCATION = "wsdlLocation"; - String WSDLI_NS = "http://www.w3.org/2004/08/wsdl-instance"; - QName WSDL_LOCATION_QNAME = new QName(WSDLI_NS, WSDL_LOCATION); - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java deleted file mode 100644 index dc672122b2..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.Definition; -import javax.wsdl.Import; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition; - -/** - * An ArtifactProcessor for WSDL documents. - * - * @version $Rev$ $Date$ - */ -public class WSDLDocumentProcessor implements URLArtifactProcessor<WSDLDefinition> { - - public static final QName WSDL11 = new QName("http://schemas.xmlsoap.org/wsdl/", "definitions"); - public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema"); - - private final static XMLInputFactory inputFactory = XMLInputFactory.newInstance(); - - private WSDLFactory factory; - - public WSDLDocumentProcessor(ModelFactoryExtensionPoint modelFactories) { - this.factory = modelFactories.getFactory(WSDLFactory.class); - } - - public WSDLDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException { - try { - return indexRead(artifactURL); - } catch (Exception e) { - throw new ContributionReadException(e); - } - } - - public void resolve(WSDLDefinition model, ModelResolver resolver) throws ContributionResolveException { - Definition definition = model.getDefinition(); - if (definition != null) { - for (Object imports : definition.getImports().values()) { - List importList = (List)imports; - for (Object i : importList) { - Import imp = (Import)i; - if (imp.getDefinition() != null) { - continue; - } - if (imp.getLocationURI() == null) { - // FIXME: [rfeng] By the WSDL 1.1 spec, the location attribute is required - // We need to resolve it by QName - WSDLDefinition proxy = factory.createWSDLDefinition(); - proxy.setUnresolved(true); - proxy.setNamespace(imp.getNamespaceURI()); - WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, proxy); - if (resolved != null && !resolved.isUnresolved()) { - imp.setDefinition(resolved.getDefinition()); - } - } else { - String location = imp.getLocationURI(); - URI uri = URI.create(location); - if (uri.isAbsolute()) { - WSDLDefinition resolved; - try { - resolved = read(null, uri, uri.toURL()); - imp.setDefinition(resolved.getDefinition()); - } catch (Exception e) { - throw new ContributionResolveException(e); - } - } else { - if (location.startsWith("/")) { - // This is a relative URI against a contribution - location = location.substring(1); - // TODO: Need to resolve it against the contribution - } else { - // This is a relative URI against the WSDL document - URI baseURI = URI.create(model.getDefinition().getDocumentBaseURI()); - URI locationURI = baseURI.resolve(location); - WSDLDefinition resolved; - try { - resolved = read(null, locationURI, locationURI.toURL()); - imp.setDefinition(resolved.getDefinition()); - } catch (Exception e) { - throw new ContributionResolveException(e); - } - } - } - } - } - } - } - } - - public String getArtifactType() { - return ".wsdl"; - } - - public Class<WSDLDefinition> getModelType() { - return WSDLDefinition.class; - } - - /** - * Read the namespace for the WSDL definition and inline schemas - * - * @param doc - * @return - * @throws IOException - * @throws XMLStreamException - */ - protected WSDLDefinition indexRead(URL doc) throws Exception { - WSDLDefinition wsdlDefinition = factory.createWSDLDefinition(); - wsdlDefinition.setUnresolved(true); - wsdlDefinition.setLocation(doc.toURI()); - - InputStream is = doc.openStream(); - try { - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - int eventType = reader.getEventType(); - int index = 0; - while (true) { - if (eventType == XMLStreamConstants.START_ELEMENT) { - if (WSDL11.equals(reader.getName())) { - String tns = reader.getAttributeValue(null, "targetNamespace"); - wsdlDefinition.setNamespace(tns); - // The definition is marked as resolved but not loaded - wsdlDefinition.setUnresolved(false); - wsdlDefinition.setDefinition(null); - } - if (XSD.equals(reader.getName())) { - String tns = reader.getAttributeValue(null, "targetNamespace"); - XSDefinition xsd = factory.createXSDefinition(); - xsd.setUnresolved(true); - xsd.setNamespace(tns); - xsd.setLocation(URI.create(doc.toURI() + "#" + index)); - index++; - // The definition is marked as resolved but not loaded - xsd.setUnresolved(false); - xsd.setSchema(null); - wsdlDefinition.getXmlSchemas().add(xsd); - } - } - if (reader.hasNext()) { - eventType = reader.next(); - } else { - break; - } - } - return wsdlDefinition; - } finally { - is.close(); - } - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java deleted file mode 100644 index 45ae17b784..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; - -import javax.wsdl.PortType; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract; - -public class WSDLInterfaceProcessor implements StAXArtifactProcessor<WSDLInterfaceContract>, WSDLConstants { - - private WSDLFactory wsdlFactory; - - public WSDLInterfaceProcessor(ModelFactoryExtensionPoint modelFactories) { - this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class); - } - - /** - * Create a WSDL interface from a URI. - * @param uri - * @return - * @throws ContributionReadException - */ - private WSDLInterface createWSDLInterface(String uri) throws ContributionReadException { - WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface(); - wsdlInterface.setUnresolved(true); - - // Read a qname in the form: - // namespace#wsdl.interface(name) - int index = uri.indexOf('#'); - if (index == -1) { - throw new ContributionReadException("Invalid WSDL interface attribute: " + uri); - } - String namespace = uri.substring(0, index); - String name = uri.substring(index + 1); - name = name.substring("wsdl.interface(".length(), name.length() - 1); - wsdlInterface.setName(new QName(namespace, name)); - - return wsdlInterface; - } - - public WSDLInterfaceContract read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException { - // Read an <interface.wsdl> - WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract(); - - // Read wsdlLocation - String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION); - wsdlInterfaceContract.setLocation(location); - - String uri = reader.getAttributeValue(null, INTERFACE); - if (uri != null) { - WSDLInterface wsdlInterface = createWSDLInterface(uri); - wsdlInterfaceContract.setInterface(wsdlInterface); - } - - uri = reader.getAttributeValue(null, CALLBACK_INTERFACE); - if (uri != null) { - WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri); - wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface); - } - - // Skip to end element - while (reader.hasNext()) { - if (reader.next() == END_ELEMENT && INTERFACE_WSDL_QNAME.equals(reader.getName())) { - break; - } - } - return wsdlInterfaceContract; - } - - public void write(WSDLInterfaceContract wsdlInterfaceContract, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException { - // Write an <interface.wsdl> - writer.writeStartElement(Constants.SCA10_NS, INTERFACE_WSDL); - - // Write interface name - WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface(); - if (wsdlInterface != null) { - QName qname = wsdlInterface.getName(); - String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")"; - writer.writeAttribute(INTERFACE, uri); - } - - WSDLInterface wsdlCallbackInterface = (WSDLInterface)wsdlInterfaceContract.getCallbackInterface(); - if (wsdlCallbackInterface != null) { - QName qname = wsdlCallbackInterface.getName(); - String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")"; - writer.writeAttribute(CALLBACK_INTERFACE, uri); - } - - // Write location - if (wsdlInterfaceContract.getLocation() != null) { - writer.writeAttribute(WSDLI_NS, WSDL_LOCATION, wsdlInterfaceContract.getLocation()); - } - - writer.writeEndElement(); - } - - private WSDLInterface resolveWSDLInterface(WSDLInterface wsdlInterface, ModelResolver resolver) throws ContributionResolveException { - - if (wsdlInterface != null && wsdlInterface.isUnresolved()) { - - // Resolve the WSDL interface - wsdlInterface = resolver.resolveModel(WSDLInterface.class, wsdlInterface); - if (wsdlInterface.isUnresolved()) { - - // If the WSDL interface has never been resolved yet, do it now - // First, resolve the WSDL definition for the given namespace - WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition(); - wsdlDefinition.setUnresolved(true); - wsdlDefinition.setNamespace(wsdlInterface.getName().getNamespaceURI()); - wsdlDefinition = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition); - if (!wsdlDefinition.isUnresolved()) { - PortType portType = wsdlDefinition.getDefinition().getPortType(wsdlInterface.getName()); - if (portType != null) { - - // Introspect the WSDL portType and add the resulting - // WSDLInterface to the resolver - try { - wsdlInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition, resolver); - } catch (InvalidInterfaceException e) { - throw new ContributionResolveException(e); - } - resolver.addModel(wsdlInterface); - wsdlInterface.setWsdlDefinition(wsdlDefinition); - } - } - } - } - return wsdlInterface; - } - - public void resolve(WSDLInterfaceContract wsdlInterfaceContract, ModelResolver resolver) throws ContributionResolveException { - - // Resolve the interface and callback interface - WSDLInterface wsdlInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getInterface(), resolver); - wsdlInterfaceContract.setInterface(wsdlInterface); - - WSDLInterface wsdlCallbackInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getCallbackInterface(), resolver); - wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface); - } - - public QName getArtifactType() { - return WSDLConstants.INTERFACE_WSDL_QNAME; - } - - public Class<WSDLInterfaceContract> getModelType() { - return WSDLInterfaceContract.class; - } -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java deleted file mode 100644 index b7f033a6dc..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java +++ /dev/null @@ -1,402 +0,0 @@ -/*
- * 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.tuscany.sca.interfacedef.wsdl.xml;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Types;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.ExtensionDeserializer;
-import javax.wsdl.extensions.ExtensionRegistry;
-import javax.wsdl.extensions.ExtensionSerializer;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.extensions.UnknownExtensionDeserializer;
-import javax.wsdl.extensions.UnknownExtensionSerializer;
-import javax.wsdl.extensions.schema.Schema;
-import javax.wsdl.xml.WSDLLocator;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.DeployedArtifact;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionRuntimeException;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
-import org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-/**
- * A Model Resolver for WSDL models.
- *
- * @version $Rev: 557916 $ $Date: 2007-07-20 01:04:40 -0700 (Fri, 20 Jul 2007) $
- */
-public class WSDLModelResolver implements ModelResolver {
- //Schema element names
- public static final String ELEM_SCHEMA = "schema";
-
- //Schema uri
- public static final String NS_URI_XSD_1999 = "http://www.w3.org/1999/XMLSchema";
- public static final String NS_URI_XSD_2000 = "http://www.w3.org/2000/10/XMLSchema";
- public static final String NS_URI_XSD_2001 = "http://www.w3.org/2001/XMLSchema";
-
- //Schema qnames
- public static final QName Q_ELEM_XSD_1999 = new QName(NS_URI_XSD_1999, ELEM_SCHEMA);
- public static final QName Q_ELEM_XSD_2000 = new QName(NS_URI_XSD_2000, ELEM_SCHEMA);
- public static final QName Q_ELEM_XSD_2001 = new QName(NS_URI_XSD_2001, ELEM_SCHEMA);
- public static final List<QName> XSD_QNAME_LIST =
- Arrays.asList(new QName[] {Q_ELEM_XSD_1999, Q_ELEM_XSD_2000, Q_ELEM_XSD_2001});
-
- private Contribution contribution;
- private Map<String, List<WSDLDefinition>> map = new HashMap<String, List<WSDLDefinition>>();
-
- private ExtensionRegistry wsdlExtensionRegistry;
-
- private WSDLFactory wsdlFactory;
- private javax.wsdl.factory.WSDLFactory wsdl4jFactory;
- private ContributionFactory contributionFactory;
-
- public WSDLModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
-
- this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
- this.wsdl4jFactory = modelFactories.getFactory(javax.wsdl.factory.WSDLFactory.class);
- this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
-
- wsdlExtensionRegistry = this.wsdl4jFactory.newPopulatedExtensionRegistry();
- // REVIEW: [rfeng] Disable the schema extension for WSDL4J to avoid aggressive loading
- ExtensionDeserializer deserializer = new UnknownExtensionDeserializer();
- ExtensionSerializer serializer = new UnknownExtensionSerializer();
- for (QName schema : XSD_QNAME_LIST) {
- wsdlExtensionRegistry.registerSerializer(Types.class, schema, serializer);
- wsdlExtensionRegistry.registerDeserializer(Types.class, schema, deserializer);
- }
- }
-
- /**
- * Implementation of a WSDL locator.
- */
- private class WSDLLocatorImpl implements WSDLLocator {
- private InputStream inputStream;
- private URL base;
- private String latestImportURI;
-
- public WSDLLocatorImpl(URL base, InputStream is) {
- this.base = base;
- this.inputStream = is;
- }
-
- public void close() {
- try {
- inputStream.close();
- } catch (IOException e) {
- // Ignore
- }
- }
-
- public InputSource getBaseInputSource() {
- try {
- return XMLDocumentHelper.getInputSource(base, inputStream);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public String getBaseURI() {
- return base.toString();
- }
-
- public InputSource getImportInputSource(String parentLocation, String importLocation) {
- try {
- if (importLocation == null) {
- throw new IllegalArgumentException("Required attribute 'location' is missing.");
- }
-
- URL url = null;
- if (importLocation.startsWith("/")) {
- // The URI is relative to the contribution
- String uri = importLocation.substring(1);
-
- DeployedArtifact proxyArtifact = contributionFactory.createDeployedArtifact();
- proxyArtifact.setURI(uri);
-
- //use contribution resolution (this supports import/export)
- DeployedArtifact importedArtifact =
- contribution.getModelResolver().resolveModel(DeployedArtifact.class, proxyArtifact);
- if (importedArtifact.getLocation() != null) {
- //get the artifact URL
- url = new URL(importedArtifact.getLocation());
- }
- } else {
- url = new URL(new URL(parentLocation), importLocation);
- }
- if (url == null) {
- return null;
- }
- latestImportURI = url.toString();
- return XMLDocumentHelper.getInputSource(url);
- } catch (Exception e) {
- throw new ContributionRuntimeException(e);
- }
- }
-
- public String getLatestImportURI() {
- return latestImportURI;
- }
-
- }
-
- public void addModel(Object resolved) {
- WSDLDefinition definition = (WSDLDefinition)resolved;
- for (XSDefinition d : definition.getXmlSchemas()) {
- if (contribution != null) {
- contribution.getModelResolver().addModel(d);
- }
- }
- List<WSDLDefinition> list = map.get(definition.getNamespace());
- if (list == null) {
- list = new ArrayList<WSDLDefinition>();
- map.put(definition.getNamespace(), list);
- }
- list.add(definition);
- }
-
- public Object removeModel(Object resolved) {
- WSDLDefinition definition = (WSDLDefinition)resolved;
- List<WSDLDefinition> list = map.get(definition.getNamespace());
- if (list == null) {
- return null;
- } else {
- return list.remove(definition);
- }
- }
-
- /**
- * Create a facade Definition which imports all the defintions
- *
- * @param definitions A list of the WSDL definitions under the same target namespace
- * @return The aggregated WSDL definition
- */
- private WSDLDefinition aggregate(List<WSDLDefinition> definitions) {
- if (definitions == null || definitions.size() == 0) {
- return null;
- }
- if (definitions.size() == 1) {
- WSDLDefinition d = definitions.get(0);
- loadOnDemand(d);
- return d;
- }
- WSDLDefinition aggregated = wsdlFactory.createWSDLDefinition();
- for (WSDLDefinition d : definitions) {
- loadOnDemand(d);
- }
- Definition facade = wsdl4jFactory.newDefinition();
- String ns = definitions.get(0).getNamespace();
- facade.setQName(new QName(ns, "$aggregated$"));
- facade.setTargetNamespace(ns);
-
- for (WSDLDefinition d : definitions) {
- if (d.getDefinition() != null) {
- javax.wsdl.Import imp = facade.createImport();
- imp.setNamespaceURI(d.getNamespace());
- imp.setDefinition(d.getDefinition());
- imp.setLocationURI(d.getDefinition().getDocumentBaseURI());
- facade.addImport(imp);
- aggregated.getXmlSchemas().addAll(d.getXmlSchemas());
- }
- }
- aggregated.setDefinition(facade);
- definitions.clear();
- definitions.add(aggregated);
- return aggregated;
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
-
- // Lookup a definition for the given namespace
- String namespace = ((WSDLDefinition)unresolved).getNamespace();
- List<WSDLDefinition> list = map.get(namespace);
- WSDLDefinition resolved = aggregate(list);
- if (resolved != null && !resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
-
- // No definition found, delegate the resolution to the imports
- for (Import import_ : this.contribution.getImports()) {
- if (import_ instanceof NamespaceImport) {
- NamespaceImport namespaceImport = (NamespaceImport)import_;
- if (namespaceImport.getNamespace().equals(namespace)) {
-
- // Delegate the resolution to the import resolver
- resolved =
- namespaceImport.getModelResolver().resolveModel(WSDLDefinition.class,
- (WSDLDefinition)unresolved);
- if (!resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- }
- }
- return modelClass.cast(unresolved);
- }
-
- /**
- * Load the WSDL definition on demand
- * @param def
- */
- private void loadOnDemand(WSDLDefinition def) {
- if (def.getDefinition() == null && def.getLocation() != null) {
- // Load the definition on-demand
- try {
- loadDefinition(def);
- } catch (ContributionReadException e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- // private Map<String, WSDLDefinition> loadedDefinitions = new Hashtable<String, WSDLDefinition>();
-
- /**
- * Load the WSDL definition and inline schemas
- *
- * @param wsdlDef
- * @throws ContributionReadException
- */
- private void loadDefinition(WSDLDefinition wsdlDef) throws ContributionReadException {
- if (wsdlDef.getDefinition() != null || wsdlDef.getLocation() == null) {
- return;
- }
- try {
- URL artifactURL = wsdlDef.getLocation().toURL();
- // Read a WSDL document
- InputStream is = artifactURL.openStream();
- WSDLReader reader = wsdl4jFactory.newWSDLReader();
- reader.setFeature("javax.wsdl.verbose", false);
- reader.setFeature("javax.wsdl.importDocuments", true);
- // FIXME: We need to decide if we should disable the import processing by WSDL4J
- // reader.setFeature("javax.wsdl.importDocuments", false);
- reader.setExtensionRegistry(wsdlExtensionRegistry);
-
- WSDLLocatorImpl locator = new WSDLLocatorImpl(artifactURL, is);
- Definition definition = reader.readWSDL(locator);
- wsdlDef.setDefinition(definition);
-
- //Read inline schemas
- readInlineSchemas(wsdlDef, definition);
- } catch (WSDLException e) {
- throw new ContributionReadException(e);
- } catch (IOException e) {
- throw new ContributionReadException(e);
- }
- }
-
- private Document promote(Element element) {
- Document doc = (Document)element.getOwnerDocument().cloneNode(false);
- Element schema = (Element)doc.importNode(element, true);
- doc.appendChild(schema);
- Node parent = element.getParentNode();
- while (parent instanceof Element) {
- Element root = (Element)parent;
- NamedNodeMap nodeMap = root.getAttributes();
- for (int i = 0; i < nodeMap.getLength(); i++) {
- Attr attr = (Attr)nodeMap.item(i);
- String name = attr.getName();
- if ("xmlns".equals(name) || name.startsWith("xmlns:")) {
- if (schema.getAttributeNode(name) == null) {
- schema.setAttributeNodeNS((Attr)doc.importNode(attr, true));
- }
- }
- }
- parent = parent.getParentNode();
- }
- doc.setDocumentURI(element.getOwnerDocument().getDocumentURI());
- return doc;
- }
-
- /**
- * Populate the inline schemas including those from the imported definitions
- *
- * @param definition
- * @param schemaCollection
- */
- private void readInlineSchemas(WSDLDefinition wsdlDefinition, Definition definition) {
- if (contribution == null) {
- // Check null for test cases
- return;
- }
- Types types = definition.getTypes();
- if (types != null) {
- int index = 0;
- for (Object ext : types.getExtensibilityElements()) {
- ExtensibilityElement extElement = (ExtensibilityElement)ext;
- Element element = null;
- if (XSD_QNAME_LIST.contains(extElement.getElementType())) {
- if (extElement instanceof Schema) {
- element = ((Schema)extElement).getElement();
- } else if (extElement instanceof UnknownExtensibilityElement) {
- element = ((UnknownExtensibilityElement)extElement).getElement();
- }
- }
- if (element != null) {
- Document doc = promote(element);
- XSDefinition xsDefinition = wsdlFactory.createXSDefinition();
- xsDefinition.setUnresolved(true);
- xsDefinition.setNamespace(element.getAttribute("targetNamespace"));
- xsDefinition.setDocument(doc);
- xsDefinition.setLocation(URI.create(doc.getDocumentURI() + "#" + index));
- contribution.getModelResolver().resolveModel(XSDefinition.class, xsDefinition);
- index++;
- }
- }
- }
- for (Object imports : definition.getImports().values()) {
- List impList = (List)imports;
- for (Object i : impList) {
- javax.wsdl.Import anImport = (javax.wsdl.Import)i;
- // Read inline schemas
- if (anImport.getDefinition() != null) {
- readInlineSchemas(wsdlDefinition, anImport.getDefinition());
- }
- }
- }
- }
-
-}
diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelper.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelper.java deleted file mode 100644 index e5cd9d9a15..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelper.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.net.URL; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.xml.sax.InputSource; - -/** - * @version $Rev$ $Date$ - */ -public class XMLDocumentHelper { - public static final QName WSDL11 = new QName("http://schemas.xmlsoap.org/wsdl/", "definitions"); - public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema"); - public static final QName WSDL20 = new QName("http://www.w3.org/ns/wsdl", "description"); - - protected static final int BUFFER_SIZE = 256; - - /** - * Detect the XML encoding of the WSDL document - * - * @param is The input stream - * @return The encoding - * @throws IOException - */ - public static String getEncoding(InputStream is) throws IOException { - if (!is.markSupported()) - is = new BufferedInputStream(is); - - byte[] buffer = readBuffer(is); - return getXMLEncoding(buffer); - } - - /** - * Searches the array of bytes to determine the XML encoding. - */ - protected static String getXMLEncoding(byte[] bytes) { - String javaEncoding = null; - - if (bytes.length >= 4) { - if (((bytes[0] == -2) && (bytes[1] == -1)) || ((bytes[0] == 0) && (bytes[1] == 60))) - javaEncoding = "UnicodeBig"; - else if (((bytes[0] == -1) && (bytes[1] == -2)) || ((bytes[0] == 60) && (bytes[1] == 0))) - javaEncoding = "UnicodeLittle"; - else if ((bytes[0] == -17) && (bytes[1] == -69) && (bytes[2] == -65)) - javaEncoding = "UTF8"; - } - - String header = null; - - try { - if (javaEncoding != null) - header = new String(bytes, 0, bytes.length, javaEncoding); - else - header = new String(bytes, 0, bytes.length); - } catch (UnsupportedEncodingException e) { - return null; - } - - if (!header.startsWith("<?xml")) - return "UTF-8"; - - int endOfXMLPI = header.indexOf("?>"); - int encodingIndex = header.indexOf("encoding", 6); - - if ((encodingIndex == -1) || (encodingIndex > endOfXMLPI)) - return "UTF-8"; - - int firstQuoteIndex = header.indexOf("\"", encodingIndex); - int lastQuoteIndex; - - if ((firstQuoteIndex == -1) || (firstQuoteIndex > endOfXMLPI)) { - firstQuoteIndex = header.indexOf("'", encodingIndex); - lastQuoteIndex = header.indexOf("'", firstQuoteIndex + 1); - } else - lastQuoteIndex = header.indexOf("\"", firstQuoteIndex + 1); - - return header.substring(firstQuoteIndex + 1, lastQuoteIndex); - } - - protected static byte[] readBuffer(InputStream is) throws IOException { - if (is.available() == 0) { - return new byte[0]; - } - - byte[] buffer = new byte[BUFFER_SIZE]; - is.mark(BUFFER_SIZE); - int bytesRead = is.read(buffer, 0, BUFFER_SIZE); - int totalBytesRead = bytesRead; - - while (bytesRead != -1 && (totalBytesRead < BUFFER_SIZE)) { - bytesRead = is.read(buffer, totalBytesRead, BUFFER_SIZE - totalBytesRead); - - if (bytesRead != -1) - totalBytesRead += bytesRead; - } - - if (totalBytesRead < BUFFER_SIZE) { - byte[] smallerBuffer = new byte[totalBytesRead]; - System.arraycopy(buffer, 0, smallerBuffer, 0, totalBytesRead); - smallerBuffer = buffer; - } - - is.reset(); - return buffer; - } - - public static InputSource getInputSource(URL url) throws IOException { - InputStream is = url.openStream(); - return getInputSource(url, is); - } - - public static InputSource getInputSource(URL url, InputStream is) throws IOException { - is = new BufferedInputStream(is); - String encoding = getEncoding(is); - InputSource inputSource = new InputSource(is); - inputSource.setEncoding(encoding); - // [rfeng] Make sure we set the system id as it will be used as the base URI for nested import/include - inputSource.setSystemId(url.toString()); - return inputSource; - } - - private final static XMLInputFactory inputFactory = XMLInputFactory.newInstance(); - - public static String readTargetNamespace(URL doc, QName element, boolean rootOnly, String attribute) - throws IOException, XMLStreamException { - if (attribute == null) { - attribute = "targetNamespace"; - } - InputStream is = doc.openStream(); - try { - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - int eventType = reader.getEventType(); - while (true) { - if (eventType == XMLStreamConstants.START_ELEMENT) { - if (element.equals(reader.getName())) { - return reader.getAttributeValue(null, attribute); - } else if (rootOnly) { - return null; - } - } - if (reader.hasNext()) { - eventType = reader.next(); - } else { - break; - } - } - return null; - } finally { - is.close(); - } - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessor.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessor.java deleted file mode 100644 index 02c5593f86..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessor.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition; - -/** - * An ArtifactProcessor for XSD documents. - * - * @version $Rev$ $Date$ - */ -public class XSDDocumentProcessor implements URLArtifactProcessor<XSDefinition> { - - private WSDLFactory factory; - - public XSDDocumentProcessor(ModelFactoryExtensionPoint modelFactories) { - this.factory = modelFactories.getFactory(WSDLFactory.class); - } - - public XSDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException { - try { - return indexRead(artifactURL); - } catch (Exception e) { - throw new ContributionReadException(e); - } - } - - public void resolve(XSDefinition model, ModelResolver resolver) throws ContributionResolveException { - } - - public String getArtifactType() { - return ".xsd"; - } - - public Class<XSDefinition> getModelType() { - return XSDefinition.class; - } - - public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema"); - - protected XSDefinition indexRead(URL doc) throws Exception { - XSDefinition xsd = factory.createXSDefinition(); - xsd.setUnresolved(true); - xsd.setNamespace(XMLDocumentHelper.readTargetNamespace(doc, XSD, true, "targetNamespace")); - xsd.setLocation(doc.toURI()); - xsd.setUnresolved(false); - return xsd; - } -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDModelResolver.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDModelResolver.java deleted file mode 100644 index 63ecb996bf..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDModelResolver.java +++ /dev/null @@ -1,230 +0,0 @@ -/*
- * 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.tuscany.sca.interfacedef.wsdl.xml;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.DeployedArtifact;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionRuntimeException;
-import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
-import org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.ws.commons.schema.XmlSchemaInclude;
-import org.apache.ws.commons.schema.resolver.URIResolver;
-import org.xml.sax.InputSource;
-
-/**
- * A Model Resolver for XSD models.
- *
- * @version $Rev: 557916 $ $Date: 2007-07-20 01:04:40 -0700 (Fri, 20 Jul 2007) $
- */
-public class XSDModelResolver implements ModelResolver {
- private WSDLFactory factory;
- private Contribution contribution;
- private Map<String, List<XSDefinition>> map = new HashMap<String, List<XSDefinition>>();
- private XmlSchemaCollection schemaCollection;
-
- public XSDModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- this.schemaCollection = new XmlSchemaCollection();
- schemaCollection.setSchemaResolver(new URIResolverImpl(contribution));
- this.factory = new DefaultWSDLFactory();
- }
-
- public void addModel(Object resolved) {
- XSDefinition definition = (XSDefinition)resolved;
- List<XSDefinition> list = map.get(definition.getNamespace());
- if (list == null) {
- list = new ArrayList<XSDefinition>();
- map.put(definition.getNamespace(), list);
- }
- list.add(definition);
- }
-
- public Object removeModel(Object resolved) {
- XSDefinition definition = (XSDefinition)resolved;
- List<XSDefinition> list = map.get(definition.getNamespace());
- if (list == null) {
- return null;
- } else {
- return list.remove(definition);
- }
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
-
- XSDefinition definition = (XSDefinition)unresolved;
- // Lookup a definition for the given namespace
- String namespace = definition.getNamespace();
- List<XSDefinition> list = map.get(namespace);
- if (list != null && definition.getDocument() != null) {
- // Set the document for the inline schema
- int index = list.indexOf(definition);
- if (index != -1) {
- list.get(index).setDocument(definition.getDocument());
- }
- }
- XSDefinition resolved = null;
- try {
- resolved = aggregate(list);
- } catch (IOException e) {
- throw new ContributionRuntimeException(e);
- }
- if (resolved != null && !resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
-
- // No definition found, delegate the resolution to the imports
- for (Import import_ : this.contribution.getImports()) {
- if (import_ instanceof NamespaceImport) {
- NamespaceImport namespaceImport = (NamespaceImport)import_;
- if (namespaceImport.getNamespace().equals(namespace)) {
-
- // Delegate the resolution to the import resolver
- resolved =
- namespaceImport.getModelResolver().resolveModel(XSDefinition.class, (XSDefinition)unresolved);
- if (!resolved.isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- }
- }
- return modelClass.cast(unresolved);
- }
-
- private void loadOnDemand(XSDefinition definition) throws IOException {
- if (definition.getSchema() != null) {
- return;
- }
- if (definition.getDocument() != null) {
- String uri = null;
- if (definition.getLocation() != null) {
- uri = definition.getLocation().toString();
- }
- XmlSchema schema = schemaCollection.read(definition.getDocument(), uri, null);
- definition.setSchemaCollection(schemaCollection);
- definition.setSchema(schema);
- } else if (definition.getLocation() != null) {
- if (definition.getLocation().getFragment() != null) {
- // It's an inline schema
- return;
- }
- // Read an XSD document
- InputSource xsd = XMLDocumentHelper.getInputSource(definition.getLocation().toURL());
- XmlSchema schema = schemaCollection.read(xsd, null);
- definition.setSchemaCollection(schemaCollection);
- definition.setSchema(schema);
- }
- }
-
- /**
- * Create a facade XmlSchema which includes all the defintions
- *
- * @param definitions A list of the XmlSchema under the same target
- * namespace
- * @return The aggregated XmlSchema
- */
- private XSDefinition aggregate(List<XSDefinition> definitions) throws IOException {
- if (definitions == null || definitions.size() == 0) {
- return null;
- }
- if (definitions.size() == 1) {
- XSDefinition d = definitions.get(0);
- loadOnDemand(d);
- return d;
- }
- XSDefinition aggregated = factory.createXSDefinition();
- for (XSDefinition d : definitions) {
- loadOnDemand(d);
- }
- String ns = definitions.get(0).getNamespace();
- XmlSchema facade = new XmlSchema(ns, schemaCollection);
-
- for (XmlSchema d : schemaCollection.getXmlSchemas()) {
- if (ns.equals(d.getTargetNamespace())) {
- XmlSchemaInclude include = new XmlSchemaInclude();
- include.setSchema(d);
- include.setSourceURI(d.getSourceURI());
- include.setSchemaLocation(d.getSourceURI());
- facade.getIncludes().add(include);
- facade.getItems().add(include);
- }
- }
- aggregated.setUnresolved(true);
- aggregated.setSchema(facade);
- aggregated.setNamespace(ns);
- aggregated.setUnresolved(false);
-
- // FIXME: [rfeng] This is hacky
- definitions.clear();
- definitions.add(aggregated);
- return aggregated;
- }
-
- /**
- * URI resolver implementation for xml schema
- */
- public static class URIResolverImpl implements URIResolver {
- private Contribution contribution;
-
- public URIResolverImpl(Contribution contribution) {
- this.contribution = contribution;
- }
-
- public org.xml.sax.InputSource resolveEntity(java.lang.String targetNamespace,
- java.lang.String schemaLocation,
- java.lang.String baseUri) {
- try {
- if (schemaLocation == null || schemaLocation.startsWith("/")) {
- return null;
- }
- URL url = null;
- if (schemaLocation.startsWith("/")) {
- // The URI is relative to the contribution
- String uri = schemaLocation.substring(1);
- for (DeployedArtifact a : contribution.getArtifacts()) {
- if (a.getURI().equals(uri)) {
- url = new URL(a.getLocation());
- break;
- }
- }
- } else {
- url = new URL(new URL(baseUri), schemaLocation);
- }
- return XMLDocumentHelper.getInputSource(url);
- } catch (IOException e) {
- return null;
- }
- }
- }
-
-}
diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index 9666a6dbd8..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,19 +0,0 @@ -# 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. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLInterfaceProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#interface.wsdl,model=org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor deleted file mode 100644 index 15ae762172..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor +++ /dev/null @@ -1,20 +0,0 @@ -# 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. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLDocumentProcessor;type=.wsdl,model=org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition -org.apache.tuscany.sca.interfacedef.wsdl.xml.XSDDocumentProcessor;type=.xsd,model=org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver deleted file mode 100644 index 9c663a14ce..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver +++ /dev/null @@ -1,19 +0,0 @@ -# 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.
-
-org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver;model=org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition
-org.apache.tuscany.sca.interfacedef.wsdl.xml.XSDModelResolver;model=org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition
diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java deleted file mode 100644 index 5aa28409ea..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.impl.ContributionImpl; -import org.apache.tuscany.sca.contribution.resolver.DefaultModelResolverExtensionPoint; -import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLDocumentProcessor; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.XSDModelResolver; - -/** - * Test case for WSDLOperation - */ -public abstract class AbstractWSDLTestCase extends TestCase { - protected WSDLDocumentProcessor processor; - protected ModelResolver resolver; - protected WSDLFactory wsdlFactory; - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - Contribution contribution = new ContributionImpl() { - }; - ModelResolverExtensionPoint modelResolvers = new DefaultModelResolverExtensionPoint(); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - wsdlFactory = new DefaultWSDLFactory(); - factories.addFactory(wsdlFactory); - javax.wsdl.factory.WSDLFactory wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance(); - factories.addFactory(wsdlFactory); - factories.addFactory(wsdl4jFactory); - resolver = new ExtensibleModelResolver(contribution, modelResolvers, factories); - contribution.setModelResolver(resolver); - modelResolvers.addResolver(WSDLDefinition.class, WSDLModelResolver.class); - modelResolvers.addResolver(XSDefinition.class, XSDModelResolver.class); - - processor = new WSDLDocumentProcessor(factories); - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java deleted file mode 100644 index 966ffc25e2..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.introspect; - -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; - -/** - * Test case for InterfaceWSDLIntrospectorImpl - */ -public class WSDLInterfaceIntrospectorTestCase extends AbstractWSDLTestCase { - private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType"); - - private PortType portType; - private WSDLDefinition definition; - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - - URL url = getClass().getResource("../xml/stockquote.wsdl"); - definition = processor.read(null, new URI("stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - } - - @SuppressWarnings("unchecked") - public final void testIntrospectPortType() throws InvalidInterfaceException { - WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver); - Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType"); - List<Operation> operations = contract.getOperations(); - Assert.assertEquals(1, operations.size()); - Operation operation = operations.get(0); - Assert.assertEquals("getLastTradePrice", operation.getName()); - DataType<List<DataType>> inputType = operation.getInputType(); - Assert.assertEquals(1, inputType.getLogical().size()); - DataType<XMLType> returnType = operation.getOutputType(); - Assert.assertNotNull(returnType); - Assert.assertEquals(0, operation.getFaultTypes().size()); - // Assert.assertEquals(1, - // operation.getWrapper().getInputChildElements().size()); - // Assert.assertEquals(1, - // operation.getWrapper().getOutputChildElements().size()); - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java deleted file mode 100644 index 7b41e0f7aa..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.introspect; - -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.Operation; -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLOperationIntrospectorImpl; - -/** - * Test case for WSDLOperation - */ -public class WSDLOperationIntrospectorTestCase extends AbstractWSDLTestCase { - private static final QName PORTTYPE_NAME = - new QName("http://example.com/stockquote.wsdl", "StockQuotePortType"); - - - @SuppressWarnings("unchecked") - public final void testWrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - Operation operation = portType.getOperation("getLastTradePrice", null, null); - - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - - DataType<List<DataType>> inputType = op.getInputType(); - Assert.assertEquals(1, inputType.getLogical().size()); - DataType<XMLType> type = inputType.getLogical().get(0); - Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), type.getLogical().getElementName()); - - DataType<XMLType> outputType = op.getOutputType(); - Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"), - outputType.getLogical().getElementName()); - Assert.assertTrue(op.isWrapperStyle()); - - DataType<List<DataType>> unwrappedInputType = op.getWrapper().getWrapperInfo().getUnwrappedInputType(); - List<DataType> childTypes = unwrappedInputType.getLogical(); - Assert.assertEquals(1, childTypes.size()); - DataType<XMLType> childType = childTypes.get(0); - Assert.assertEquals(new QName(null, "tickerSymbol"), childType.getLogical().getElementName()); - - childType = op.getWrapper().getWrapperInfo().getUnwrappedOutputType(); - Assert.assertEquals(new QName(null, "price"), childType.getLogical().getElementName()); - } - - public final void testUnwrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("unwrapped-stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - - Operation operation = portType.getOperation("getLastTradePrice1", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - Assert.assertEquals(1, op.getInputType().getLogical().size()); - - operation = portType.getOperation("getLastTradePrice2", null, null); - op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - Assert.assertEquals(2, op.getInputType().getLogical().size()); - } - - public final void testInvalidWSDL() throws Exception { - URL url = getClass().getResource("../xml/invalid-stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("invalid-stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - - Operation operation = portType.getOperation("getLastTradePrice", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - - try { - op.isWrapperStyle(); - fail("InvalidWSDLException should have been thrown"); - } catch (InvalidInterfaceException e) { - // Expected - } - - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java deleted file mode 100644 index a82a022088..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.introspect; - -import java.net.URI; -import java.net.URL; - -import javax.wsdl.Operation; -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLOperationIntrospectorImpl; - -/** - * Test case for WSDLOperation - */ -public class WrapperStyleOperationTestCase extends AbstractWSDLTestCase { - private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType"); - - public final void testWrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - Operation operation = portType.getOperation("getLastTradePrice", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertTrue(op.isWrapperStyle()); - Assert.assertEquals(1, op.getWrapper().getInputChildElements().size()); - Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size()); - } - - public final void testUnwrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("unwrapped-stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - Operation operation = portType.getOperation("getLastTradePrice1", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - operation = portType.getOperation("getLastTradePrice2", null, null); - op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java deleted file mode 100644 index 9834f3f3f2..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor; -import org.apache.tuscany.sca.assembly.xml.CompositeProcessor; -import org.apache.tuscany.sca.assembly.xml.ConstrainingTypeProcessor; -import org.apache.tuscany.sca.binding.sca.impl.SCABindingFactoryImpl; -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.policy.DefaultIntentAttachPointTypeFactory; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test reading WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class ReadTestCase extends TestCase { - - XMLInputFactory inputFactory; - DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - ExtensibleStAXArtifactProcessor staxProcessor; - private AssemblyFactory assemblyFactory; - private SCABindingFactory scaBindingFactory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - - @Override - public void setUp() throws Exception { - ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint(); - assemblyFactory = new DefaultAssemblyFactory(); - scaBindingFactory = new SCABindingFactoryImpl(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - - WSDLFactory wsdlFactory = new DefaultWSDLFactory(); - modelFactories.addFactory(wsdlFactory); - WSDLInterfaceProcessor wsdlProcessor = new WSDLInterfaceProcessor(modelFactories); - staxProcessors.addArtifactProcessor(wsdlProcessor); - } - - @Override - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - policyFactory = null; - assemblyFactory = null; - mapper = null; - } - - public void testReadComponentType() throws Exception { - ComponentTypeProcessor componentTypeProcessor = new ComponentTypeProcessor(assemblyFactory, policyFactory, staxProcessor); - InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - ComponentType componentType = componentTypeProcessor.read(reader); - assertNotNull(componentType); - - //new PrintUtil(System.out).print(componentType); - } - - public void testReadConstrainingType() throws Exception { - ConstrainingTypeProcessor constrainingTypeProcessor = new ConstrainingTypeProcessor(assemblyFactory, policyFactory, staxProcessor); - InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - ConstrainingType constrainingType = constrainingTypeProcessor.read(reader); - assertNotNull(constrainingType); - - //new PrintUtil(System.out).print(constrainingType); - } - - public void testReadComposite() throws Exception { - CompositeProcessor compositeProcessor = new CompositeProcessor(new ContributionFactoryImpl(), assemblyFactory, policyFactory, mapper, staxProcessor); - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - Composite composite = compositeProcessor.read(reader); - assertNotNull(composite); - - CompositeBuilderImpl compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, new DefaultIntentAttachPointTypeFactory(), mapper, null, null); - compositeUtil.build(composite); - - //new PrintUtil(System.out).print(composite); - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java deleted file mode 100644 index 5cad523218..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.Import; -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class WSDLDocumentProcessorTestCase extends AbstractWSDLTestCase { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - super.setUp(); - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - @Test - public void testWSDL() throws Exception { - - URL url = getClass().getResource("/wsdl/helloworld-service.wsdl"); - WSDLDefinition definition = processor.read(null, URI.create("wsdl/helloworld-service.wsdl"), url); - - Assert.assertNull(definition.getDefinition()); - Assert.assertEquals("http://helloworld", definition.getNamespace()); - URL url1 = getClass().getResource("/wsdl/helloworld-interface.wsdl"); - WSDLDefinition definition1 = processor.read(null, URI.create("wsdl/helloworld-interface.wsdl"), url1); - Assert.assertNull(definition1.getDefinition()); - Assert.assertEquals("http://helloworld", definition1.getNamespace()); - - resolver.addModel(definition); - resolver.addModel(definition1); - resolver.resolveModel(WSDLDefinition.class, definition); - resolver.resolveModel(WSDLDefinition.class, definition1); - WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, definition); - List imports = (List)definition.getDefinition().getImports().get("http://helloworld"); - Assert.assertNotNull(imports); - Assert.assertNotNull(((Import)imports.get(0)).getDefinition()); - Assert.assertNotNull(resolved.getDefinition().getPortType(new QName("http://helloworld", "HelloWorld"))); - Assert.assertNotNull(resolved.getDefinition().getService(new QName("http://helloworld", "HelloWorldService"))); - - assertNotNull(resolved.getXmlSchemaType(new QName("http://greeting", "Name"))); - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java deleted file mode 100644 index 3696c8f073..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; - -/** - * Test reading WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class WSDLTestCase extends TestCase { - - private DefaultURLArtifactProcessorExtensionPoint documentProcessors; - private ExtensibleURLArtifactProcessor documentProcessor; - private WSDLModelResolver wsdlResolver; - - @Override - public void setUp() throws Exception { - documentProcessors = new DefaultURLArtifactProcessorExtensionPoint(new DefaultModelFactoryExtensionPoint()); - documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors); - - WSDLFactory wsdlFactory = new DefaultWSDLFactory(); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(wsdlFactory); - javax.wsdl.factory.WSDLFactory wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance(); - factories.addFactory(wsdl4jFactory); - WSDLDocumentProcessor wsdlProcessor = new WSDLDocumentProcessor(factories); - documentProcessors.addArtifactProcessor(wsdlProcessor); - wsdlResolver = new WSDLModelResolver(null, factories); - } - - @Override - public void tearDown() throws Exception { - documentProcessors = null; - } - - public void testReadWSDLDocument() throws Exception { - URL url = getClass().getResource("example.wsdl"); - WSDLDefinition definition = documentProcessor.read(null, new URI("example.wsdl"), url, WSDLDefinition.class); - assertNotNull(definition); - assertNull(definition.getDefinition()); - assertEquals(definition.getNamespace(), "http://www.example.org"); - } - - public void testReadWSDLImports() throws Exception { - QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding"); - QName aPortType = new QName("http://helloworld", "HelloWorld"); - - URL url = getClass().getResource("test1.wsdl"); - WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, WSDLDefinition.class); - assertNotNull(test1Defn); - wsdlResolver.addModel(test1Defn); - test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn); - //binding is a part of test1.wsdl - assertNotNull(test1Defn.getDefinition().getBinding(aBinding)); - //porttype is part of test2.wsdl - assertNotNull(test1Defn.getDefinition().getPortType(aPortType)); - } - - public void testReadSameNamespaceWSDLDocument() throws Exception { - QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding"); - QName aPortType = new QName("http://helloworld", "HelloWorld"); - - URL url = getClass().getResource("test2.wsdl"); - WSDLDefinition test2Defn = documentProcessor.read(null, new URI("test2.wsdl"), url, WSDLDefinition.class); - assertNotNull(test2Defn); - wsdlResolver.addModel(test2Defn); - test2Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test2Defn); - - //bindigs are a part of test1.wsdl so should not be found - assertNull(test2Defn.getDefinition().getBinding(aBinding)); - assertNotNull(test2Defn.getDefinition().getPortType(aPortType)); - - url = getClass().getResource("test1.wsdl"); - WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, WSDLDefinition.class); - assertNotNull(test1Defn); - wsdlResolver.addModel(test1Defn); - - test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn); - - assertNotNull(test1Defn.getDefinition().getPortType(aPortType)); - assertNotNull(test1Defn.getDefinition().getBinding(aBinding)); - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java deleted file mode 100644 index 3a9468216f..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor; -import org.apache.tuscany.sca.assembly.xml.CompositeProcessor; -import org.apache.tuscany.sca.assembly.xml.ConstrainingTypeProcessor; -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test reading/write WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class WriteTestCase extends TestCase { - - XMLInputFactory inputFactory; - DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - private ExtensibleStAXArtifactProcessor staxProcessor; - private AssemblyFactory factory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - - @Override - public void setUp() throws Exception { - ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint(); - factory = new DefaultAssemblyFactory(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - - staxProcessors.addArtifactProcessor(new CompositeProcessor(new ContributionFactoryImpl(), factory, policyFactory, mapper, staxProcessor)); - staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(factory, policyFactory, staxProcessor)); - staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor)); - - WSDLFactory wsdlFactory = new DefaultWSDLFactory(); - modelFactories.addFactory(wsdlFactory); - WSDLInterfaceProcessor wsdlProcessor = new WSDLInterfaceProcessor(modelFactories); - staxProcessors.addArtifactProcessor(wsdlProcessor); - } - - @Override - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - policyFactory = null; - factory = null; - mapper = null; - } - - public void testReadWriteComponentType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType"); - ComponentType componentType = staxProcessor.read(is, ComponentType.class); - assertNotNull(componentType); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(componentType, bos); - } - - public void testReadWriteConstrainingType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType"); - ConstrainingType constrainingType = staxProcessor.read(is, ConstrainingType.class); - assertNotNull(constrainingType); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(constrainingType, bos); - } - - public void testReadWriteComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - Composite composite = staxProcessor.read(is, Composite.class); - assertNotNull(composite); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(composite, bos); - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java deleted file mode 100644 index e8fb4c6385..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URL; - -import junit.framework.Assert; - -import org.junit.Before; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class XMLDocumentHelperTestCase { - private URL wsdl; - private URL xsd; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - wsdl = getClass().getResource("/wsdl/helloworld-interface.wsdl"); - xsd = getClass().getResource("/xsd/greeting.xsd"); - } - - @Test - public void testReadTNS() throws Exception { - String tns = XMLDocumentHelper.readTargetNamespace(wsdl, XMLDocumentHelper.WSDL11, true, "targetNamespace"); - Assert.assertEquals("http://helloworld", tns); - String tns2 = XMLDocumentHelper.readTargetNamespace(xsd, XMLDocumentHelper.XSD, true, null); - Assert.assertEquals("http://greeting", tns2); - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java deleted file mode 100644 index 9d4ee87ece..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; - -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.XmlSchemaObjectCollection; -import org.apache.ws.commons.schema.XmlSchemaType; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class XSDDocumentProcessorTestCase { - private XSDDocumentProcessor processor; - private WSDLFactory wsdlFactory; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint(); - wsdlFactory = new DefaultWSDLFactory(); - modelFactories.addFactory(wsdlFactory); - processor = new XSDDocumentProcessor(modelFactories); - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - @Test - public void testXSD() throws Exception { - URL url = getClass().getResource("/xsd/greeting.xsd"); - XSDefinition definition = processor.read(null, URI.create("xsd/greeting.xsd"), url); - Assert.assertNull(definition.getSchema()); - Assert.assertEquals("http://greeting", definition.getNamespace()); - URL url1 = getClass().getResource("/xsd/name.xsd"); - XSDefinition definition1 = processor.read(null, URI.create("xsd/name.xsd"), url1); - Assert.assertNull(definition1.getSchema()); - Assert.assertEquals("http://greeting", definition1.getNamespace()); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(wsdlFactory); - XSDModelResolver resolver = new XSDModelResolver(null, factories); - resolver.addModel(definition); - XSDefinition resolved = resolver.resolveModel(XSDefinition.class, definition); - XmlSchemaObjectCollection collection = resolved.getSchema().getIncludes(); - Assert.assertTrue(collection.getCount() == 1); - XmlSchemaType type = - ((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name")); - Assert.assertNotNull(type); - resolver.addModel(definition1); - resolved = resolver.resolveModel(XSDefinition.class, definition); - collection = resolved.getSchema().getIncludes(); - Assert.assertTrue(collection.getCount() == 2); - XmlSchemaType type1 = - ((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name")); - XmlSchemaType type2 = - ((XmlSchemaInclude)collection.getItem(1)).getSchema().getTypeByName(new QName("http://greeting", "Name")); - Assert.assertTrue(type1 != null || type2 != null); - } - -} diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite deleted file mode 100644 index 875fdf35d2..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite +++ /dev/null @@ -1,55 +0,0 @@ -<?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. ---> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:calc="http://sample.calculator" - targetNamespace="http://calc" - xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance" - name="Calculator"> - - <service name="CalculatorService" promote="CalculatorServiceComponent"> - <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)" - wsdli:wsdlLocation="http://tempuri.org"/> - </service> - - <component name="CalculatorServiceComponent"> - <implementation.java class="calculator.CalculatorServiceImpl"/> - <reference name="addService" target="AddServiceComponent"/> - <reference name="subtractService" target="SubtractServiceComponent"/> - <reference name="multiplyService" target="MultiplyServiceComponent"/> - <reference name="divideService" target="DivideServiceComponent"/> - </component> - - <component name="AddServiceComponent"> - <implementation.java class="calculator.AddServiceImpl"/> - </component> - - <component name="SubtractServiceComponent"> - <implementation.java class="calculator.SubtractServiceImpl"/> - </component> - - <component name="MultiplyServiceComponent"> - <implementation.java class="calculator.MultiplyServiceImpl"/> - </component> - - <component name="DivideServiceComponent"> - <implementation.java class="calculator.DivideServiceImpl"/> - </component> - -</composite> diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType deleted file mode 100644 index 3eb81b61bd..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<!-- - * 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. ---> -<constrainingType xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:calc="http://calc" - targetNamespace="http://calc" - xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance" - name="CalculatorComponent"> - - <service name="CalculatorService"> - <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)" - wsdli:wsdlLocation="http://tempuri.org"/> - </service> - - <reference name="divideService"> - <interface.wsdl interface="http://sample/calculator#wsdl.interface(Divide)"/> - </reference> - -</constrainingType> -
\ No newline at end of file diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType deleted file mode 100644 index aea7046a3d..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?> -<!-- - * 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. ---> -<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"> - - <service name="CalculatorService"> - <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)" - wsdli:wsdlLocation="http://tempuri.org"/> - </service> - - <reference name="divideService"> - <interface.wsdl interface="http://sample/calculator#wsdl.interface(Divide)"/> - </reference> - -</componentType> -
\ No newline at end of file diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl deleted file mode 100644 index 5e8e5dad0d..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl +++ /dev/null @@ -1,26 +0,0 @@ -<?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 targetNamespace="http://www.example.org" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - name="example"> - - <wsdl:portType name="HelloWorld"> - </wsdl:portType> -</wsdl:definitions> diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl deleted file mode 100644 index ad81fc7867..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0"?> -<!-- - * 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. ---> -<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl" - xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd" - xmlns="http://schemas.xmlsoap.org/wsdl/"> - - <types> - <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema"> - <element name="getLastTradePrice1"> - <complexType> - <sequence> - <element name="tickerSymbol" type="string" /> - </sequence> - </complexType> - </element> - <element name="getLastTradePriceResponse"> - <complexType> - <sequence> - <element name="price" type="float" /> - </sequence> - </complexType> - </element> - </schema> - </types> - - <message name="GetLastTradePriceInput"> - <part name="body" element="xsd1:getLastTradePrice" /> - </message> - - <message name="GetLastTradePriceOutput"> - <part name="body" element="xsd1:getLastTradePriceResponse" /> - </message> - - <portType name="StockQuotePortType"> - <operation name="getLastTradePrice"> - <input message="tns:GetLastTradePriceInput" /> - <output message="tns:GetLastTradePriceOutput" /> - </operation> - </portType> - -</definitions>
\ No newline at end of file diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd deleted file mode 100644 index 241ec15d36..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd +++ /dev/null @@ -1,136 +0,0 @@ -<!-- - * 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. ---> -<schema targetNamespace="http://www.example.com/IPO" - xmlns="http://www.w3.org/2001/XMLSchema" - xmlns:ipo="http://www.example.com/IPO"> - - <annotation> - <documentation xml:lang="en"> - International Purchase order schema for Example.com - Copyright 2000 Example.com. All rights reserved. - </documentation> - </annotation> - - - <element name="purchaseOrder" type="ipo:PurchaseOrderType" /> - - <element name="comment" type="string" /> - - <complexType name="PurchaseOrderType"> - <sequence> - <element name="shipTo" type="ipo:Address" /> - <element name="billTo" type="ipo:Address" /> - <element ref="ipo:comment" minOccurs="0" /> - <element name="items" type="ipo:Items" /> - </sequence> - <attribute name="orderDate" type="date" /> - </complexType> - - <complexType name="Items"> - <sequence> - <element name="item" minOccurs="0" maxOccurs="unbounded"> - <complexType> - <sequence> - <element name="productName" type="string" /> - <element name="quantity"> - <simpleType> - <restriction base="positiveInteger"> - <maxExclusive value="100" /> - </restriction> - </simpleType> - </element> - <element name="USPrice" type="decimal" /> - <element ref="ipo:comment" minOccurs="0" /> - <element name="shipDate" type="date" - minOccurs="0" /> - </sequence> - <attribute name="partNum" type="ipo:SKU" - use="required" /> - </complexType> - </element> - </sequence> - </complexType> - - <simpleType name="SKU"> - <restriction base="string"> - <pattern value="\d{3}-[A-Z]{2}" /> - </restriction> - </simpleType> - - <complexType name="Address"> - <sequence> - <element name="name" type="string" /> - <element name="street" type="string" /> - <element name="city" type="string" /> - </sequence> - </complexType> - - <complexType name="USAddress"> - <complexContent> - <extension base="ipo:Address"> - <sequence> - <element name="state" type="ipo:USState" /> - <element name="zip" type="positiveInteger" /> - </sequence> - </extension> - </complexContent> - </complexType> - - <complexType name="UKAddress"> - <complexContent> - <extension base="ipo:Address"> - <sequence> - <element name="postcode" type="ipo:UKPostcode" /> - </sequence> - <attribute name="exportCode" type="positiveInteger" - fixed="1" /> - </extension> - </complexContent> - </complexType> - - <!-- other Address derivations for more countries --> - - <simpleType name="USState"> - <restriction base="string"> - <enumeration value="AK" /> - <enumeration value="AL" /> - <enumeration value="AR" /> - <enumeration value="CA" /> - <enumeration value="PA" /> - <!-- and so on ... --> - </restriction> - </simpleType> - - <simpleType name="Postcode"> - <restriction base="string"> - <length value="7" fixed="true" /> - </restriction> - </simpleType> - - - <simpleType name="UKPostcode"> - <restriction base="ipo:Postcode"> - <pattern value="[A-Z]{2}\d\s\d[A-Z]{2}" /> - </restriction> - </simpleType> - - - -</schema> - diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl deleted file mode 100644 index 39cd5547d9..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0"?> -<!-- - * 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. ---> -<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl" - xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd" - xmlns="http://schemas.xmlsoap.org/wsdl/"> - - <types> - <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema"> - <element name="getLastTradePrice"> - <complexType> - <sequence> - <element name="tickerSymbol" type="string" /> - </sequence> - </complexType> - </element> - <element name="getLastTradePriceResponse"> - <complexType> - <sequence> - <element name="price" type="float" /> - </sequence> - </complexType> - </element> - </schema> - </types> - - <message name="GetLastTradePriceInput"> - <part name="body" element="xsd1:getLastTradePrice" /> - </message> - - <message name="GetLastTradePriceOutput"> - <part name="body" element="xsd1:getLastTradePriceResponse" /> - </message> - - <portType name="StockQuotePortType"> - <operation name="getLastTradePrice"> - <input message="tns:GetLastTradePriceInput" /> - <output message="tns:GetLastTradePriceOutput" /> - </operation> - </portType> - -</definitions>
\ No newline at end of file diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl deleted file mode 100644 index 8e26f7b4b5..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl +++ /dev/null @@ -1,45 +0,0 @@ -<?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 targetNamespace="http://helloworld" xmlns:tns="http://helloworld" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld"> - - <wsdl:import location="test2.wsdl" namespace="http://helloworld"></wsdl:import> - - <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld"> - <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> - <wsdl:operation name="getGreetings"> - <wsdlsoap:operation soapAction="" /> - <wsdl:input name="getGreetingsRequest"> - <wsdlsoap:body use="literal" /> - </wsdl:input> - <wsdl:output name="getGreetingsResponse"> - <wsdlsoap:body use="literal" /> - </wsdl:output> - </wsdl:operation> - </wsdl:binding> - - <wsdl:service name="HelloWorldService"> - <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort"> - <wsdlsoap:address location="http://localhost:8085/sample-helloworldws-1.0-SNAPSHOT/services/HelloWorldWebService" /> - </wsdl:port> - </wsdl:service> - -</wsdl:definitions> diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd deleted file mode 100644 index c2210f4a94..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd +++ /dev/null @@ -1,33 +0,0 @@ -<!-- - * 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. ---> -<schema targetNamespace="http://www.example.com/Customer" xmlns="http://www.w3.org/2001/XMLSchema" - xmlns:ipo="http://www.example.com/IPO" xmlns:tns="http://www.example.com/Customer"> - <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd" /> - - <complexType name="Customer"> - <sequence> - <element name="customerID" type="string"></element> - <element name="name" type="string"></element> - <element name="order" type="ipo:PurchaseOrderType" /> - </sequence> - </complexType> - <element name="customer" type="tns:Customer"></element> - -</schema> - diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl deleted file mode 100644 index 529b395fd5..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl +++ /dev/null @@ -1,63 +0,0 @@ -<?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 targetNamespace="http://helloworld" xmlns:tns="http://helloworld" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld"> - - <wsdl:types> - <schema elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema"> - - <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd" /> - - <element name="getGreetings"> - <complexType> - <sequence> - <element name="name" type="xsd:string" /> - </sequence> - </complexType> - </element> - - <element name="getGreetingsResponse"> - <complexType> - <sequence> - <element name="getGreetingsReturn" type="xsd:string" /> - </sequence> - </complexType> - </element> - - </schema> - </wsdl:types> - - <wsdl:message name="getGreetingsRequest"> - <wsdl:part element="tns:getGreetings" name="parameters" /> - </wsdl:message> - - <wsdl:message name="getGreetingsResponse"> - <wsdl:part element="tns:getGreetingsResponse" name="parameters" /> - </wsdl:message> - - <wsdl:portType name="HelloWorld"> - <wsdl:operation name="getGreetings"> - <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest" /> - <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse" /> - </wsdl:operation> - </wsdl:portType> - -</wsdl:definitions> diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl deleted file mode 100644 index 666a7e4069..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0"?> -<!-- - * 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. ---> -<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl" - xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns="http://schemas.xmlsoap.org/wsdl/"> - - <types> - <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema"> - <element name="getLastTradePrice"> - <complexType> - <sequence> - <element name="tickerSymbol" type="string" /> - </sequence> - </complexType> - </element> - <element name="getLastTradePriceResponse"> - <complexType> - <sequence> - <element name="price" type="float" /> - </sequence> - </complexType> - </element> - </schema> - </types> - - <message name="GetLastTradePriceInput1"> - <part name="body" element="xsd1:getLastTradePrice" /> - </message> - - <message name="GetLastTradePriceOutput1"> - <part name="body" element="xsd1:getLastTradePriceResponse" /> - </message> - - <message name="GetLastTradePriceInput2"> - <part name="body" element="xsd1:getLastTradePrice" /> - <part name="other" type="xsd:string"/> - </message> - - <message name="GetLastTradePriceOutput2"> - <part name="body" element="xsd1:getLastTradePriceResponse" /> - </message> - - <portType name="StockQuotePortType"> - <operation name="getLastTradePrice"> - <input message="tns:GetLastTradePriceInput1" /> - <output message="tns:GetLastTradePriceOutput1" /> - </operation> - <operation name="getLastTradePrice1"> - <input message="tns:GetLastTradePriceInput1" /> - <output message="tns:GetLastTradePriceOutput1" /> - </operation> - <operation name="getLastTradePrice2"> - <input message="tns:GetLastTradePriceInput2" /> - <output message="tns:GetLastTradePriceOutput2" /> - </operation> - </portType> - -</definitions>
\ No newline at end of file diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl deleted file mode 100644 index b0b6644e7f..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl +++ /dev/null @@ -1,67 +0,0 @@ -<?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 targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://helloworld"
- xmlns="http://www.w3.org/2001/XMLSchema" xmlns:g="http://greeting">
-
- <!--
- <import namespace="http://greeting" schemaLocation="../xsd/greeting.xsd" />
- -->
- <include schemaLocation="../xsd/helloworld.xsd" />
-
- <element name="getGreetings">
- <complexType>
- <sequence>
- <element name="name" type="g:Name" />
- </sequence>
- </complexType>
- </element>
-
- <element name="getGreetingsResponse">
- <complexType>
- <sequence>
- <element name="getGreetingsReturn" type="g:Greeting" />
- </sequence>
- </complexType>
- </element>
-
- </schema>
- </wsdl:types>
-
- <wsdl:message name="getGreetingsRequest">
- <wsdl:part element="tns:getGreetings" name="parameters" />
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
- <wsdl:part element="tns:getGreetingsResponse" name="parameters" />
- </wsdl:message>
-
- <wsdl:portType name="HelloWorld">
- <wsdl:operation name="getGreetings">
- <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest" />
- <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse" />
- </wsdl:operation>
- </wsdl:portType>
-
-</wsdl:definitions>
diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl deleted file mode 100644 index 0a7979e308..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl +++ /dev/null @@ -1,49 +0,0 @@ -<?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 targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
-
- <wsdl:import location="helloworld-interface.wsdl" namespace="http://helloworld"></wsdl:import>
- <!--
- <wsdl:import namespace="http://helloworld"></wsdl:import>
- -->
-
- <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getGreetings">
- <wsdlsoap:operation soapAction="" />
- <wsdl:input name="getGreetingsRequest">
- <wsdlsoap:body use="literal" />
- </wsdl:input>
- <wsdl:output name="getGreetingsResponse">
- <wsdlsoap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloWorldService">
- <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
- <wsdlsoap:address
- location="http://localhost:8085/sample-helloworldws-1.0-SNAPSHOT/services/HelloWorldWebService" />
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd deleted file mode 100644 index 635ca25bfc..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd +++ /dev/null @@ -1,29 +0,0 @@ -<?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. ---> -<schema targetNamespace="http://greeting" xmlns="http://www.w3.org/2001/XMLSchema"> - <include schemaLocation="name.xsd" /> - <complexType name="Greeting"> - <sequence> - <element name="message" type="string" /> - <element name="name" type="Name" /> - </sequence> - </complexType> - -</schema>
\ No newline at end of file diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd deleted file mode 100644 index bb0c9bc7b7..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd +++ /dev/null @@ -1,22 +0,0 @@ -<?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. ---> -<schema targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema"> - <import namespace="http://greeting" schemaLocation="greeting.xsd" /> -</schema>
\ No newline at end of file diff --git a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd b/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd deleted file mode 100644 index 300de931ec..0000000000 --- a/branches/sca-java-1.0.1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd +++ /dev/null @@ -1,29 +0,0 @@ -<?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. ---> -<schema targetNamespace="http://greeting" xmlns="http://www.w3.org/2001/XMLSchema"> - - <complexType name="Name"> - <sequence> - <element name="firstName" type="string" /> - <element name="lastName" type="string" /> - </sequence> - </complexType> - -</schema>
\ No newline at end of file |