Solved

.net to java conversion

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

757 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

20 Experts available now in Live!

Get 1:1 Help Now