File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XJC unable to parse xsd and generate java classes

 
Ravi Tej Pidatala
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

I have an xsd which I am trying to parse using xsd , generate java classes and xml from it . Below is the xsd . While I use command

xjc even.xsd , I am getting the error ,

parsing a schema...
[WARNING] schema_reference.4: Failed to read schema document 'http://schemas.xmlsoap.org/soap/encoding/', because 1) cou
ld not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
line 2 of file:Event.xsd
I tried to find if xsd is valid online , but got result that its a valid xsd. Can you tell how to generate java classes through this xsd and generate xml from it ?


 
g tsuji
Ranch Hand
Posts: 649
3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[WARNING] schema_reference.4: Failed to read schema document 'http://schemas.xmlsoap.org/soap/encoding/', because 1) cou
ld not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
line 2 of file:Event.xsd

In your case here, the most probable reason is that of 2). Make sure you've internet access during the operation of compilation. If your schema is shown as such, you can even comment the xs:import out all together as it does not use the vacabulary coming from soapenc. That would be the simplest and you would generate a much cleaner class layouts.

The schema also contains a fatal error though the process failed before the problem reveals itself.

At the xs:element ObjectType, you define a default value for it. However, the simpleType of that element is restricted to an enumeration. The default has thereby to appear at least in the list of enumerated value to be consistent, otherwise, as such, it would be a fatal error.
 
Ravi Tej Pidatala
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Tsuji , thanks for your reply . It was an issue of connection to internet . I was actually connected to internet and able to browse , but through command prompt i was unable to ping any website (may be because of some proxy or settings ) .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic