• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Schema help

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have created a schema to describe a database table. In my webservice, I have to read data from a database table and convert that into a XML string and return to the caller.

Now, I am able to do all of above things but the only problem is I am sending the last row of the table only. I know some thing wrong with my schema and that is why its not able to hold all the rows.

This is how I created initial schema which was supporting a single row in the table.

Here element "sites" represent the DB table name.




But now I know I have to add one more element after "sites" to have loop kind of representation so I added "row" as new element but I am getting parsing errors when I am trying to generate my Java classes using "xjc". I tried but not able to fix this.

here is my new schema which I want to represent a DB table "sites" with multiple "row"s. can any one help me with this?



I know this should be a simple fix for you guys. appreciate your help.

Thanks,
Ugender

[ June 18, 2007: Message edited by: Ugender Rekulampally ]
[ June 18, 2007: Message edited by: Ugender Rekulampally ]
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the schema you can have sites element and which will have three elements.

Why do not you write a schema like this.

Root element - name : sitesDatabase , which can have unbounded number of sites element and sites element will be defined the way you have defined it now.(that is , with 3 child elements).

<sitesDatabase>
<sites>
..
..
</sites>
<sites>
..
..
</sites>
</sitesDatabase>
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rahul for your response.

I fixed the problem by defining a "row" element which again a complexType which describes all the column names in my database table and it is more dynamic.



Thanks,
Ugender
reply
    Bookmark Topic Watch Topic
  • New Topic