• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

MaxLength

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
I'm full of tinier men! And a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic