|
Hello,
We have written an application that does several finctions in VB 2005. Now, we wish to integrate with another application written in JAVA. This needs to be done in a way that enables the JAVA app to call/trigger functions in the VB app. What is the best method to do that?
Also, how can we create our own API for the VB application? So that the application can be integrated with easily?
Appreciate your assistance.
|
| Leedo Wednesday, February 13, 2008 3:03 PM |
It depends on what this two applications should do. In a scenario where your VB application make some kind of server tasks and you use a JAVA based client I would consider using webservices to connect the application, because this technology is well known in Java as well as in .net.
If you just want to programm a library in .net and reuse in in JAVA there is a thing called JNI (Java Native Interface), but as I am not a Java geek I cannot really tell you how to use it. Refer to Sun's documentation for this (http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html).
Hope this helps to get started.
|
| BrainWasher Wednesday, February 13, 2008 3:42 PM |
Actually it is very simple to make a webservice. All you have to do is wrting the keyword <WebMethod()>in the function definition and this method will be exposed as a webservice.
You can create a web service by creating a new project in VS and selecting ASP.net Web Service. Some (very short and easy) explanation can be found there: http://www.vbdotnetheaven.com/UploadFile/mmehta/SimpleWebService04262005065102AM/SimpleWebService.aspx
I cannot really tell you how to consume a webservice in Java, but maybe this site tells you what to do:
https://jax-rpc.dev.java.net/whitepaper/1.1/index-part2.html#Scenario2
If not you can simply search for information how to make Java talking to an existing webservice. |
| BrainWasher Thursday, February 14, 2008 12:52 PM |
It might be possible by integration a web server into your application, but without knowing how big your project is (for a very small application it might give too much overhead), I would rather suggest to consider a structure like this:
VB App --> VB Webservice <-- Java App
And running the webservice on a machine with IIS installed and doing the things the applications need to share. So you actually have two clients (a VB and a Java) and the webservice doing the interaction. |
| BrainWasher Monday, February 18, 2008 9:20 AM |
It depends on what this two applications should do. In a scenario where your VB application make some kind of server tasks and you use a JAVA based client I would consider using webservices to connect the application, because this technology is well known in Java as well as in .net.
If you just want to programm a library in .net and reuse in in JAVA there is a thing called JNI (Java Native Interface), but as I am not a Java geek I cannot really tell you how to use it. Refer to Sun's documentation for this (http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html).
Hope this helps to get started.
|
| BrainWasher Wednesday, February 13, 2008 3:42 PM |
Thanks .. it is sure good start. I am thinking to start searching for creating a web service for my VB app. Could you refer me for any info relating to this issue?
Appreciate it.
|
| Leedo Thursday, February 14, 2008 8:26 AM |
Actually it is very simple to make a webservice. All you have to do is wrting the keyword <WebMethod()>in the function definition and this method will be exposed as a webservice.
You can create a web service by creating a new project in VS and selecting ASP.net Web Service. Some (very short and easy) explanation can be found there: http://www.vbdotnetheaven.com/UploadFile/mmehta/SimpleWebService04262005065102AM/SimpleWebService.aspx
I cannot really tell you how to consume a webservice in Java, but maybe this site tells you what to do:
https://jax-rpc.dev.java.net/whitepaper/1.1/index-part2.html#Scenario2
If not you can simply search for information how to make Java talking to an existing webservice. |
| BrainWasher Thursday, February 14, 2008 12:52 PM |
Well, my app is a windows forms app. Webservice seems like the most straight forward solution here. I know it is meant for ASP.NET applications, but can one be created and explosed from within a Windows Forms application like my VB 2005 app??
Thanks |
| Leedo Saturday, February 16, 2008 11:46 AM |
It might be possible by integration a web server into your application, but without knowing how big your project is (for a very small application it might give too much overhead), I would rather suggest to consider a structure like this:
VB App --> VB Webservice <-- Java App
And running the webservice on a machine with IIS installed and doing the things the applications need to share. So you actually have two clients (a VB and a Java) and the webservice doing the interaction. |
| BrainWasher Monday, February 18, 2008 9:20 AM |