You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2005/09/20 12:24:23 UTC
svn commit: r290412 - in
/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen:
CodeGenConfiguration.java CodeGenerationEngine.java
extension/XMLBeansExtension.java
Author: ajith
Date: Tue Sep 20 03:24:08 2005
New Revision: 290412
URL: http://svn.apache.org/viewcvs?rev=290412&view=rev
Log:
1. Passed null into the STS name. This makes XMLbeans create a new unique name for the type system
2. Fixed a bug in the Codegen config that caused it to spit a wrong error message when the output folder is not specified
3. Set the default output folder to the current folder
Modified:
webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?rev=290412&r1=290411&r2=290412&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java Tue Sep 20 03:24:08 2005
@@ -119,12 +119,12 @@
public CodeGenConfiguration(WSDLDescription wom, Map optionMap) {
this.wom = wom;
+ String outputLocation = "."; //default output directory is the current working directory
CommandLineOption clo =
((CommandLineOption)optionMap.get(OUTPUT_LOCATION_OPTION));
- if (clo == null) {
- throw new RuntimeException("Cannot codegenerate! WSDL file is missing!");
+ if (clo != null) {
+ outputLocation = clo.getOptionValue();
}
- String outputLocation = clo.getOptionValue();
this.outputLocation = new File(outputLocation);
serverSide = (optionMap.get(SERVER_SIDE_CODE_OPTION) != null);
@@ -159,7 +159,6 @@
outputLanguage = langOption.getOptionValue();
}
-// Unused code commented out by gdaniels...
CommandLineOption dataBindingOption = (CommandLineOption) optionMap.get(
DATA_BINDING_TYPE_OPTION);
if(dataBindingOption != null){
@@ -168,17 +167,6 @@
}
-// private void loadLanguge(String langName) {
-// if (LanguageNames.JAVA.equalsIgnoreCase(langName)) {
-// this.outputLanguage = XSLTConstants.LanguageTypes.JAVA;
-// } else if (LanguageNames.C_SHARP.equalsIgnoreCase(langName)) {
-// this.outputLanguage = XSLTConstants.LanguageTypes.C_SHARP;
-// } else if (LanguageNames.C_PLUS_PLUS.equalsIgnoreCase(langName)) {
-// this.outputLanguage = XSLTConstants.LanguageTypes.C_PLUS_PLUS;
-// } else if (LanguageNames.VB_DOT_NET.equalsIgnoreCase(langName)) {
-// this.outputLanguage = XSLTConstants.LanguageTypes.VB_DOT_NET;
-// }
-// }
/**
* @return Returns the parser.
Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java?rev=290412&r1=290411&r2=290412&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java (original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java Tue Sep 20 03:24:08 2005
@@ -112,6 +112,7 @@
IOException {
String uri = ((CommandLineOption) parser.getAllOptions().get(
CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION)).getOptionValue();
+ //todo check the wsdl URI here
return WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11).build(uri)
.getDescription();
}
Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java?rev=290412&r1=290411&r2=290412&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java (original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java Tue Sep 20 03:24:08 2005
@@ -143,8 +143,9 @@
//compile the type system
XmlObject[] objeArray = convertToXMLObjectArray(xmlObjectsVector);
BindingConfig config = new Axis2BindingConfig();
- //todo Need to pick up the STS name dynamically so that different code can co-exist
- sts = XmlBeans.compileXmlBeans(DEFAULT_STS_NAME, null,
+
+ //set the STS name to null. it makes the generated class include a unique (but random) STS name
+ sts = XmlBeans.compileXmlBeans(null, null,
objeArray,
config, XmlBeans.getContextTypeLoader(),
new Axis2Filer(),