Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enterprise Question? 2

Status
Not open for further replies.

BZJavaInst

Programmer
Jan 17, 2001
67
US
Has anyone ever tried to have a Java Servlet communicate with a non-Java program, such as Visual Basic 6.0. We have some Visual Basic programs that run as ActiveX Servers (without GUI) on a Win NT server and we were wondering if you could pass objects between the two languages? I suspect that Corba is the only thing that would allow this. We are trying to be platform independent on our Client Browser's machines, but have Java Servlets and Visual Basic programs do all the 3 tier work behind the scenes. Servlets communicating with Applets or JSP pages, etc. Unfortunately, we would like to keep a few of these VB and C++ programs running and have them interface with Java Servlets on a Windows NT or 2000 platform.

Will Corba allow this? Is there any other way to do this or can objects be directly passed to Servlets some how through ObjectStreams?

Looking for any expert approach or opinion.

Thanks,
Brian
 
Brian,

> Has anyone ever tried to have a Java Servlet communicate with a non-Java program,

Yes, using JNI.

> wondering if you could pass objects between the two languages?

What kind of objects? If you can get the two languages to use the same 'Object technology' then the answer is yes. Natively that just is not going to work you can't create a Java class instance in Basic or C or C++ or any other language than Java, at least not without some intermediate code to do all the work for you to transform the data into a language dependant instance. Now if you want to use Corba or COM objects, then yes that can be done.

> VB and C++ programs running and have them interface with Java
> Servlets on a Windows NT or 2000 platform.

'Programs'? What do you mean by that? If they are executables then you need to use some interprocess communication protocol to accomplish that, i.e., Corba, RPC, Sockets, Shared files, etc.

If they are windows DLL's then you can use JNI to make function calls from Java into the DLL's. Again you will not be able to send 'Java Objects'. You will need to use compatible data types to pass as paramters.

Hope this helps
-pete


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top