wsdlc Ant 任务忽略约束
我正在尝试使用 eclipse 和 Oracle Enterprise Pack 创建一个 Web 服务项目。当使用 wsdlc Ant 任务从 WSDL 文档生成 Web 服务时,WSDL 中的所有限制/约束都将被完全忽略。
有没有办法生成具有内置约束(例如 minoccurrs=1
)或强制使用枚举的 POJO?任何见解将不胜感激!
预先感谢,
卡尔
I'm attempting to create a web services project using eclipse with the Oracle Enterprise Pack. When generating the web services from a WSDL document using the wsdlc Ant task, all the restrictions/constraints in the WSDL are completely ignored.
Is there a way to generate POJO's with built-in constraints such as minoccurs=1
or forcing the use of enumerations? Any insight would be appreciated!
Thanks in advance,
Kal
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,我无法在这里找到这个答案,但我最终找到了答案。我现在发布它是因为它可能会帮助将来偶然发现这篇文章的其他人。
没有办法在 POJO 中添加验证,但有一种方法可以打开模式验证,以确保在收到 Web 服务消息时它符合 WSDL 设置的约束。您可以通过在服务类定义上方添加“@SchemaValidation”注释来完成此操作。这适用于 WebLogic,但我不确定它是否也是其他类型的应用程序服务器的标准。
Unfortunately, I wasn't able to find this answer here, but I did eventually find the answer. I'm posting it now because it may help someone else in the future that stumbles upon this post.
There isn't a way to add validation within the POJO's, but there is a way to turn on schema validation to ensure that when a web service message is received that it conforms to the constraints set by the WSDL. You can do this by adding the "@SchemaValidation" annotation above your service class definition. This works for WebLogic, but I'm not sure if it's a standard for other types of application servers as well.