views:

30

answers:

1

I'm looking for a way to access a Java API from both a Java console application and an ASP.Net application.

In short my Java API exposes a series of methods for dealing with invoices. All of these methods are essentially commands e.g.

  • GenerateAllInvocies
  • GenerateInvoiceNumber
  • PrintAllInvoices
  • PrintInvoiceNumber

All methods will interact with the database. I had believed Web Services was going to be my means for interop. But I have since been made aware of Java Stored Procedures in Oracle.

I believe this means I could essentially treat my stored procs as an API and have the stored procs themselves call appropriate Java to write invoices to disk and to print the invoices etc. However this feels slightly odd.

Has anyone out there every used Java stored procedures to provides interop between calling Java and .Net applications before? Any suggestions? Is this a really bad idea?

Thanks.

+1  A: 

This would mean you would access the stored procedures via SQL. Given the nature of the calls (as deduced from the names) I find this very counter-intuitive, not to mention you'll tie yourself to oracle.

Why not expose the functionality via web services for the asp.net app and do the same for the command line java app or just access the calls directly.

Marc van Kempen
Thanks for the feedback. How do I access the Java API calls directly from ASP.NET?
Peanut
If you don't want to go the web service route, I guess you could expose the calls via JNI. See for example:http://forums.devshed.com/net-development-87/jni-in-c-367254.html
Marc van Kempen