开发者

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

开发者 https://www.devze.com 2022-12-22 01:13 出处:网络
Is there an efficient t开发者_C百科ool to convert the .Net C# webservice to java webservice. Is there any open source tool that can help?Don\'t waste your time looking for a transition tool. If you we

Is there an efficient t开发者_C百科ool to convert the .Net C# webservice to java webservice. 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. 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, i.e. in a Windows service, web service, console app, etc.

Having ported applications in both directions (C#->Java and Java->C#), the manual effort IS your shortest path. 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.

Basically, take your lumps and roll your own. Follow @Padmarag's suggestion and stick with simplicity. The closest agreement between your two options (C# and Java) is a generated WSDL. This is a great way to get started with your base objects and operations.


I have never tried this, but maybe you could try to make a contract first web service in java with the wsdl of the c# web service.


A simple option would be to -

  1. create Web - Service in .Net
  2. Generate the WSDL
  3. Copy the WSDL to Java Project (possibly in Netbeans/ Eclipse)
  4. Implement the WSDL using reverse engineering - also called as "Start with WSDL" approach.
  5. Implement the generated methods.


Check this out:

http://www.cs2j.com/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号