Meaningless Drivel is fun!
The moose likes Web Services and the fly likes java.util.Vector and XSD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "java.util.Vector and XSD" Watch "java.util.Vector and XSD" New topic

java.util.Vector and XSD

Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
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">
<element minOccurs="0" maxOccurs="unbounded" name="item" type="xsd:string"/>

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,

RR Kumaran
SCJP 1.4
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
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.
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Is it the same question that this one you posted just before ??

/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
both are related but I am expecting answers to each one of those ...
I agree. Here's the link:
subject: java.util.Vector and XSD
It's not a secret anymore!