• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

XJC unable to parse xsd and generate java classes

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?


 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ) .
 
reply
    Bookmark Topic Watch Topic
  • New Topic