Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Unable to add restriction to bean in apache cxf soap service

$
0
0
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.

Viewing all articles
Browse latest Browse all 5648

Trending Articles