tags:

views:

158

answers:

3

What is the the most hassle-free (even commercial) way to consume a Java service (resides in Spring container) from c# ?

A: 

Is it a SOAP/XML compliant service? If so, just register it is a web service in the application.

Stephen Wrighton
A: 

IMO, WCF would probably be your best bet for consuming a Spring web service.

I'm not familiar with the SOAP or WS-* protocols that Spring offers, but at a basic minimum WCF with BasicHttpBinding would most likely do the trick.

Easiest route to doing that: Add a Service Reference to the project from which you wish to call the Java/Spring service.

Randolpho
A: 

Here is a suggestion from the following url that you may find helpful: http://forum.springsource.org/showthread.php?t=65348

What about Hessian or Burlap. It is the same concept, and all you would have to change impl class in your xml from HttpInvoker Exporter and FactoryBean classes to Hessian or Burlap Exporters and FactoryBeans.

The difference between the two is one is in binary and one is in plain text, but both serialize your object to xml and pass it back and forth. There is implementations of Hession and Burlap in .net too.

Here is a source for hessian in c#: http://sourceforge.net/projects/hessiancsharp/

Here is how you can convert your service: http://static.springsource.org/spring/docs/2.0.8/reference/remoting.html

If I was doing this I would go to a service and processor abstraction, so all the service does is validate and then pass to the processor, and have all the business logic in the processor that may be in the service currently.

This way you can use Hessian or Burlap, or just use Jax-WS or some other webservice, if you want, and the service layers are not doing anything but calling functions in the processor.

James Black