开发者

Way to consume a Java-Spring Service from .NET

开发者 https://www.devze.com 2022-12-10 02:14 出处:网络
What is the the m开发者_如何学编程ost hassle-free (even commercial) way to consume a Java service (resides in Spring container) from c# ?Here is a suggestion from the following url that you may find h

What is the the m开发者_如何学编程ost hassle-free (even commercial) way to consume a Java service (resides in Spring container) from c# ?


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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号