xs:restriction 在 Spring WS 中不起作用
我这样定义了我的 xsd(部分):
<xs:element name="entityNo" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
但是当我使用 SoapUI 发送长度超过 20 的字符串时,我的端点仍然会收到它,就好像它是有效输入一样。 我该如何解决这个问题?
I defined my xsd this way (partial):
<xs:element name="entityNo" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
but when i send with SoapUI a string longer than 20 my Endpoint still receives it as if it was a valid input.
How can i fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,限制有效,我只需在 spring-ws 配置文件中添加 PayloadValidatingInterceptor 拦截器:
OK, restriction works, i just had to add the PayloadValidatingInterceptor interceptor in spring-ws config file: