简体   繁体   English

是否存在将.Net C#Web服务转换为Java Web服务的有效工具?

[英]Is there an efficient tool to convert the .Net C# webservice to java webservice?

Is there an efficient tool to convert the .Net C# webservice to java webservice. 是否有将.Net C#Web服务转换为Java Web服务的有效工具。 Is there any open source tool that can help? 有没有可以帮助您的开源工具?

Don't waste your time looking for a transition tool. 不要浪费时间寻找过渡工具。 If you were working with Java 1.4 and maybe C# 1.x, there was a beta utility from Microsoft that did on-par conversion between the two. 如果您使用的是Java 1.4,也许使用的是C#1.x,那么Microsoft提供了一个beta实用程序,可以在两者之间进行按标准转换。 But that was a long time ago, and they don't publish the utility any longer. 但这是很久以前的事了,他们不再发布该实用程序。 Even then, the utility would only convert source code at the language level, as opposed to dealing with the separate languages' implementation, ie in a Windows service, web service, console app, etc. 即使那样,该实用程序也只会在语言级别转换源代码,而不是处理单独的语言的实现,即在Windows服务,Web服务,控制台应用程序等中。

Having ported applications in both directions (C#->Java and Java->C#), the manual effort IS your shortest path. 双向移植了应用程序(C#-> Java和Java-> C#)之后,手动操作是您最短的途径。 Any tool that suggests otherwise is likely a poor implementation. 否则的任何工具都可能是较差的实现。 You're making modifications in either case. 无论哪种情况,您都需要进行修改。 Convert-and-update is slower than writing-from-scratch. 转换和更新比从头写入要慢。

Not to suggest this, but if the basis for your approach is not time-savings but rather a lack of understanding C#, then a conversion tool is only going to cause you more problems because it will hide the true intention of the source code. 并不是建议这样做,而是如果您的方法的基础不是节省时间,而是缺乏对C#的理解,那么转换工具只会给您带来更多问题,因为它将隐藏源代码的真实意图。

Basically, take your lumps and roll your own. 基本上,把自己的肿块自己滚。 Follow @Padmarag's suggestion and stick with simplicity. 遵循@Padmarag的建议并坚持简单。 The closest agreement between your two options (C# and Java) is a generated WSDL. 您的两个选项(C#和Java)之间最接近的协议是生成的WSDL。 This is a great way to get started with your base objects and operations. 这是入门基础对象和操作的好方法。

我从没有尝试过,但是也许您可以尝试使用c#Web服务的wsdl在Java中创建第一个合同Web服务。

A simple option would be to - 一个简单的选择是-

  1. create Web - Service in .Net 在.Net中创建Web服务
  2. Generate the WSDL 生成WSDL
  3. Copy the WSDL to Java Project (possibly in Netbeans/ Eclipse) 将WSDL复制到Java项目(可能在Netbeans / Eclipse中)
  4. Implement the WSDL using reverse engineering - also called as "Start with WSDL" approach. 使用逆向工程实现WSDL-也称为“从WSDL开始”方法。
  5. Implement the generated methods. 实现生成的方法。

Check this out: 看一下这个:

http://www.cs2j.com/ http://www.cs2j.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM