Introduction to spring-remoting calls __ schema

Source: Internet
Author: User


1. General Introduction

Spring currently provides integration of remoting technologies such as Httpinvoker, Hessian, burlap, and so on.
Spring masks the differences in these implementation technologies by simply developing a simple Java object (Plain old Java Objects,pojo) and then writing the configuration file in the format of the spring specification, improving efficiency, and smooth switching between several modes of invocation. You only need to change the configuration file, and you do not need to change the specific code.


Comparative introduction
name Technology language
HTTP Invoker Transferring data based on Java serialization Java only supported
Hessian Data transmission based on binary stream A cross language with fewer bytes and better performance
Burlap Transferring data based on XML Cross-language, data redundancy, XML format Description good


2. Client Configuration

<bean id= "Productservicehessian" class= "Org.springframework.remoting.caucho.HessianProxyFactoryBean" >
        <property name= "serviceurl" value= "Http://127.0.0.1:8300/productService.servicehessian"/> <property
        Name= "Serviceinterface" value= "Com.xxxxx.biz.service.ProductService"/>
    </bean>
    
	 <bean id= " Productserviceburlap "class=" Org.springframework.remoting.caucho.BurlapProxyFactoryBean ">  
        <property Name= "serviceurl" value= "Http://127.0.0.1:8300/productService.serviceburlap"/> <property name=
        " Serviceinterface "value=" Com.xxxxx.service.ProductService "/>
    </bean>


3. Service-side configuration

<bean id= "Productservice" class= "Com.xxxxx.service.impl.ProductServiceImpl" ></bean>

<bean Name = "/productservice.servicehessian" class= "Org.springframework.remoting.caucho.HessianServiceExporter" >
        <property name= "service" ref= "Productservice"/> <property name= "Serviceinterface"
        Com.xxxxx.service.ProductService "/>
    </bean>
    
	<bean name="/productservice.serviceburlap "class = "Org.springframework.remoting.caucho.BurlapServiceExporter" >
        <property name= "service" ref= " Productservice "/>
        <property name=
    serviceinterface" value= "Com.xxxxx.service.ProductService"/> </bean>


4. Unit Test

Detailed introduction See: http://blog.csdn.net/lsblsb/article/details/39930503
5. Other

Minor problems encountered during the process:

Resolve hessianprotocolexception:expected string at 0x6d:http://blog.csdn.net/lsblsb/article/details/39994461

About Spring Httpinvoker calls are detailed in the following: http://blog.csdn.net/lsblsb/article/details/39930503

Reference: http://www.iteye.com/topic/417767

Java comparison of several remote service invocation protocols: http://www.360doc.com/content/12/0220/13/2795334_188038946.shtml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.