You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yoko-commits@incubator.apache.org by en...@apache.org on 2007/05/03 11:11:58 UTC
svn commit: r534794 - in /incubator/yoko/trunk/tools/src:
main/java/org/apache/yoko/tools/ main/java/org/apache/yoko/tools/common/
main/java/org/apache/yoko/tools/processors/idl/
test/java/org/apache/yoko/tools/processors/ test/resources/idl/
Author: enolan
Date: Thu May 3 04:11:57 2007
New Revision: 534794
URL: http://svn.apache.org/viewvc?view=rev&rev=534794
Log:
Yoko-430 - Updates needed.
Added:
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactory.java (with props)
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactoryImpl.java (with props)
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaWriterImpl.java (with props)
incubator/yoko/trunk/tools/src/test/resources/idl/expected_Schema.xsd (with props)
incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLPT.xsd (with props)
incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLT.xsd (with props)
incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaPT.xsd (with props)
Removed:
incubator/yoko/trunk/tools/src/test/resources/idl/expected_Schema.wsdl
incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLPT.wsdl
incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLT.wsdl
incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaPT.wsdl
Modified:
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLCorbaWriterImpl.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java
incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
incubator/yoko/trunk/tools/src/test/resources/idl/expected_LogicalLPT.wsdl
incubator/yoko/trunk/tools/src/test/resources/idl/expected_LogicalLT.wsdl
incubator/yoko/trunk/tools/src/test/resources/idl/expected_OptionsSchema.wsdl
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java?view=diff&rev=534794&r1=534793&r2=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java Thu May 3 04:11:57 2007
@@ -128,6 +128,14 @@
env.put(ToolCorbaConstants.CFG_SCHEMA,
doc.getParameter(ToolCorbaConstants.CFG_SCHEMA));
}
+ if (env.optionSet(ToolCorbaConstants.CFG_WSDL_ENCODING)) {
+ env.put(ToolCorbaConstants.CFG_WSDL_ENCODING,
+ doc.getParameter(ToolCorbaConstants.CFG_WSDL_ENCODING));
+ }
+ if (env.optionSet(ToolCorbaConstants.CFG_IMPORTSCHEMA)) {
+ env.put(ToolCorbaConstants.CFG_IMPORTSCHEMA,
+ doc.getParameter(ToolCorbaConstants.CFG_IMPORTSCHEMA));
+ }
//need to add all the other options
}
Added: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactory.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactory.java?view=auto&rev=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactory.java (added)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactory.java Thu May 3 04:11:57 2007
@@ -0,0 +1,163 @@
+/**
+ * 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.yoko.tools.common;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.ExtensionRegistry;
+import javax.wsdl.xml.WSDLWriter;
+
+public abstract class SchemaFactory {
+ private static final String PROPERTY_NAME = "javax.wsdl.factory.SchemaFactory";
+ private static final String PROPERTY_FILE_NAME = "wsdl.properties";
+ private static final String DEFAULT_FACTORY_IMPL_NAME =
+ "org.apache.yoko.tools.processors.wsdl.SchemaFactoryImpl";
+
+ private static String fullPropertyFileName;
+
+ /**
+ * Get a new instance of a WSDLFactory. This method
+ * follows (almost) the same basic sequence of steps that JAXP
+ * follows to determine the fully-qualified class name of the
+ * class which implements WSDLFactory. The steps (in order)
+ * are:
+ *<pre>
+ * Check the javax.wsdl.factory.WSDLFactory system property.
+ * Check the lib/wsdl.properties file in the JRE directory. The key
+ * will have the same name as the above system property.
+ * Use the default value.
+ *</pre>
+ * Once an instance of a WSDLFactory is obtained, invoke
+ * newDefinition(), newWSDLReader(), or newWSDLWriter(), to create
+ * the desired instances.
+ */
+ public static SchemaFactory newInstance() throws WSDLException {
+ String factoryImplName = findFactoryImplName();
+
+ return newInstance(factoryImplName);
+ }
+
+ /**
+ * Get a new instance of a WSDLFactory. This method
+ * returns an instance of the class factoryImplName.
+ * Once an instance of a WSDLFactory is obtained, invoke
+ * newDefinition(), newWSDLReader(), or newWSDLWriter(), to create
+ * the desired instances.
+ *
+ * @param factoryImplName the fully-qualified class name of the
+ * class which provides a concrete implementation of the abstract
+ * class WSDLFactory.
+ */
+ public static SchemaFactory newInstance(String factoryImplName) throws WSDLException {
+ if (factoryImplName != null) {
+ try {
+ // get the appropriate class for the loading.
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class cl = loader.loadClass(factoryImplName);
+
+ return (SchemaFactory)cl.newInstance();
+ } catch (Exception e) {
+ /*
+ Catches:
+ ClassNotFoundException
+ InstantiationException
+ IllegalAccessException
+ */
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "Problem instantiating factory "
+ + "implementation.", e);
+ }
+ } else {
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "Unable to find name of factory "
+ + "implementation.");
+ }
+ }
+
+ /**
+ * Create a new instance of a WSDLWriter.
+ */
+ public abstract WSDLWriter newWSDLWriter();
+
+ /**
+ * Create a new instance of an ExtensionRegistry with pre-registered
+ * serializers/deserializers for the SOAP, HTTP and MIME
+ * extensions. Java extensionTypes are also mapped for all
+ * the SOAP, HTTP and MIME extensions.
+ */
+ public abstract ExtensionRegistry newPopulatedExtensionRegistry();
+
+ private static String findFactoryImplName() {
+ String factoryImplName = null;
+
+ // First, check the system property.
+ try {
+ factoryImplName = System.getProperty(PROPERTY_NAME);
+
+ if (factoryImplName != null) {
+ return factoryImplName;
+ }
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ }
+
+ // Second, check the properties file.
+ String propFileName = getFullPropertyFileName();
+
+ if (propFileName != null) {
+ try {
+ Properties properties = new Properties();
+ File propFile = new File(propFileName);
+ FileInputStream fis = new FileInputStream(propFile);
+
+ properties.load(fis);
+ fis.close();
+
+ factoryImplName = properties.getProperty(PROPERTY_NAME);
+
+ if (factoryImplName != null) {
+ return factoryImplName;
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // Third, return the default.
+ return DEFAULT_FACTORY_IMPL_NAME;
+ }
+
+ private static String getFullPropertyFileName() {
+ if (fullPropertyFileName == null) {
+ try {
+ String javaHome = System.getProperty("java.home");
+
+ fullPropertyFileName = javaHome + File.separator + "lib" + File.separator
+ + PROPERTY_FILE_NAME;
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ }
+ }
+
+ return fullPropertyFileName;
+ }
+}
Propchange: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactoryImpl.java?view=auto&rev=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactoryImpl.java (added)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactoryImpl.java Thu May 3 04:11:57 2007
@@ -0,0 +1,66 @@
+/**
+ * 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.yoko.tools.common;
+
+import javax.wsdl.Definition;
+import javax.wsdl.extensions.ExtensionRegistry;
+import javax.wsdl.xml.WSDLWriter;
+
+import com.ibm.wsdl.DefinitionImpl;
+import com.ibm.wsdl.extensions.PopulatedExtensionRegistry;
+
+
+/**
+ * This class is a copy of the WSDLFactoryImpl from the wsdl4j implementation
+ * It overwrites the newWSDLWriter method to return a SchemaWriter
+ */
+public class SchemaFactoryImpl extends SchemaFactory {
+ /**
+ * Create a new instance of a Definition, with an instance of a
+ * PopulatedExtensionRegistry as its ExtensionRegistry.
+ *
+ * @see com.ibm.wsdl.extensions.PopulatedExtensionRegistry
+ */
+ public Definition newDefinition() {
+ Definition def = new DefinitionImpl();
+ ExtensionRegistry extReg = newPopulatedExtensionRegistry();
+
+ def.setExtensionRegistry(extReg);
+
+ return def;
+ }
+
+ /**
+ * Create a new instance of a SchemaWriter.
+ */
+ public WSDLWriter newWSDLWriter() {
+ return new SchemaWriterImpl();
+ }
+
+ /**
+ * Create a new instance of an ExtensionRegistry with pre-registered
+ * serializers/deserializers for the SOAP, HTTP and MIME extensions. Java
+ * extensionTypes are also mapped for all the SOAP, HTTP and MIME
+ * extensions.
+ */
+ public ExtensionRegistry newPopulatedExtensionRegistry() {
+ return new PopulatedExtensionRegistry();
+ }
+}
Propchange: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactoryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaFactoryImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaWriterImpl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaWriterImpl.java?view=auto&rev=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaWriterImpl.java (added)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaWriterImpl.java Thu May 3 04:11:57 2007
@@ -0,0 +1,153 @@
+/**
+ * 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.yoko.tools.common;
+
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Types;
+import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.schema.Schema;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import com.ibm.wsdl.Constants;
+import com.ibm.wsdl.util.xml.DOM2Writer;
+import com.ibm.wsdl.xml.WSDLWriterImpl;
+
+
+ /*
+ * This class is extending the wsdl4j RI class to print out the
+ * extensibility elements of the schema into a separate file.
+ *
+ */
+public class SchemaWriterImpl extends WSDLWriterImpl {
+
+ public static final int DEFAULT_INDENT_LEVEL = 0;
+
+
+ /**
+ * Write the specified schema of the WSDL definition
+ * to the specified Writer.
+ *
+ * @param wsdlDef contains the schema to be written.
+ * @param sink the Writer to write the xml to.
+ */
+ public void writeWSDL(Definition wsdlDef, Writer sink) throws WSDLException {
+ PrintWriter pw = new PrintWriter(sink);
+ String javaEncoding = (sink instanceof OutputStreamWriter)
+ ? ((OutputStreamWriter)sink).getEncoding() : null;
+
+ String xmlEncoding = DOM2Writer.java2XMLEncoding(javaEncoding);
+
+ if (xmlEncoding == null) {
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+ "Unsupported Java encoding for writing " + "schema file: '" + javaEncoding
+ + "'.");
+ }
+
+ pw.println(Constants.XML_DECL_START + xmlEncoding + Constants.XML_DECL_END);
+
+ printSchema(wsdlDef, pw);
+ }
+
+
+ protected void printSchema(Definition def, PrintWriter pw) throws WSDLException {
+ if (def == null) {
+ return;
+ }
+
+ Types types = def.getTypes();
+ if (types != null) {
+ List extElements = types.getExtensibilityElements();
+ printExtensibilityElements(Types.class, extElements, def, pw);
+ }
+
+ pw.flush();
+ }
+
+
+ public void printExtensibilityElements(Class class1,
+ List list,
+ Definition def,
+ PrintWriter pw)
+ throws WSDLException {
+ if (list != null) {
+ Iterator it = list.iterator();
+ while (it.hasNext()) {
+ ExtensibilityElement extElement = (ExtensibilityElement) it.next();
+ if (extElement instanceof Schema) {
+ printDOMElement(((Schema) extElement).getElement(),
+ pw,
+ DEFAULT_INDENT_LEVEL);
+ pw.println();
+ } else {
+ super.printExtensibilityElements(class1, list, def, pw);
+ }
+ }
+ }
+ }
+
+ private void printDOMElement(Element element, PrintWriter pw, int indentCount) {
+ indent(pw, indentCount);
+ if (element.getLocalName().equals("schema")) {
+ pw.print("<" + element.getLocalName());
+ } else {
+ pw.print("<" + element.getNodeName());
+ }
+ NamedNodeMap attrs = element.getAttributes();
+ for (int i = 0; i < attrs.getLength(); i++) {
+ Attr attr = (Attr) attrs.item(i);
+ pw.print(" " + attr.getName() + "=\"" + attr.getValue() + "\"");
+ }
+ pw.print(">");
+ NodeList list = element.getChildNodes();
+ pw.println();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ printDOMElement((Element) node, pw, indentCount + 2);
+ pw.println();
+ }
+ }
+ indent(pw, indentCount);
+ if (element.getLocalName().equals("schema")) {
+ pw.print("</" + element.getLocalName() + ">");
+ } else {
+ pw.print("</" + element.getNodeName() + ">");
+ }
+ }
+
+ public void indent(PrintWriter pw, int count) {
+ for (int i = 0; i < count; i++) {
+ pw.print(' ');
+ }
+ }
+
+}
Propchange: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaWriterImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/SchemaWriterImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLCorbaWriterImpl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLCorbaWriterImpl.java?view=diff&rev=534794&r1=534793&r2=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLCorbaWriterImpl.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLCorbaWriterImpl.java Thu May 3 04:11:57 2007
@@ -19,7 +19,9 @@
package org.apache.yoko.tools.common;
+import java.io.OutputStreamWriter;
import java.io.PrintWriter;
+import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -37,6 +39,7 @@
import org.w3c.dom.NodeList;
import com.ibm.wsdl.Constants;
+import com.ibm.wsdl.util.xml.DOM2Writer;
import com.ibm.wsdl.util.xml.DOMUtils;
import com.ibm.wsdl.xml.WSDLWriterImpl;
@@ -49,6 +52,31 @@
public static final int DEFAULT_INDENT_LEVEL = 2;
+
+ /**
+ * Write the specified WSDL definition to the specified Writer.
+ *
+ * @param wsdlDef the WSDL definition to be written.
+ * @param sink the Writer to write the xml to.
+ */
+ public void writeWSDL(Definition wsdlDef, Writer sink) throws WSDLException {
+ PrintWriter pw = new PrintWriter(sink);
+ String javaEncoding = (sink instanceof OutputStreamWriter)
+ ? ((OutputStreamWriter)sink).getEncoding() : null;
+
+ String xmlEncoding = DOM2Writer.java2XMLEncoding(javaEncoding);
+
+ if (xmlEncoding == null) {
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+ "Unsupported Java encoding for writing " + "wsdl file: '" + javaEncoding
+ + "'.");
+ }
+
+ pw.println(Constants.XML_DECL_START + xmlEncoding + Constants.XML_DECL_END);
+
+ printDefinition(wsdlDef, pw);
+ }
+
protected void printDefinition(Definition def, PrintWriter pw) throws WSDLException {
if (def == null) {
@@ -99,12 +127,12 @@
pw.println("</" + tagName + '>');
- pw.flush();
+ pw.flush();
}
- protected void printExtensibilityElements(Class class1,
+ public void printExtensibilityElements(Class class1,
List list,
Definition def,
PrintWriter pw)
@@ -152,6 +180,6 @@
for (int i = 0; i < count; i++) {
pw.print(' ');
}
- }
+ }
}
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java?view=diff&rev=534794&r1=534793&r2=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java Thu May 3 04:11:57 2007
@@ -53,6 +53,14 @@
outputWriter.close();
}
+
+ public static void writeSchema(Definition def, Writer outputWriter) throws WSDLException, IOException {
+ SchemaFactory sfactory = SchemaFactory
+ .newInstance("org.apache.yoko.tools.common.SchemaFactoryImpl");
+ WSDLWriter swriter = sfactory.newWSDLWriter();
+ swriter.writeWSDL(def, outputWriter);
-
+ outputWriter.flush();
+ outputWriter.close();
+ }
}
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java?view=diff&rev=534794&r1=534793&r2=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java Thu May 3 04:11:57 2007
@@ -54,11 +54,12 @@
protected ToolContext toolContext;
private String idl;
private String schemaFilename;
+ private String importSchemaFilename;
private String logical;
private String physical;
private ProcessorEnvironment env;
private Writer outputWriter;
- private Writer schemaOutputWriter;
+ private Writer schemaOutputWriter;
private Writer logicalOutputWriter;
private Writer physicalOutputWriter;
@@ -77,6 +78,11 @@
// deal with writing schema types to a specified file
schemaFilename = getBaseFilename(env.get(ToolCorbaConstants.CFG_SCHEMA).toString());
}
+ if (env.optionSet(ToolCorbaConstants.CFG_IMPORTSCHEMA)) {
+ // deal with writing schema types to a specified file
+ importSchemaFilename = getBaseFilename(env.get(ToolCorbaConstants.CFG_IMPORTSCHEMA).toString());
+ }
+
try {
parseIDL();
} catch (Exception e) {
@@ -159,7 +165,12 @@
visitor.visit(idlTree);
if (outputWriter == null) {
FileWriterUtil fw = new FileWriterUtil(outputDir);
+ /*if (env.optionSet(ToolCorbaConstants.CFG_WSDL_ENCODING)) {
+ String encoding = env.get(ToolCorbaConstants.CFG_WSDL_ENCODING).toString();
+ outputWriter = fw.getWriter("", idl + ".wsdl", encoding);
+ } else {*/
outputWriter = fw.getWriter("", idl + ".wsdl");
+ //}
}
Definition def = visitor.getDefinition();
Binding[] bindings = visitor.getCorbaBindings();
@@ -173,30 +184,50 @@
private void writeDefinitions(WSDLASTVisitor visitor, String outputDir)
throws Exception {
-
+
if (env.optionSet(ToolCorbaConstants.CFG_LOGICAL)
|| env.optionSet(ToolCorbaConstants.CFG_PHYSICAL)
- || env.optionSet(ToolCorbaConstants.CFG_SCHEMA)) {
+ || env.optionSet(ToolCorbaConstants.CFG_SCHEMA)
+ || env.optionSet(ToolCorbaConstants.CFG_IMPORTSCHEMA)) {
if (logical != null) {
if (logicalOutputWriter == null) {
- FileWriterUtil fw = new FileWriterUtil(outputDir);
+ FileWriterUtil fw = new FileWriterUtil(outputDir);
+ /*if (env.optionSet(ToolCorbaConstants.CFG_WSDL_ENCODING)) {
+ String encoding = env.get(ToolCorbaConstants.CFG_WSDL_ENCODING).toString();
+ logicalOutputWriter = fw.getWriter("", logical, encoding);
+ } else {*/
logicalOutputWriter = fw.getWriter("", logical);
+ //}
}
}
if (physical != null) {
if (physicalOutputWriter == null) {
FileWriterUtil fw = new FileWriterUtil(outputDir);
+ /*if (env.optionSet(ToolCorbaConstants.CFG_WSDL_ENCODING)) {
+ String encoding = env.get(ToolCorbaConstants.CFG_WSDL_ENCODING).toString();
+ physicalOutputWriter = fw.getWriter("", physical, encoding);
+ } else {*/
physicalOutputWriter = fw.getWriter("", physical);
+ //}
}
}
if (schemaFilename != null) {
if (schemaOutputWriter == null) {
FileWriterUtil fw = new FileWriterUtil(outputDir);
+ /*if (env.optionSet(ToolCorbaConstants.CFG_WSDL_ENCODING)) {
+ String encoding = env.get(ToolCorbaConstants.CFG_WSDL_ENCODING).toString();
+ schemaOutputWriter = fw.getWriter("", schemaFilename, encoding);
+ } else {*/
schemaOutputWriter = fw.getWriter("", schemaFilename);
+ //}
}
}
- visitor.setIdlFile(idl + ".wsdl");
+ if (importSchemaFilename != null) {
+ visitor.setImportSchema(importSchemaFilename);
+ }
+
+ visitor.setIdlFile(idl + ".wsdl");
visitor.writeDefinitions(outputWriter, schemaOutputWriter,
logicalOutputWriter, physicalOutputWriter,
schemaFilename, logical, physical);
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java?view=diff&rev=534794&r1=534793&r2=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java Thu May 3 04:11:57 2007
@@ -80,7 +80,8 @@
private XmlSchemaType sequenceOctetType;
private boolean boundedStringOverride;
- private String idlFile;
+ private String idlFile;
+ private String importSchemaFilename;
public WSDLASTVisitor(String tns, String schemans, String corbatypemaptns)
throws WSDLException, JAXBException {
@@ -123,7 +124,7 @@
throw new RuntimeException(ex);
}
}
-
+
public void setIdlFile(String idl) {
idlFile = idl;
}
@@ -160,6 +161,14 @@
return sequenceOctetType;
}
+ public void setImportSchema(String filename) {
+ importSchemaFilename = filename;
+ }
+
+ public String getImportSchemaFilename() {
+ return importSchemaFilename;
+ }
+
public void setSequenceOctetType(String type) throws Exception {
XmlSchemaType stype = null;
if (type.equals(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE_BASE64BINARY)) {
@@ -199,7 +208,7 @@
return (Binding[]) result.toArray(new Binding[result.size()]);
}
- public boolean writeDefinition(Writer writer) throws Exception {
+ public boolean writeDefinition(Writer writer) throws Exception {
WSDLUtils.writeWSDL(definition, writer);
return true;
}
@@ -209,6 +218,11 @@
return true;
}
+ public boolean writeSchemaDefinition(Definition def, Writer writer) throws Exception {
+ WSDLUtils.writeSchema(def, writer);
+ return true;
+ }
+
public boolean writeDefinitions(Writer writer, Writer schemaWriter,
Writer logicalWriter, Writer physicalWriter,
String schemaFilename, String logicalFile,
@@ -216,8 +230,9 @@
Definition logicalDef = getLogicalDefinition(schemaFilename, schemaWriter);
Definition physicalDef = null;
- if (schemaFilename != null && logicalFile == null
- && physicalFile == null) {
+ // schema only
+ if ((schemaFilename != null || importSchemaFilename != null)
+ && (logicalFile == null && physicalFile == null)) {
physicalDef = getPhysicalDefinition(logicalDef, true);
} else {
physicalDef = getPhysicalDefinition(logicalDef, false);
@@ -238,8 +253,8 @@
writeDefinition(logicalDef, writer);
physicalDef = writeImport(physicalDef, getIdlFile());
writeDefinition(physicalDef, physicalWriter);
- } else if (logicalFile == null && physicalFile == null
- && schemaFilename != null) {
+ } else if ((logicalFile == null && physicalFile == null)
+ && (schemaFilename != null || importSchemaFilename != null)) {
// write out the schema file -T and default of logical
// and physical together.
writeDefinition(physicalDef, writer);
@@ -248,7 +263,7 @@
// write out the default file
writeDefinition(definition, writer);
}
-
+
return true;
}
@@ -259,37 +274,27 @@
importDef.setNamespaceURI(definition.getTargetNamespace());
def.addImport(importDef);
return def;
- }
-
- // -T option - generate schema types into a specified file.
- private void writeSchemaFile(Writer schemaWriter) throws Exception {
- Types types = definition.getTypes();
- Definition schemaDef = createWsdlDefinition(targetNamespace);
- schemaDef.setTypes(types);
- Iterator iter = definition.getNamespaces().values().iterator();
- while (iter.hasNext()) {
- String namespace = (String)iter.next();
- String prefix = definition.getPrefix(namespace);
- if (prefix.equals("corba")) {
- schemaDef.removeNamespace(prefix);
- }
- }
- writeDefinition(schemaDef, schemaWriter);
- }
+ }
// Gets the logical definition for a file - an import will be added for the
// schema types if -T is used and a separate schema file generated.
+ // if -n is used an import will be added for the schema types and no types generated.
private Definition getLogicalDefinition(String schemaFilename, Writer schemaWriter)
throws WSDLException, JAXBException, Exception {
Definition def = createWsdlDefinition(targetNamespace);
// checks for -T option.
if (schemaFilename != null) {
- writeSchemaFile(schemaWriter);
+ writeSchemaDefinition(definition, schemaWriter);
writeImport(def, schemaFilename);
} else {
- Types types = definition.getTypes();
- def.setTypes(types);
+ // checks for -n option
+ if (importSchemaFilename == null) {
+ Types types = definition.getTypes();
+ def.setTypes(types);
+ } else {
+ writeImport(def, importSchemaFilename);
+ }
}
Iterator iter = definition.getAllPortTypes().values().iterator();
@@ -364,11 +369,11 @@
def.setExtensionRegistry(definition.getExtensionRegistry());
return def;
- }
+ }
private Definition createWsdlDefinition(String tns) throws WSDLException, JAXBException {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- Definition wsdlDefinition = wsdlFactory.newDefinition();
+ Definition wsdlDefinition = wsdlFactory.newDefinition();
wsdlDefinition.setTargetNamespace(tns);
wsdlDefinition.addNamespace(WSDLConstants.WSDL_PREFIX, WSDLConstants.NS_WSDL);
wsdlDefinition.addNamespace(WSDLConstants.XSD_PREFIX, WSDLConstants.XSD_NAMESPACE);
Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java?view=diff&rev=534794&r1=534793&r2=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java Thu May 3 04:11:57 2007
@@ -20,7 +20,6 @@
package org.apache.yoko.tools.processors;
import java.io.ByteArrayInputStream;
-import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
@@ -269,7 +268,7 @@
env.setParameters(cfg);
IDLToWSDLProcessor processor = new IDLToWSDLProcessor();
- processor.setEnvironment(env);
+ processor.setEnvironment(env);
java.io.CharArrayWriter outL = new java.io.CharArrayWriter();
processor.setLogicalOutputWriter(outL);
java.io.CharArrayWriter outP = new java.io.CharArrayWriter();
@@ -341,26 +340,25 @@
public void testSchemaOnly() throws Exception {
// This tests if -T option is only passed.
- testSchemaGeneration("/idl/OptionsSchema.idl", "expected_Schema.wsdl",
- "/idl/expected_OptionsSchema.wsdl", "/idl/expected_Schema.wsdl");
+ testSchemaGeneration("/idl/OptionsSchema.idl", "expected_Schema.xsd",
+ "/idl/expected_OptionsSchema.wsdl", "/idl/expected_Schema.xsd");
}
public void testPhysicalSchema() throws Exception {
// This tests if -P and -T options are passed.
testLogicalPhysicalSchemaGeneration("/idl/OptionsPT.idl", null,
"expected_PhysicalPT.wsdl",
- "expected_SchemaPT.wsdl", null,
+ "expected_SchemaPT.xsd", null,
"/idl/expected_PhysicalPT.wsdl",
- "/idl/expected_SchemaPT.wsdl");
+ "/idl/expected_SchemaPT.xsd");
}
public void testLogicalSchema() throws Exception {
// This tests -L and -T options are passed.
testLogicalPhysicalSchemaGeneration("/idl/OptionsLT.idl", "expected_LogicalLT.wsdl",
- null, "expected_SchemaLT.wsdl",
+ null, "expected_SchemaLT.xsd",
"/idl/expected_LogicalLT.wsdl", null,
- "/idl/expected_SchemaLT.wsdl");
- new File("OptionsLPT.wsdl").delete();
+ "/idl/expected_SchemaLT.xsd");
}
@@ -390,10 +388,10 @@
public void testLogicalPyhsicalSchema() throws Exception {
// This tests if -L, -P and -T options are passed.
testLogicalPhysicalSchemaGeneration("/idl/OptionsLPT.idl", "expected_LogicalLPT.wsdl",
- "expected_PhysicalLPT.wsdl", "expected_SchemaLPT.wsdl",
+ "expected_PhysicalLPT.wsdl", "expected_SchemaLPT.xsd",
"/idl/expected_LogicalLPT.wsdl",
"/idl/expected_PhysicalLPT.wsdl",
- "/idl/expected_SchemaLPT.wsdl");
+ "/idl/expected_SchemaLPT.xsd");
}
Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_LogicalLPT.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_LogicalLPT.wsdl?view=diff&rev=534794&r1=534793&r2=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_LogicalLPT.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_LogicalLPT.wsdl Thu May 3 04:11:57 2007
@@ -18,7 +18,7 @@
* under the License.
-->
<wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/OptionsLPT" xmlns:tns="http://schemas.apache.org/yoko/idl/OptionsLPT" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:import namespace="http://schemas.apache.org/yoko/idl/OptionsLPT" location="expected_SchemaLPT.wsdl">
+ <wsdl:import namespace="http://schemas.apache.org/yoko/idl/OptionsLPT" location="expected_SchemaLPT.xsd">
</wsdl:import>
<wsdl:message name="getEmployee">
<wsdl:part name="inparameter" element="tns:getEmployee">
Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_LogicalLT.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_LogicalLT.wsdl?view=diff&rev=534794&r1=534793&r2=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_LogicalLT.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_LogicalLT.wsdl Thu May 3 04:11:57 2007
@@ -18,7 +18,7 @@
* under the License.
-->
<wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/OptionsLT" xmlns:tns="http://schemas.apache.org/yoko/idl/OptionsLT" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:import namespace="http://schemas.apache.org/yoko/idl/OptionsLT" location="expected_SchemaLT.wsdl">
+ <wsdl:import namespace="http://schemas.apache.org/yoko/idl/OptionsLT" location="expected_SchemaLT.xsd">
</wsdl:import>
<wsdl:message name="getEmployeeResponse">
<wsdl:part name="outparameter" element="tns:getEmployeeResponse">
@@ -36,4 +36,4 @@
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
-</wsdl:definitions>
\ No newline at end of file
+</wsdl:definitions>
Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_OptionsSchema.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_OptionsSchema.wsdl?view=diff&rev=534794&r1=534793&r2=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_OptionsSchema.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_OptionsSchema.wsdl Thu May 3 04:11:57 2007
@@ -24,7 +24,7 @@
<corba:member name="number" idltype="corba:long" />
</corba:struct>
</corba:typeMapping>
- <wsdl:import namespace="http://schemas.apache.org/yoko/idl/OptionsSchema" location="expected_Schema.wsdl">
+ <wsdl:import namespace="http://schemas.apache.org/yoko/idl/OptionsSchema" location="expected_Schema.xsd">
</wsdl:import>
<wsdl:message name="getEmployee">
<wsdl:part name="inparameter" element="tns:getEmployee">
Added: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Schema.xsd
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_Schema.xsd?view=auto&rev=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_Schema.xsd (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_Schema.xsd Thu May 3 04:11:57 2007
@@ -0,0 +1,51 @@
+<?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 attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/OptionsSchema" xmlns="http://schemas.apache.org/yoko/idl/OptionsSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:complexType name="foo.bar.Employee">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string">
+ </xs:element>
+ <xs:element name="number" type="xs:int">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="getEmployee">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="inEmp" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="inoutEmp" type="foo.bar.Employee">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getEmployeeResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="return" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="outEmp" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="inoutEmp" type="foo.bar.Employee">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</schema>
\ No newline at end of file
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Schema.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Schema.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Schema.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLPT.xsd
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLPT.xsd?view=auto&rev=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLPT.xsd (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLPT.xsd Thu May 3 04:11:57 2007
@@ -0,0 +1,51 @@
+<?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 attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/OptionsLPT" xmlns="http://schemas.apache.org/yoko/idl/OptionsLPT" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:complexType name="foo.bar.Employee">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string">
+ </xs:element>
+ <xs:element name="number" type="xs:int">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="getEmployee">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="inEmp" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="inoutEmp" type="foo.bar.Employee">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getEmployeeResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="return" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="outEmp" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="inoutEmp" type="foo.bar.Employee">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</schema>
\ No newline at end of file
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLPT.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLPT.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLPT.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLT.xsd
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLT.xsd?view=auto&rev=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLT.xsd (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLT.xsd Thu May 3 04:11:57 2007
@@ -0,0 +1,51 @@
+<?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 attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/OptionsLT" xmlns="http://schemas.apache.org/yoko/idl/OptionsLT" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:complexType name="foo.bar.Employee">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string">
+ </xs:element>
+ <xs:element name="number" type="xs:int">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="getEmployee">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="inEmp" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="inoutEmp" type="foo.bar.Employee">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getEmployeeResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="return" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="outEmp" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="inoutEmp" type="foo.bar.Employee">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</schema>
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLT.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLT.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaLT.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaPT.xsd
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaPT.xsd?view=auto&rev=534794
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaPT.xsd (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaPT.xsd Thu May 3 04:11:57 2007
@@ -0,0 +1,51 @@
+<?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 attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/OptionsPT" xmlns="http://schemas.apache.org/yoko/idl/OptionsPT" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:complexType name="foo.bar.Employee">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string">
+ </xs:element>
+ <xs:element name="number" type="xs:int">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="getEmployee">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="inEmp" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="inoutEmp" type="foo.bar.Employee">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getEmployeeResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="return" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="outEmp" type="foo.bar.Employee">
+ </xs:element>
+ <xs:element name="inoutEmp" type="foo.bar.Employee">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</schema>
\ No newline at end of file
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaPT.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaPT.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_SchemaPT.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml