I have a restricted type with base string:
<simpleType name="stringto1">
<restriction base="string">
<pattern value="[АБВГ2134-]"/>
</restriction>
</simpleType>
And a field with this type:
<element maxOccurs="4" minOccurs="1" name="P5" type="tns:stringto1"/>
But i can write EVERYTHING what i want in this field and the validation is OK! And there IS validation error on the server. Any ideas?
The special character
-
inregex
is for specify arange
like[a-z]
. If you want to use-
as a simple character you must escape it with\
as\-
, so try with the followregex
aspattern
:Additionally
SOAPUI
isn't validating your xml because doesn't compile yourpattern
, you can see this in theSOAPUI
log, where the follow error message is displayed:15:57:51,883 WARN [SchemaUtils] Error: ...\wsdl.wsdl: 0: warning: pattern-regex: The regular expression '[????2134-]' is malformed: '-' is an invalid character range. Write '\-'.
Note that
????
it's because my charset encoding doesn't recognizeАБВГ
characters, I supouse that in your case escaping-
as\-
will be enough.Hope this helps,