You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Reneta Säll (HF/EBC)" <re...@ericsson.com> on 2007/03/27 10:21:46 UTC

Axis2 XMLBeans,JAXB validation?

Hi all,
 
I am using Axis2  WSDL2Java and generate java classes from wsdl.
In the generated java classes I can't  see any validation code for patterns maping from my schema.
I tried JAXB, XMLBean as binding options. 
 
How can I handle validation for restrictions when using JAXB or XMLBeans as a databinding in Axis2?
Here is my schema file:
<?xml version="1.0" encoding="UTF-8"?>

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

        <xs:element name="myElement">

            <xs:complexType>

                <xs:sequence>

                    <xs:element name="element1" minOccurs="0">

                            <xs:annotation>

                                <xs:documentation>Used as ID. Account code</xs:documentation>

                            </xs:annotation>

                            <xs:simpleType>

                                <xs:restriction base="xs:string">

                                        <xs:pattern value="^((([1-9][0-9]{0,14},)|([1-9][0-9]{0,14}-[1-9][0-9]{0,14},))*([1-9][0-9]{0,14}|([1-9][0-9]{0,14}-[1-9][0-9]{0,14})))$|^([Aa][Ll][Ll])$|^([>][1-9][0-9]{0,14})$"/>

                               </xs:restriction>

                            </xs:simpleType>

                </xs:element>

            </xs:sequence>

        </xs:complexType>

    </xs:element>

    <xs:element name="myElement1">

        <xs:complexType>

                <xs:sequence>

                        <xs:element ref="tns:myElement" minOccurs="0" maxOccurs="4000"/>

                </xs:sequence>

        </xs:complexType>

    </xs:element>

</xs:schema>

Reneta