?
Solved

.net to java conversion

Posted on 2011-09-02
2
Medium Priority
?
305 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 1600 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 28

Assisted Solution

by:dpearson
dpearson earned 400 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month5 days, 7 hours left to enroll

601 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