Especially when it comes to academia a lot of open code is all in Java. In fact, some absolutely awesome projects are in java (LingPipe being why I’m writing this article). Unlike Lucene or Hibernate, LingPipe hasn’t seen a port to C’# just yet, as such, I need to figure a way of getting LingPipe in Java to play nicely with my C# project. Looking at solutions there are all kinds of methods including:
- Proprietary frameworks claiming high performance easy interop (Google them!)
- Writing your own communications layer through TCP to pass data and deal with object serialization etc.
- Or even better… Project Tango at https://wsit.dev.java.net/, now AKA WSIT. This implements Windows Communication Foundation (WCF) endpoints in Java – dead cool!
I’m having a play now, if I can get it to work well then I’ll post up some code examples. http://www.kevingao.net/wcf-java-interop/wcf-and-java-interop-series-introduction.html looks like a brilliant tutorial and sample site for using WSIT.
Update: A few days on…
Well, I had a look at WSIT and it does indeed look really cool. However my requirements are somewhat basic – and the deployment requirements for WSIT applications are towards a Java application servers – way overkill in my situation! As such, I have created my own basic ‘protocol’ over a TCP stream where the C# app has an adapter class that acts as a TCP client to a Java-based Windows service that is bound to a local (127.0.0.1) port and constantly listening. Does the job quickly and just fine for me! I will try and get some code posted for examples soon.
