使用Spring 發布 基於Http的Burlap服務示例
Burlap它是一個基於XML的Hessian替代方案它的配置方法和上述Hessian的一樣只要把 Hessian 換成 Burlap 就行了
服務器端使用orgspringframeworkremotingcauchoBurlapServiceExporter 發布服務客戶端使用orgspringframeworkremotingcauchoBurlapProxyFactoryBean
使用Spring 發布 基於HTTP調用器暴露服務
和使用自身序列化機制的輕量級協議Burlap和Hessian相反Spring HTTP調用器使用標准Java序列化機制來通過HTTP暴露業務
但其配置與Burlap和Hessian很相近
服務器端配置:
<bean id=bookService class=comxmatthewspringremoteBookService>
</bean>
<bean name=/bookService class=orgspringframeworkremotinghttpinvokerHttpInvokerServiceExporter>
<property name=service ref=bookService/>
<property name=serviceInterface value=comxmatthewspringremoteIBookService/>
</bean>
客戶端配置:
<bean class=comxmatthewspringremoteclientBookQueryService>
<property name=bookService ref=bookService/>
</bean>
<bean id=bookService class=orgspringframeworkremotinghttpinvokerHttpInvokerProxyFactoryBean>
<property name=serviceUrl value=http://localhost:/bookService/>
<property name=serviceInterface value=comxmatthewspringremoteIBookService/>
</bean>
[] [] []
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28952.html