Solved

.net to java conversion

Posted on 2011-09-02
2
296 Views
Last Modified: 2012-05-12
I have a complicated  .net web services application that I personally would like to convert into java.

What is the best way of approaching this if I am to do this myself. It would appear that the .net world uses lots of wizards in visual studio to generate code. What is the best way of understanding the .net code in order to create a java equivalent.

Following on from this, what are the current java technologies that deal with web services and integrating with a database. I have an adobe flex based client application that connects to the web services.

Any help much appreciated.

Paul
0
Comment
Question by:plambkin1
2 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 400 total points
ID: 36476724
look at this:
http://stackoverflow.com/questions/2400357/is-there-an-efficient-tool-to-convert-the-net-c-webservice-to-java-webservice
and read this answer below.
Sounds to me like the words of a wise man:
-----------------------

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.
---------------------------------

These are some  tutorials for building web services with Java

http://www.roseindia.net/webservices/buildingsimplewebservice.shtml

http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/reference/tutorials/wsit/doc/Examples_glassfish4.html



0
 
LVL 26

Assisted Solution

by:dpearson
dpearson earned 100 total points
ID: 36481231
I would agree that the best approach is to just convert the code manually.  You may be unaware of the history but C# was originally Microsoft's implementation of Java.  Sun didn't like what they were doing over in Redmond (since Microsoft was adding features that would only work on Windows) and eventually Microsoft broke it off as a separate language.

But as a result C# and Java are exceptionally close.  A lot of the libraries are the same and a lot of the "porting" work is merely changing the names of types - sometimes as trivially as "String -> string" etc.

I've ported from Java to C# before and it's not a lot of work to do by hand.

Doug
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 87
Reading the Web.Config using IIS 7.5? 4 36
Printing 1 51
updating order of the rows, N+1 query issue, C#, asp.net, MVC, SQL Server 3 26
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question