C++/VBScript/ASP wrapper for Java API calls

  • Thread starter Deleted member 4030
  • Start date
Status
Not open for further replies.
D

Deleted member 4030

Guest
Hey guys,

I've got a product which includes a Java API for creating a jsp/servlet interface back to the product's proprietary server.

However, the company is opposed to using Java on any of their servers. They do everything in ASP. Essentially, I have been forbidden from doing something as simple as installing ServletExec or JRun on the web server so we can do this in Java on IIS like we're supposed to.

Anyhow ... is there ANY way known to man that we could write ASP pages that made java API calls so our ASP could communicate with the proprietary server?

Am I even making sense? I've never heard of such a thing ...
 

temp

Seniorius Lurkius
44
If you want to use Java classes from ASP the simplest thing is to create a COM wrapper for the Java classes. This way you can use the Java classes as COM objects, and it'll work fairly transparently. Obviously you are going to be in trouble with anything that uses the awt or swing libraries, but guessing from your info this should not be a huge problem.

Microsoft VJ++ ships with an option to do exactly this out of the box, and my personal experience is that it is sufficiently solid to be useful in production environments. Specifically you will want the tool called javareg.exe. Unfortunately you are going to be limited to the Microsoft JVM, which means Java 1.1.8.

If Java 1.1 sounds a bit restrictive you could try JIntegra from linar. I haven't tested it in a production environment, but have heard positive things. This one costs real money, but if you have a budget you should definitely evaluate it.

IIRC there are a couple independent free efforts, but when I looked at them about 18 months ago they didn't seem to be much fun. A search on google might turn up a usable candidate though.
 

wb

Ars Legatus Legionis
25,208
Subscriptor
That doesn't make sense. So far as I know, you can't make calls to a java API if you don't have a JVM running on that machine. Of course you could set up a third machine to proxy COM (or whatever) calls to the java API, which talks to the proprietary server, which gets around your employer's restriction but still allows you to use the API mostly as it was intended.

Your next best bet might be to reverse engineer (or find documentation for) the communication going on between the java servlets and the proprietary server, and mimick that communication directly from ASP.
 
D

Deleted member 4030

Guest
WB: There is a JVM installed on the proprietary server. What I should have said is, they won't allow us to install Java on any web servers. Now that you mention it though, the JVM we are using probably violates that policy as well. Cripes. Your proxy idea sounds interesting as well, but procuring additional hardware is an enormous headache. It could take weeks (or months) just to get a box to try that out on.

Temp: I believe we are required to use 1.2 or better, so the VJ++ option you mentioned probably won't work. I will check out and propose the Linar idea too ...

Thanks for the ideas guys,
-Maharashii
 
I would use the JNI to make a dcom componnet on the Application server, wrapping the java API, then use DCOM to call this from the web server.

It is more work than it sounds (JNI is ugly as hell), but shouldn't be that bad.

If you can experiment, it might be possible to install the missing RMI functionality on the webserver (from MS, i forget the URL though, and use the 1.1 jvm to call the api through JNI - not too sure how well that would work).

Or, possibly the easiest, set up a web server on the application server, and redirect all calls to your application to that server.

I'm not too sure if they#d let you do that though.

Can you tell us what the product is? Someone might have done this sort of thing for that product before ...
 

wb

Ars Legatus Legionis
25,208
Subscriptor
I would use the JNI to make a dcom componnet on the Application server, wrapping the java API, then use DCOM to call this from the web server.

That's basically what I had in mind with the proxy. I guess it didn't occur to me that the proxy could be on the same machine as the other server.

BTW JNI isn't really that ugly, but you have to be religiously strict about following the rules regarding exception handling and multithreading.
 
D

Deleted member 4030

Guest
Originally posted by wb:
Right, but how are you going to call the API that talks to it (I assume from your remote machine)? You must have a JVM at both ends to make it work.

Uhm ... yeah. True. Proprietary Server has a JVM. The Web/App (IIS) Server running ASP-COMWrapper-Java would need a JVM.

However, I think we could get away with this since there would be no servlet engine (JRun, ServletExec, etc) installed on the IIS web server.

Technically, the Sun JRE is probably off-limits too, but they might be willing to bend that. They really don't want to run JSP/JavaBeans/Servlets on one of the IIS web servers.

Charley - you thoroughly confused me. The product is SiteMinder DMS.

thanks again,
maharashii
 
OK, sorry about that - I think the only one which will really fly is the DCOM wrapper.

You would write this in C++, using the JNI (a method of accessing the JVM from C++), and basically mirror the structure of each object in the API with a C++ COM component.

Then compile the whole thing as an exe, and place it on the app server.

Then register it with DCOM on the web server, so that the web applications can talk to the object over the networkusing DCOM (a method of accessing windows COM components over the network).

I hope that was clearer, the other post was mostly thinking out loud.

It will be tedious work, but not that difficult (as wb says, using JNI means following the rles exactly, and producing a lot of (to my mind at least) ugly C style code) - how long it will take depends more on the size of the API you will be wrapping.

You should get someone who has at least a passing familiarity with ATL and JNI to do it if possible.

BTW, I'm afraid I've never heard of siteminder, so no help there :(
 
Status
Not open for further replies.