Hello,
The jibx2wsdl tool has a bug when dealing with shared classes that are
located in different packages that end with the same folder name. It seems
jibx2wsdl is using the last folder name of a package to generate a schema
file. For example, if I have a web service interface 'ITest' that consists
of two methods:
a.b.c.common.ServiceResult setData(SomeData data);
a.b.c.data.common.DataResult getData(); where DataResult includes a
ServiceResult
When trying to generate the WSDL + schemas, files get generated but with an
error:
[java] Error: Referenced type '{
http://taw.com/cca/common}:service-result' is not defined for element
element at (source unknown)
And when trying to generate Java code using WSDL2Java, I get (notice
common.xsd trying to import itself):
[java] Retrieving schema at 'test.xsd', relative to
'file:/C:/Projects/MyProject/jibx2wsdl/wsdl/'.
[java] Retrieving schema at 'common.xsd', relative to
'file:/C:/Projects/MyProject/jibx2wsdl/wsdl/test.xsd'.
[java] Retrieving schema at 'common.xsd', relative to
'file:/C:/Projects/MyProject/jibx2wsdl/wsdl/common.xsd'.
[java] May 28, 2007 6:38:09 PM
org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService
[java] SEVERE: java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.RuntimeException: org.apache.ws.commons.schema.XmlSchemaException:
An imported schema was announced to have the namespace
http://taw.com/cca/common, but has the namespace
http://taw.com/cca/data/common
[java] Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
[java] at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(
CodeGenerationEngine.java:137)
[java] at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
[java] at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
[java] Caused by: org.apache.axis2.AxisFault:
java.lang.RuntimeException: java.lang.RuntimeException:
org.apache.ws.commons.schema.XmlSchemaException: An imported schema was
announced to have the namespace http://taw.com/cca/common, but has the
namespace http://taw.com/cca/data/common
[java] at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
WSDL11ToAxisServiceBuilder.java:298)
[java] at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(
CodeGenerationEngine.java:127)
[java] ... 2 more
BUT, when I refactor package a.b.c.data.common.DataResult to
a.b.c.data.common2.DataResult then everything works fine:
[java] Retrieving schema at 'test.xsd', relative to
'file:/C:/Projects/MyProject/jibx2wsdl/wsdl/'.
[java] Retrieving schema at 'common2.xsd', relative to
'file:/C:/Projects/MyProject/jibx2wsdl/wsdl/test.xsd'.
[java] Retrieving schema at 'common.xsd', relative to
'file:/C:/Projects/MyProject/jibx2wsdl/wsdl/common.xsd'.
Gerry
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users