tags:

views:

305

answers:

4

I hear that WCF is the new standard for communication across the network and applications in .net. The idea seems to make sense as well, provide standard interfaces for programs to communicate.

Here is my situation, I have a .net app i want to communicate to a ruby application though pipes. On the .net side (server) I would like to use WCF while the ruby side (client) will be chewing gum and duct tape.

I assume both ends don't need to be WCF but what will be involved in making this work. Is there a standard protocol WCF expects incoming requests?

A: 

Depends on your bindings, you can make your WCF a webHttp binding and make it restful (easiest) and you just do gets and posts. Other bindings you will have to use SOAP headers and such to communicate with your WCF, I have not done this myself, but im sure theres info out there on how to do it for non .net applications.

Daniel
A: 

You'll want to keep your contract as simple as possible (in terms of what types you expose). Though I have not tried this myself, I know that this type of functionality is supported (.Net to Java is a common usage) and relatively easy to do.

You don't mention which side (.Net or Ruby) will be the server, but I would expect that this will be much easier to do if you host the service in WCF and consume it from ruby. Going the other way around may be a bit more of a pain because mucking with the internals of WCF can be a bit of a pain.

akmad
Good suggestion on client server relation ship, I updated the post.
JustSmith
A: 

What sort of "pipes" are you referring to? You cannot use the named pipes bindings with any code that's not .NET.

You'll probably be better off with one of the HTTP bindings, like webHttpBinding or basicHttpBinding.

John Saunders
I am specifically looking to use named pipes. I though that one of the benefits of WCF was the protocol was independent of transport. Since ruby has a pipes lib shouldn't that be able to work?
JustSmith
I take that back. What I read recently is that the named pipes binding can only be used on the same machine. I also haven't seen the protocol details documented anywhere. Put that together and it doesn't make it impossible for you to use it with Ruby, but it may be impossible nonetheless.
John Saunders
A: 

Using the named pipes binding for non WCF clients could be possible, but it wouldn't be easy. You'd need to send the messages in the correct format for WCF to consume.

See this first or last entry on WCF message framing for a hint at the complexity. It's not impossible, but is it worth the effort?

Recommended is the http transport + some type of text or markup encoding, like basicHttpBinding or webHttpBinding.

Philip Rieck
Packing in ruby is fairly easy but translating the framing protocol from English to code may end up being more work than using the deprecated pipes lib.
JustSmith