Hi,

I am using XMLBeans to generate code from a WSDL and validating the SOAP
request using validate. So far,
I was able to get validation properly working for many schema
constraints. However, I couldn't get "unique"
constraint working.

My WSDL snippet is shown below. What I am trying to do is to make sure
each user name in the removeUsersRequest is 
unique. The WSDL is properly parsed and XML beans are properly
generated. But the duplicate user names are not detected
in the SOAP request. 

What is wrong in my usage if "unique" here ? Why is the XMLBean
validation doesn't detect the duplicates while my other
schema constraints work correctly?

Thanks,

Gul

     <wsdl:definitions xmlns:impl="http://www.mycompany.com";
        xmlns:intf="http://www.mycompany.com";
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
        xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
        xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
        targetNamespace="http://www.mycompany.com";
elementFormDefault="qualified"                 
                  attributeFormDefault="unqualified">
                        
                                   <complexType name="UserNamesT">
                                <sequence>
                                        <element maxOccurs="50"
minOccurs="1" name="userName" nillable="false"
        
type="impl:nonEmptyString"/>
                                </sequence>
                        </complexType>

                        <element name="removeUsersRequest">
                                <complexType>
                                        <sequence>
                                                <element
name="userNames" nillable="false" type="impl:UserNamesT"/>
                                        </sequence>
                                </complexType>
                                                <unique
name="nameOfUser">
                                        <selector
xpath="impl:userNames"/>
                                                            <field
xpath="@userName"/>
                                                 </unique>
                        </element>

Reply via email to