This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.util.Vector and XSD

 
Rr Kumaran
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

How do we represent a java.util.Vector in xsd file. Can anyone give some code snippet since a vector can contain any type of java objects.

Also, in the below code snippet which is a xsd representation for java.util.Vector

<element name="vector">
<complexType>
<sequence>
<element minOccurs="0" maxOccurs="unbounded" name="item" type="xsd:string"/>
</sequence>
</complexType>
</element>


I think we are saying that a vector can only contain string objects but not any other type of java objects. Am I right ?



Please suggest ...


Thanks & Regards,
Kumar.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will find things much simpler if you just convert Vectors to arrays - it really is easy to do and your service will much more likely to be portable. Think about it - a Vector is just a growable array - there is probably no reason for any web service client to want anything but an array.
See the toArray() method in Vector.
Bill
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it the same question that this one you posted just before ??
 
Rr Kumaran
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
both are related but I am expecting answers to each one of those ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic