Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

Any pointer to get C#/Java interaction?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
christery@gmail.com - 10 Dec 2007 10:40 GMT
Got at java consumer to a producer that I want to connect to a pref.
C# or some other .net app,

on the producer side we went with java->jni- (thanks javah)>C->fortran
program connecting to our rdb database but I hope thats not the thing
to do on the windows end...

can it be done in a more simple way?

got the java app consumer up and running but would like to make it
into an dll and add a ref to it... cant just figure out how... ideas?
Or another (better) solution? pref without having to go jni/c again...

//CY
Jon Skeet [C# MVP] - 10 Dec 2007 10:44 GMT
On Dec 10, 10:40 am, christ...@gmail.com wrote:
> Got at java consumer to a producer that I want to connect to a pref.
> C# or some other .net app,
[quoted text clipped - 8 lines]
> into an dll and add a ref to it... cant just figure out how... ideas?
> Or another (better) solution? pref without having to go jni/c again...

Could you give more details about what you need to do? Are these
*data* producers/consumers, which you could hook up with a web service
for instance, or do you actually need direct "in process" interaction?

Jon
christery@gmail.com - 10 Dec 2007 11:22 GMT
> Could you give more details about what you need to do? Are these
> *data* producers/consumers, which you could hook up with a web service
> for instance, or do you actually need direct "in process" interaction?
>
> Jon

The producer/consumer is an SOA implemented project as a pilot, with
corba for transferring data (VMS->WIN and WIN->WIN), no webservice as
far as I can see (but havent worked with that so, what do I know),
this is built on OpenSis and works great, but i need to get the data
over to our normal .net environment - or get all others to go java...

about the in process, we got one of the srevices to implement event
handlig, the other just work with asking for data, so both sync/async.

for the one handelning events its importent to get events, not polling
- its a mesage broker and should not add to the latency of transfer.

//CY
Jon Skeet [C# MVP] - 10 Dec 2007 11:55 GMT
On Dec 10, 11:22 am, christ...@gmail.com wrote:
> The producer/consumer is an SOA implemented project as a pilot, with
> corba for transferring data (VMS->WIN and WIN->WIN), no webservice as
> far as I can see (but havent worked with that so, what do I know),
> this is built on OpenSis and works great, but i need to get the data
> over to our normal .net environment - or get all others to go java...

If it's all SOA, then you just need to make sure that whatever service
is exposing the data does so in an architecturally neutral manner,
e.g. over a SOAP web service. You shouldn't need anything like JNI.

> about the in process, we got one of the srevices to implement event
> handlig, the other just work with asking for data, so both sync/async.
>
> for the one handelning events its importent to get events, not polling
> - its a mesage broker and should not add to the latency of transfer.

I'm not really sure I understand this part - if it's genuinely service-
oriented, you shouldn't need to hook into another process, you should
just be able to send messages to it.

Jon
christery@gmail.com - 10 Dec 2007 13:24 GMT
> I'm not really sure I understand this part - if it's genuinely service-
> oriented, you shouldn't need to hook into another process, you should
> just be able to send messages to it.
>
> Jon

Uhmm, what I got is a working fine but in java, service oriented
arcitechture dosent imply web service, neither corba, or anything
else... and yes I am trying to use this without or without seeing java/
corba (loose cupling) but HOW? Still have to reuse the idl/sdl
generated interfaces produces the header file and implement the in c
and the make the .net code from there .... well if no one knows...

ill go that way... work work work...

//CY
Jon Skeet [C# MVP] - 10 Dec 2007 13:48 GMT
On Dec 10, 1:24 pm, christ...@gmail.com wrote:
> > I'm not really sure I understand this part - if it's genuinely service-
> > oriented, you shouldn't need to hook into another process, you should
[quoted text clipped - 3 lines]
> arcitechture dosent imply web service, neither corba, or anything
> else...

It usually implies an language neutral service, however - certainly
not something where you need to hook into the same process. While it
doesn't *have* to be language neutral, that's often one of the points
of making it SOA to start with - allowing for many different kinds of
clients.

> and yes I am trying to use this without or without seeing java/
> corba (loose cupling) but HOW? Still have to reuse the idl/sdl
> generated interfaces produces the header file and implement the in c
> and the make the .net code from there .... well if no one knows...

I would see if there are any CORBA service consumers for .NET - I
wouldn't start going to C interop unless you have to.

Jon
Jon Skeet [C# MVP] - 10 Dec 2007 14:06 GMT
> I would see if there are any CORBA service consumers for .NET - I
> wouldn't start going to C interop unless you have to.

Have a look at http://remoting-corba.sourceforge.net/

Jon
Arne Vajhøj - 11 Dec 2007 03:18 GMT
> Got at java consumer to a producer that I want to connect to a pref.
> C# or some other .net app,
[quoted text clipped - 7 lines]
> got the java app consumer up and running but would like to make it
> into an dll and add a ref to it... cant just figure out how... ideas?

You want:

C#--(?)--Java------(network)------Java--(JNI)---C--Fortran--RDB

?

Obvious solutions are the one you mention:

C#--(DllImport)--C--(JNI)--Java-->

and to find a third party component that can wrap a
Java bean as a COM component so you can use:

C#--(COM)--X--Java-->

(that X will use some JNI internally is not your problem)

Arne
Arne Vajhøj - 11 Dec 2007 03:23 GMT
>> Got at java consumer to a producer that I want to connect to a pref.
>> C# or some other .net app,
[quoted text clipped - 24 lines]
>
> (that X will use some JNI internally is not your problem)

Additional comments relating to alternatives:

1)

I assume you have your reasons for --Java--C--Fortran--RDB instead
of just --Java--C--RDB.

2)

Or even better:

--Java--(JDBC)--RDB

3)

It would be much simpler if the Java code was not in process:

C#--(socket)--Java-->

is very straightforward. And practically any functionality should
be possible to implement over a socket.

4)

If you go that route and assuming that do not have too much
functionality invested in that Fortran code then why not combine
#2 and #3:

C#----------(network)------------Java--(JDBC)--RDB

A much simpler model.

Arne
christery@gmail.com - 12 Dec 2007 19:51 GMT
> 4)
>
[quoted text clipped - 9 lines]
>
> - Visa citerad text -

Ohh, its (the fortran progam) jumping around in the database on its
own (after a startpoint from rdb) always knowing where the next val is
in chunks on 50 real val on second values , lagrer on minutes or
presenting aggreagtees in another table ... depending on what you ask
for... and so on - using math not database all the time, not wanting
to go in there...
we sort of presave data (running 0 in to a contingues area) for each
new log/packets of logs and then know how its stored for  all its
lifetime, it is a circular buffer. Get great prestanda but I dont want
to make any misstakes in the programming there.

I'm Starting with looking for X in C#--(COM)--X--Java--> ... but it
might all be as easy as c# -> wrapper dll in C -> jni -> java... now
that we done something like that in OpenVMS...

Thanks for the inputs.

//CY
Vitaly Shelest - 03 Jan 2008 19:25 GMT
It is very easy to interact Java->.NET and .NET->Java.
Get JNI SDK for .NET 1.1
http://www.simtel.net/product.php[id]95126[SiteID]simtel.net
for .NET 2.0
http://www.simtel.net/product.php[id]98653[SiteID]simtel.net

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.