views:

134

answers:

4

Hi,

I have a pretty general question here. What is the best + reliable way for two applications running on the same machine to communicate with each other WITHOUT using web services or a web server of any kind.

as example:

application A: runs at .NET app that with active X controls can access another third party application and receive data.

application B: (lets assume is running java) wants to be able to start a process in application A with specific parameters and receive information back from application A. (no web services allowed)

the only thing I can think of is perhaps application B executing a file with certain parameters...then application A does any work and writes any return information into a database...but I don't know how reliable this is...or how application A would know when the data has been written to the database. (plus this sounds like a bit of a hackish solution to me..and was wondering is there anything better out there)

alright...thanks for any help!..

Andrew

+2  A: 

Using tcp sockets should be pretty reliable, even more so in the same machine. It doesn't need web services, web servers, etc - just a socket on each side.

Otávio Décio
Thanks!...if you don't mind could you elaborate ohow do tcp sockets stack up to web services?
Andrew
As Adam Frisby pointed out, there are xmlrpc and soap libraries to build inter process communication without needing a web server.
Otávio Décio
One more clarification if possible: by using xmlrpc and soap libraries do you just mean serializing my data into "SOAP form"...sending it over using sockets....then de-serializing it on the other end?....is there anything i'm missing here?
Andrew
Basically, for an object to be able to fit in a SOAP packet, after serialization it is encoded into base64. Since this isn't exactly performant, often MTOM(http://en.wikipedia.org/wiki/MTOM) is used for binary transmissions.
Yannick M.
so is that a yes? (only I have to convert it to binary also)
Andrew
It is a "you don't need to worry about it" when using webservices. The serialization and deserialization happens seemlessly. Or are you considering raw sockets?
Yannick M.
How is this the correct answer if you're going with WCF?
Yannick M.
+1  A: 

A socket will be fairly easy to setup; however I suggest looking into something more akin to SOAP or XMLRPC - both will be a lot easier when it comes to packing and unpacking the data. Both .NET and Java both have extensive access and libraries availible for both XMLRPC and SOAP (both providers and consumers).

Adam Frisby
Thanks,..just to clarify:When you say using soap do you just mean serializing my data into a SOAP object...sending it using a socket....then de-serializing it when it is sent?thus I would still be using sockets? only using SOAP as my "communication language"...do not hesitate to slap me if I am not making sense here
Andrew
Web services are typically bound to tcp sockets, but not necessarily. SOAP is just the communication protocol used to talk to the webservice. And your user objects are indeed serialized into something that will fit in the SOAP packet.
Yannick M.
A: 

As far as implementation is concerned, TCP sockets and web services are about as easy to set up on either side (client-server).

When performance is a consideration, TCP sockets will have the upperhand since there is less overhead.

But when it comes to useability, and ease of integration in the code I prefer web services. And honestly it is a much more transparent technology when it comes to debugging your code. The sockets counterpart will require more plumbing code before it gets useable.

Check out this article for more info on .NET and Java intercommunication via Web Services.

Yannick M.
A: 

In addition to all the answers I would alos like to say that I looked into WCF: http://en.wikipedia.org/wiki/Windows%5FCommunication%5FFoundation

This is what I am going to use. I found this article very helpful:

http://bloggingabout.net/blogs/dennis/archive/2007/04/20/wcf-simple-example.aspx

Andrew

Andrew