Spring HTTP 遠程調用 web
A. 提供服務的應用spring
web.xml 文件中:app
<servlet>
<servlet-name>remote</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>remote</servlet-name>
<url-pattern>/remote/*</url-pattern>
</servlet-mapping>url
remote-servlet.xml 文件中spa
<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">xml
<beans>
<bean name="/SsoService" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
<property name="service"><ref bean="ssoService"/></property>
<property name="serviceInterface">
<value>com.openid.security.service.SsoService</value>
</property>
</bean>
</beans>rem
B.調用服務的應用get
<bean id="ssoService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl">
<value>http://192.168.0.18:8000/security/remote/SsoService</value>
</property>
<property name="serviceInterface">
<value>com.openid.security.service.SsoService</value>
</property>
</bean>servlet