Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MaxLength

 
Suri Babs
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Apache Axis 1.4 WSDL2Java is not generating code for maxLength

<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="preserve"/>
<xsd:maxLength value="10"/>

Is there any alternative on how to handle this or Is there any way to make Axis generate this code?

Help is required on this.

Thanks
Suresh
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I am not entirely sure, but I think that JAXB will not generate code that enforces maxLength either.
What you can do is:
1) Add code to enforce maxLength in the generated class.
A less good approach, if you ever re-generate the code.
2) Create a subclass of the generated class and override method(s) to enforce maxLength.
A better approach.
3) Use AOP to instrument the generated class to add enforcement of the maxLength.
Also a better approach, compared to 1.
Best wishes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic