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 di...@apache.org on 2007/06/28 18:52:28 UTC
svn commit: r551623 - in /webservices/axis2/trunk/java/modules:
codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
Author: dims
Date: Thu Jun 28 09:52:26 2007
New Revision: 551623
URL: http://svn.apache.org/viewvc?view=rev&rev=551623
Log:
Fix for AXIS2-926 - Wish to set package name for system xsb files when using xmlbeans.
In your wsdl2java command line please add the following option.
-d xmlbeans -Etypesystemname my_type_system
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java?view=diff&rev=551623&r1=551622&r2=551623
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java Thu Jun 28 09:52:26 2007
@@ -34,6 +34,8 @@
import java.util.List;
public class XMLBeansExtension extends AbstractDBProcessingExtension {
+ /** Name of "extra" option used to supply package name for xsb files. */
+ public static final String TYPESYSTEMNAME_OPTION = "typesystemname";
public static final String SCHEMA_FOLDER = "schemas";
public static String MAPPINGS = "mappings";
@@ -60,6 +62,9 @@
return;
}
+ // check the JiBX binding definition file specified
+ String typeSystemName = (String)configuration.getProperties().get(TYPESYSTEMNAME_OPTION);
+
try {
// try dummy load of framework class first to check missing jars
try {
@@ -79,7 +84,7 @@
// invoke utility class method for actual processing
Method method = clazz.getMethod(XMLBEANS_PROCESS_METHOD,
new Class[] { List.class, Element[].class,
- CodeGenConfiguration.class });
+ CodeGenConfiguration.class, String.class });
List schemas = new ArrayList();
List axisServices = configuration.getAxisServices();
AxisService axisService = null;
@@ -91,7 +96,7 @@
Element[] additionalSchemas = loadAdditionalSchemas();
TypeMapper mapper = (TypeMapper)method.invoke(null,
new Object[] { schemas, additionalSchemas,
- configuration });
+ configuration, typeSystemName });
// set the type mapper to the config
configuration.setTypeMapper(mapper);
Modified: webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java?view=diff&rev=551623&r1=551622&r2=551623
==============================================================================
--- webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java (original)
+++ webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java Thu Jun 28 09:52:26 2007
@@ -93,7 +93,8 @@
*/
public static TypeMapper processSchemas(List schemas,
Element[] additionalSchemas,
- CodeGenConfiguration cgconfig) throws RuntimeException {
+ CodeGenConfiguration cgconfig,
+ String typeSystemName) throws RuntimeException {
try {
//check for the imported types. Any imported types are supposed to be here also
@@ -172,9 +173,9 @@
sts = XmlBeans.compileXmlBeans(
- //set the STS name to null. it makes the generated class
+ // set the STS name; defaults to null, which makes the generated class
// include a unique (but random) STS name
- null,
+ typeSystemName,
null,
convertToSchemaArray(topLevelSchemaList),
new Axis2BindingConfig(cgconfig.getUri2PackageNameMap(),
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org