【发布时间】:2017-11-02 21:49:21
【问题描述】:
我们使用 Spring 和 CXF 来提供 SOAP Web 服务。 WSDL 是从 Java 代码生成的。
有没有办法在 Java 代码中定义适用于生成的 XSD 的验证规则?
例如,对一些 JSR 303 注释的支持会很棒。在这种情况下,此代码:
@Pattern(regexp = "[0-9]+/[0-9]+")
private String phone;
将评估为这样的 XSD:
<restriction base="string">
<pattern value="[0-9]+/[0-9]+"></pattern>
</restriction>
【问题讨论】:
标签: cxf jax-ws jax-ws-customization