I guess it depends somewhat on the functionality of the class library, and how easy it is to interoperate with it from another language. Java classes can be COM registered with JavaReg on windows servers which mean you could use COM Interop to get access to it from within VB.NET.
I haven't done since .NET was in alpha, so you will need to try it and see if it still works.....
If you have a Java class file containing a public method called SayHello() fro example....compile it using javac as normal.
import java.io.*;
public class javaNet{
public String SayHello()
String ret = "Hello from Java in .NET";
return ret;
}
}
Take the class and put it in winnt/java/trustlib. run regsvr32 against it to
create a registration entry for the class using this line of code - you
obviously need regsvr32 from ms to do this.
javareg /register /class:javaNet /progid:javaNet
Then simply call it as you would any latebound COM object.
<%@ Page Language="VB" ClientTarget="downlevel" %>
<%@ Import NameSpace="System.Web.Util" %>
<%
Dim XYZ As Object
XYZ = Server.CreateObject("JavaNet")
Response.Write (XYZ.SayHello())
%>
You might need to add trustlib to your classpath.
You can find this example, and a copy of JavaReg if I remember correctly at the Wrox press site, as this was covered in Professional JSP release 2
http://www.wrox.com/dynamic/books/download.aspx?isbn=1861004958&email=
It is being decommisioned by MS as Sun (in their wisdom) appear to have messed up somewhat with their lawsuit of MS and shot themselves in the foot as MS have dropped all Java support - including Javareg and the SDK it used to come in.
I would suspect that in the release version of .net that this approach of JavaReg might not work without using RegaAsm and creating a TLB wrapper for your component, then sticking it in the GAC.
So, coming back to your intial thoughts - you may save yourself a lot of work by using a bridge after all, or decompiling the class, and using the Java converion assistant at http://msdn.microsoft.com/vstudio/downloads/tools/jlca/default.asp to convert the code in the class you have acquired to C#.
If it was me, I would run a version of Tomcat alongside IIS, and get the webservice working instead, but I guess it depends on how much work there is to do.
Regards
John Timney (Microsoft ASP.NET MVP)