Hey you can use @SchemaValidation
(org.apache.cxf.annotations.SchemaValidation)  in Implementation class

@SchemaValidation
class <service>Impl implements <service>Intf {
}

this will help.

On 21 December 2014 at 16:45, flying_machine1 <[email protected]> wrote:
> I am trying to add restriction to wsdl using @Facet annotation in Employee
> class but in generated wsdl restriction is not getting created.I am
> following  this
> <http://www.infosys.tuwien.ac.at/staff/hummer/tools/jaxb-facets.html>
> article but still it's not working.Below is the code.
> 1)Employee.java
>
> import javax.xml.bind.annotation.Facets;
>
> public class Employee {
>
>     @Facets(minInclusive="1",maxInclusive="10")
>     int id;
>     @Facets(pattern="[a-z][a-z0-9]{0,4}")
>     String name;
>     EmployeeRole role;
>
>     //getter and setter
> }
>
> 2)type defination in mployeeservice.wsdl
>
>   <xs:complexType name="employee">
>     <xs:sequence>
>       <xs:element name="id" type="xs:int"/>
>       <xs:element minOccurs="0" name="name" type="xs:string"/>
>       <xs:element minOccurs="0" name="role" type="tns:employeeRole"/>
>     </xs:sequence>
>   </xs:complexType>
>
> Above wsdl does not contain <xs:restriction> for employee.
>
> Please help me in this.
>
>
>
>
> --
> View this message in context: 
> http://cxf.547215.n5.nabble.com/Unable-to-add-restriction-to-bean-in-apache-cxf-soap-service-tp5752609.html
> Sent from the cxf-user mailing list archive at Nabble.com.



-- 
Thanks & regards
Kaustuv Maji

Reply via email to