Solved

.net to java conversion

Posted on 2011-09-02
2
295 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now