从 java .war 文件创建 dll
我有一个外部工具,它是一个 tomcat web 服务(以 .war 形式分发),我想从 .net 使用它。我有一个相当复杂的环境,我不想在生产机器上添加更多移动部件(tomcat、java 等)。有没有办法将应用程序转换为dll?
I have an external tool that is a tomcat webservice (distributed as a .war) that I would like to use from .net. I have a fairly complex environment and I would like to not have to deal with adding more moving parts (tomcat, java, etc) to the production machines. Is there a way to convert the app to a dll?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
恐怕您唯一的选择就是在 Java 环境中部署 WAR,然后从 .NET 环境中调用它。
我可以推荐 Jetty 来部署 WAR,我的体验比使用 Tomcat 好得多。它更简单,启动更快,错误更容易理解。 (但显然任何 Java Web 容器都可以。)
然后从 .NET 代码调用 Java 服务。看起来 Java 代码已经提供了 Web 服务,因此您需要在 .NET 中为其构建一个客户端。如果它使用像 SOAP 这样的标准 Web 服务协议,那么应该有很多可用于 .NET 的库来允许您执行此操作。
可惜没有快速自动的方法将 Java 转换为 .NET。所以这是你唯一的选择。
I'm afraid the only option you have is to deploy the WAR in a Java environment and then call it from your .NET environment.
I can recommend Jetty for deploying the WAR, I have had much better experiences than using Tomcat. It's simpler, starts up faster, the errors are easier to understand. (But obviously any Java web container will do.)
Then call your Java service from your .NET code. It seems like the Java code already offers a web service, so you need to build a client for that in .NET. If it uses a standard web service protocol like SOAP there should be lots of libraries available for .NET to allow you to do that.
There is no quick automatic way to convert Java into .NET alas; so this is your only option.
.dll
完全是 Windows 特定的东西,而.war
完全是 jvm 特定的东西。我认为你不会找到它的工具/转换器。
我建议使用 .net 中的网络服务
.dll
are totally windows specific things where.war
is totally jvm specific thing.I don't think you will find tool / converter for it.
I would suggest consume web Services from your .net
根本不可能。值得庆幸的是,将此工具作为 Web 服务意味着您只需 JVM 和 servlet 容器即可使用它,而不必完全重写它。当谈到应用程序集成时,这是一个非常简单的情况。
Utterly impossible. Be glad that having this tool as a webservice means you only need a JVM and a servlet container to use it, rather than having to rewrite it completely. When it comes to application integration, this is a very easy case.