Hi guys I've been asked recently to publish some of our existing POJOs as webservices using Axis2. I'm really impressed how easy this is so thanks a lot for this great effort.
However, there's one thing I am currently unable to do, concerning the use
of xsd:restrictions for my string elements (maxLength).
Currently, the generated schema from the WSDL looks like this:
<xs:schema attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="http://dps.tsm.ibm.com/xsd
">
<xs:complexType name="ArchiveRequest">
<xs:sequence>
<xs:element minOccurs="0" name="archiveFileRequest"
nillable="true" type="ax225:ArchiveFileRequest"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ArchiveFileRequest">
<xs:sequence>
<xs:element minOccurs="0" name="checksumType"
nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="checksumValue"
nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="fileName"
nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="overwrite"
type="xs:boolean"/>
<xs:element minOccurs="0" name="tsmDescription"
nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tsmFileSpaceName"
nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tsmHighLevelName"
nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tsmLowLevelName"
nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tsmManagementClass"
nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ArchiveResponse">
<xs:sequence>
<xs:element minOccurs="0" name="archiveFileRequest"
nillable="true" type="ax225:ArchiveFileRequest"/>
<xs:element minOccurs="0" name="archiveFileResponse"
nillable="true" type="ax225:ArchiveFileResponse"/>
<xs:element minOccurs="0" name="resultCode"
type="xs:int"/>
<xs:element minOccurs="0" name="resultMessage"
nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ArchiveFileResponse">
<xs:sequence>
<xs:element minOccurs="0" name="checksumValue"
nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tsmObjectArchiveDate"
nillable="true" type="xs:dateTime"/>
<xs:element minOccurs="0" name="tsmObjectID"
type="xs:long"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
However, for certain string elements in ArchiveFileRequest, I would like
to enforce a restriction based on the maximum length of the string.
Is there a way for the generated XSD to have this enforced from the POJO
source?
I have been reading about annotations but it's not really clear if this
works out of the box with Axis2 or if I need another module to have this.
Any help is appreciated.
Regards,
Miguel Sanders
TWS/TSAMP Specialist
Phone: 32-2 339 24 21 | Mobile: 32-478 80 50 23
E-mail: [email protected]
Avenue Du Bourget, 42
Brussels, 1130
Belgium
International Business Machines of Belgium sprl / bvba
Siège social / Maatschappelijke zetel: Avenue du Bourget 42 Bourgetlaan,
B-1130 Bruxelles/Brussel
N° d'entreprise / Ondernemingsnr: TVA / BTW BE 0405 912 336
RPM Bruxelles / RPR Brussel
Tenzij hierboven anders aangegeven: / Sauf indication contraire ci-dessus:
/ Unless otherwise stated above:
International Business Machines of Belgium sprl / bvba
Siège social / Maatschappelijke zetel: Avenue du Bourget 42 Bourgetlaan,
B-1130 Bruxelles/Brussel
N° d'entreprise / Ondernemingsnr: TVA / BTW BE 0405 912 336
RPM Bruxelles / RPR Brussel<<image/gif>>
