Java 无法在apache cxf soap服务中向bean添加限制
我试图在Java 无法在apache cxf soap服务中向bean添加限制,java,web-services,jaxb,wsdl,cxf,Java,Web Services,Jaxb,Wsdl,Cxf,我试图在Employee类中使用@Facet注释向wsdl添加限制,但在生成的wsdl中,没有创建限制 文章,但仍然不起作用。下面是代码。 1) Employee.java import javax.xml.bind.annotation.Facets; public class Employee { @Facets(minInclusive="1",maxInclusive="10") int id; @Facets(patt
Employee
类中使用@Facet注释向wsdl添加限制,但在生成的wsdl中,没有创建限制
文章,但仍然不起作用。下面是代码。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) employeeservice.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>
上述wsdl不包含员工的
请帮我做这件事