Can I communicate between c# application and node.js code?

I have no experience with node.js, so therefore i need to clarify something.

I have a c# application and a node.js application. I would like to press on a button, in my c# application, and send 3 arguments to a node.js application/function as input.

Is this possible? (straight forward)

edit: Both applications run on the same machine. The c# application would provide 3 arguments to the node.js application. The node.js application would query a web service (POST), receive some XML data and manipulate that data. I know that i could do that task in c# too, but in this case it has to be node.js.

edit2 and solution: right now i have choosen: 4. Your node process runs a socket server and your C# app does requests over tcp.

I will also provide a solution that seems to work:

Now you are ready to send any data from your c# application to the node.js server.

Yes communication is possible like several people have pointed out in your question's comments.

These are (some of) the options:

  1. Your node process runs an http server and your C# app does JSON Rest requests over http
  2. Your node process runs a SOAP webservice using the node-soap module
  3. C# app starts your node app and you do IPC by writing to the node process inputstream and read it's outputstream.
  4. Your node process runs a socket server and your C# app does requests over tcp.
  5. You use a 3rd process/server like Redis or a Message Queue
  6. Anything that allows you to share data like files..

I would recommend you go for the first option as that doesn't require you to define a language protocol to send over the "wire". The other reason would be that there is a lot of documentation available on doing Rest with C# and node.js.

As the client library in C# I would suggest you have a look at Restsharp as the client library if you can't use the latest version of .NET (4.5). If you can use the latest version, use HttpClient to call your Node.js restservice. For Node just use Express.

Option 2 might be quick as there is good support in VS for webservices, however, I have only used node-soap as a client so can't comment on how well the node-soap webservices are with C# clients.