如何让Axis2运行在OSGi环境中?
我需要访问 OSGi 环境(Equinox)中的 Web 服务。我已经有了使用 Web 服务作为独立应用程序的代码。
示例代码使用 Axis2 这似乎是一个问题,因为我需要将所有必需的库添加为单独的包。这不适用于 Axis2,因为项目提供的 jar 文件没有为 OSGi 准备。
我尝试通过 BND“捆绑”JAR 文件,但最终由于“包使用冲突错误:org.apache.axis2.addressing”,捆绑包不起作用
如何使 Axis2 OSGi 感知?< /strong>
或者 - 在 Equinox(普通不是 Eclipse)中访问(soap)Web 服务的简单且万无一失的变体是什么?我已经尝试过 Apache CXF,但失败了,因为它看起来试图在运行时生成代码,而 Axis2 也非常困难,正如我的帖子所示。
I need to access an webservice in an OSGi-Environment (Equinox). I do already have the code for using the webservice as a stand-alone application.
The sample code uses Axis2 this seems to be a problem as I need to add all required libraries as separate bundles. This does not work with Axis2 because the jar files provided by the project are not prepared for OSGi.
I tried to "bundelize" the JAR files via BND but in the end the bundles do not work because of a "Package uses conflict error: org.apache.axis2.addressing"
How to I make Axis2 OSGi-aware?
Alternatively - what is a simple and fool-proof variant for accessing a (soap) webservice in Equinox (plain not Eclipse)? I already tried Apache CXF which failed because it looks like it tries to generate code at runtime and Axis2 is also very difficult as my post shows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该考虑将 Axis2 库(和依赖项)嵌入到您的包中。在这种情况下,Axis2 将不会部署为自己的包 - 相反,类/jar 将被复制到您的包中。
如果您使用 Maven 构建包,您应该查看 maven-bundle-plugin 和 嵌入依赖项部分。
如果周围没有启用 OSGi 的 Axis2 库,我还建议仔细查看(我不使用它,所以我不知道它,但在 org.apache.axis2.osgi)。
You should consider to embed the Axis2 libraries (and dependencies) into your bundle. In this case Axis2 will not be deployed as own bundle - instead the classes/jars will be copied to into your bundle.
If you are using maven to build your bundle you should have a look at the maven-bundle-plugin and the Embedding dependencies section.
I also would recommend to have a closer look if no OSGi enabled Axis2 libraries are around (I do not use it, so I don't know it but a quick search results in org.apache.axis2.osgi).