Based on some now deleted answers and comments, the question is how to communicate to consumers of the WSDL what the maximum allowed length of a string parameter is.
In XML Schema used within WSDL, the idea of restrictions is used to limit acceptable values of existing types. Here is an example for for the length of a string Is it possible to require min and max string length for param in wsdl file?.
(Enforcement of these restrictions is not implemented in all frameworks - for example Axis 1.x did not enforce them.)
There is no annotation in Apex to add the maxLength value to your class, so in theory you would have to take the WSDL generated from your class, manually modify it, then generate Apex from it using "Generate from WSDL" (AKA wsdl2apex). But the generator does not support this pattern - see Empty sub-classes in output of wsdl2apex?? - so that won't work.
In short, your approach does not look possible in Salesforce.