You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Mar, Kheng Kok" <Ma...@rosettanet.org> on 2006/01/04 09:08:32 UTC

WSDL2Java cannot handle schema with include statement

Hi, 

 

I am trying to use WSDL2Java to generate Java classes from a WSDL, which
imports a couple of schemas, and in one of the schema, it does an
include of other schema files. 

The WSDL2Java throw an exception during XmlBeans.compileXmlBeans in the
XMLBeansExtension class. 

 

Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: org.apache.xmlbeans.XmlException: error:
Could not load resource "DocumentIdentification.xsd" (network downloads
disabled).

      at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerati
onEngine.java:105)

      at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:30)

      at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)

Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException:
error: Could not load resource "DocumentIdentification.xsd" (network
downloads disabled).

      at
org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBean
sExtension.java:195)

      at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerati
onEngine.java:76)

      ... 2 more

Caused by: org.apache.xmlbeans.XmlException: error: Could not load
resource "DocumentIdentification.xsd" (network downloads disabled).

      at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaT
ypeSystemCompiler.java:225)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:585)

      at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:665)

      at
org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBean
sExtension.java:171)

      ... 3 more

 

I modified the schema to remove the schema includes and it compiles
properly this time. By stepping through the code, it looks like when the
schema is retrieved, it is not expanded to include the "included"
schemas files. 

 

Please let me know if this is a bug. 

 

I have attached the WSDL/schema files for your testing. 

 

Best Regards

Kheng Kok

 


Re: WSDL2Java cannot handle schema with include statement

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,
Since this talks about XMLBeans, I guess this is a Axis2 issue. There was a
problem with included schemas earlier but now it is fixed. What is the
version (od Axis2) you are using ?

Ajith

On 1/4/06, Mar, Kheng Kok <Ma...@rosettanet.org> wrote:
>
>  Hi,
>
>
>
> I am trying to use WSDL2Java to generate Java classes from a WSDL, which
> imports a couple of schemas, and in one of the schema, it does an include of
> other schema files.
>
> The WSDL2Java throw an exception during XmlBeans.compileXmlBeans in the
> XMLBeansExtension class.
>
>
>
> Exception in thread "main" *
> org.apache.axis2.wsdl.codegen.CodeGenerationException*: *
> java.lang.RuntimeException*: *org.apache.xmlbeans.XmlException*: error:
> Could not load resource "DocumentIdentification.xsd" (network downloads
> disabled).
>
>       at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(*
> CodeGenerationEngine.java:105*)
>
>       at org.apache.axis2.wsdl.WSDL2Code.main(*WSDL2Code.java:30*)
>
>       at org.apache.axis2.wsdl.WSDL2Java.main(*WSDL2Java.java:21*)
>
> Caused by: *java.lang.RuntimeException*: *org.apache.xmlbeans.XmlException
> *: error: Could not load resource "DocumentIdentification.xsd" (network
> downloads disabled).
>
>       at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(
> *XMLBeansExtension.java:195*)
>
>       at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(*
> CodeGenerationEngine.java:76*)
>
>       ... 2 more
>
> Caused by: *org.apache.xmlbeans.XmlException*: error: Could not load
> resource "DocumentIdentification.xsd" (network downloads disabled).
>
>       at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(
> *SchemaTypeSystemCompiler.java:225*)
>
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(*Native Method*)
>
>       at sun.reflect.NativeMethodAccessorImpl.invoke(*
> NativeMethodAccessorImpl.java:39*)
>
>      at sun.reflect.DelegatingMethodAccessorImpl.invoke(*
> DelegatingMethodAccessorImpl.java:25*)
>
>       at java.lang.reflect.Method.invoke(*Method.java:585*)
>
>       at org.apache.xmlbeans.XmlBeans.compileXmlBeans(*XmlBeans.java:665*)
>
>       at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(
> *XMLBeansExtension.java:171*)
>
>       ... 3 more
>
>
>
> I modified the schema to remove the schema includes and it compiles
> properly this time. By stepping through the code, it looks like when the
> schema is retrieved, it is not expanded to include the "included" schemas
> files.
>
>
>
> Please let me know if this is a bug.
>
>
>
> I have attached the WSDL/schema files for your testing.
>
>
>
> Best Regards
>
> Kheng Kok
>
>
>
>


--
Ajith Ranabahu