views:

802

answers:

1

I have a wsdl that has a imported xsd, this xsd has quite a restrictions like this:

<xsd:simpleType name="len_type">
    <xsd:restriction base="xsd:string">
        <xsd:pattern value='[:alnum:]{4} [\d]{2} [\d] [\d]{2}' />
    </xsd:restriction>
</xsd:simpleType>

So I would thind that when I deploy this ear to glassfish via netbeans that there would be validation done on the data that is passed in, but this is not the case. Is there any calls I need to make to ensure that the data is validated before it is passed to my @WebService object and turned into a Java object.

+2  A: 

Use the SchemaValidation annotation.

Be forewarned, that it works only for web services of document/literal style. And be careful about schema validation, if you are using XSD imports.

Vineet Reynolds