Grails-Plugin-Consortium / grails-cxf

CXF Plugin for the Grails web framework
http://grails.org/plugin/cxf
38 stars 46 forks source link

Elements in WSDL generated without minLength attributes #51

Open daveage opened 8 years ago

daveage commented 8 years ago

When I add @size annotation to a Class Field it is not generated in wsdl as minLength attribute.

I've actually try more ways of adding length or pattern specification to a field to make it really mandatory, but nothing works.

My problem is, that I need to validate incoming request against WSDL generated from java classes. But whatever I do, I can't make it validate the value of incoming element.

I have this CODE element in wsdl and current validation only checks, whether or not the element is present in the request. However it may be empty, and I'd love to prevent this situation by validation of the request.

The type riderStringValue is like this:

<xs:complexType name="riderStringValue">
    <xs:simpleContent>
        <xs:extension base="xs:string">
            <xs:attribute name="eId" type="xs:string" />
        </xs:extension>
    </xs:simpleContent>
</xs:complexType>

and I'd need something like this:

<xs:complexType name="riderStringValue">
    <xs:simpleContent>
        <xs:extension base="tns:RiderCode">
            <xs:attribute name="eId" type="xs:string" />
        </xs:extension>
    </xs:simpleContent>
</xs:complexType>
<xs:simpleType name="RiderCode">
    <xs:restriction base="xs:string">
        <xs:minLength value="3" />
        <xs:maxLength value="4" />
    </xs:restriction>
</xs:simpleType>