有没有办法通过注释在metro中实现ws-security?
由于我不想创建大量 wsit 文件来启用安全性(消息加密和用户身份验证)并且我不想使用 netbeans 在那里使用 Metro 插件,所以我想问是否有任何简单的方法通过注释实现 ws-security? 或者除了soap ui之外还有任何eclipse插件来创建这样的wsit文件吗?实际上这不是很有用?
提前致谢。
Since i do not want to create a lot of wsit files to enable security (encryption of message and authentication of users) and i do not want to use netbeans to use the metro plugin there, i want to ask if there is any easy way to implement ws-security via annotations?
Or is there any eclipse plugin besides soap ui, which is in fact not very usefull, to create such wsit files?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 这篇文章,Metro 不以编程方式支持 ws-policy。不过那是2009年了,所以我不知道情况是否仍然如此。
如果您不想使用 wsit 文件(也就是说,如果您在 WSDL 中有策略),Metro 也可以直接从 WSDL 获取策略。
这就是我在 Metro 生成的服务类中所做的。它直接从 WSDL(位于我的类路径中)加载策略,并将在运行时应用所有策略,前提是您已在应用程序服务器中安装了 Metro 并且项目中没有任何冲突的依赖项(这个有点对我来说找到一个麻烦,我的一些依赖项有 jaxws-rt 作为依赖项,这可能会破坏 Metros 策略解析)。
According to this post, Metro does not support ws-policy programmatically. That was 2009 though, so I don't know if that's still the case.
Metro can get the policy directly from the WSDL too if you don't want to use wsit files (if you have the policy in the WSDL at all, that is).
This is how I did in my Metro-generated service class. It loads the policy directly from the WSDL, which is in my classpath, and will apply all policies in runtime, provided that you have installed Metro in your application server and don't have any conflicting dependencies in your project (this one was a bit of a hassle for me to find, some of my dependencies had
jaxws-rt
as a dependency, which may ruin Metros policy resolving).