views:

64

answers:

4

Is there an efficient tool to convert the .Net C# webservice to java webservice. Is there any open source tool that can help?

A: 

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.

Pablo Castilla
A: 

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.
Padmarag
I am looking for a tool that will help in getting the .Net implementation in java instead of rewriting the complete code.
Rachel
I doubt there's anything specifically for Web Services. This may be of interest to you - http://searchwindevelopment.techtarget.com/news/article/0,289142,sid8_gci1309978,00.html
Padmarag
This solution only helps to compile the code directly to Java byte code. I am looking for a one that can get the java source code.
Rachel
+1  A: 

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.

jro
A: 

Check this out:

http://www.cs2j.com/

jvenema