> 1. Can anyone give me a xsd file for the java class that is an input
to a POJO ... Etc etc etc
As ATM and others have already advised, "stay away from Vector and J2
Collections" for the webservices interface. It's ok to use the
Vector/ArrayList internally, but the exposed interface should be an
array, generated using ArrayList.toArray(new MyType[1]) or the
corresponding Vector call.
Also in general, the recommendation for interop is to use "WSDL first"
design. If you are building an interface for interop, start with the
WSDL and XSD *first*.
This guideline applies regardless of whether you are using AXIS, or some
other technology. If anyone has an alternative view I would like to
hear it.
In practice it means you build the WSDL first, not the implementation.
WSDL First means mean you would start by writing the WSDL and the XSD
that defines your complex types, then generate your Java code
(interfaces and support classes) from that using the AXIS WSDL2Java tool
with the --server-side arg. Then you provide your implementation, using
the arraylist or Vector micro-pattern I mentioned above.
So in XSD you can specify an array of complex types like so
<schema ...>
<complexType name="MyType_CT">
<sequence>
<element name="name" nillable="true" type="xsd:int">
<element name="value" type="xsd:int">
<element name="stamp" type="xsd:date">
... Etc ..
</sequence>
</complexType>
<element name="getRootContainersResponse" nillable="true">
<complexType>
<sequence>
<element maxOccurs="unbounded" name="item"
type="tns:MyType_CT"/>
</sequence>
</complexType>
</element>
</schema>
> 2. Do we have tools that generate xsd schemas for such java classes.
Yes, it's called Java2WSDL. Also part of AXIS. This is not recommended
though, for interop purposes. See above !
-Dino
-----Original Message-----
From: babloosony [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 24, 2005 5:42 AM
To: [email protected]; [email protected]
Subject: Need xsd for java.util.Vector
Hi All,
I have 2 questions :
1. Can anyone give me a xsd file for the java class that is an input to
a POJO that need to be exposed as web service that need to be exposed
as Document/Literal style web service using Apache AXIS.
Basically I want to generate an xsd schema for this java class and
include that in a WSDL that need to be given to .NET so that they can
consume my service.
public class Animal implements java.io.Serializable {
private Vector animalQualitiesVector = new Vector();
public void setAnimalQualitiesVector(Vector v)
{
animalQualitiesVector = v;
}
public Vector getAnimalQualitiesVector()
{
return animalQualitiesVector;
}
}
2. Do we have tools that generate xsd schemas for such java classes.
Did anyone use one ?
Thanks & Regards,
Kumar.