1.引用所需jar包:
cxf-2.2.7.jar
spring-2.0.6.jar
wsdl4j-1.6.2.jar
XmlSchema-1.4.5.jar
2。编写spring配置文件(applicationContext.xml):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<!-- 登陆接口测试类 -->
<bean id="testLoginService" class="com.oohla.client.test.TestLoginService" init-method="testMethod">
<property name="loginService" ref="loginService"></property>
</bean>
<!-- 创建登陆接口 -->
<bean id="loginService" class="com.oohla.sso.user.LoginService"
factory-bean="proxyLoginService"
factory-method="create"/>
<!-- 登陆接口工厂 -->
<bean id="proxyLoginService" class="org.apache.cxf.frontend.ClientProxyFactoryBean">
<property name="serviceClass" value="com.oohla.sso.user.LoginService"/>
<property name="address" value="http://uni-plat.oohla.com:19000/api/v1/sso/user/LoginService"/>
</bean>
</beans>
3。引入接口所需java类:
4。编写测试方法:
public class TestLoginService {
private LoginService loginService;
public void setLoginService(LoginService loginService) {
this.loginService = loginService;
}
public void testMethod(){
try {
AppLoginReturnInfo returnInfo = loginService.appLogin("mizhao","111111","http://www.baidu.com");
System.out.println(returnInfo.getRedirectUrl());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
分享到:
相关推荐
OSGI + Webservice 例子 新手入门的例子
osgi-webservice教程 教授你如果通过osgi架构开发java的webservice
osgi webservice入门
基于OSGi和Spring开发Web应用
基于OSGi和Spring开发Web应用
基于OSGi和Spring开发Web应用的博文对应的代码
Axis2是目前比较流行的WebService引擎。WebService被应用在很多不同的场景。OSGi 框架为基于 Java 的组件开发提供了一套通用的和标准的解决方案,通过 OSGi 框架可以轻松实现组件信息的隐藏和共享。
基于OSGi和Spring开发Web应用教程 教程
java web OSGi (Open Services Gateway Initiative) provides a programming model for service components. Programming based on OSGi can bring many advantages, such as modular, standardized, service ...
基于OSGi和Spring开发企业级Web应 目前OSGi和Spring已经受到了广泛的关注,如果我们将OSGi和Spring结合,更能充分发挥二者各自的特长,同时更好地满足企业级应用开发的需求。
cxf插件使osgi能够发布webService
1、自己开发的OSGi Web Console,适用于实现了OSGi规范的Equinox、Felix等...2、展示了如何把OSGi框架作为一个组件嵌入到现有的未基于OSGi开发的Web应用当中,在Web应用中可获取OSGi中的Service以增加应用的灵活性。
开发一个简单的 OSGi Web 应用实例,如何进行OSGI开发的 实例有利于入门着进行使用
我转载的博客“OSGi环境下建立Web工程的Hello World ”中列出的jar,结合博客“OSGi环境下建立Web工程的Hello World ”开发应用。
给出了可用插件bridge和一个可用osgi例子,可以帮助学习osgi的同学学习部署osgi程序到tomcat中。
基于 OSGi 和 Spring 开发 Web 应用
实现并安装JavaWebService接口,Web服务将自动成为入口点。 从源代码构建 git clone https://github.com/mhus/mhus-osgi-tools.git mhus-osgi-tools cd mhus-osgi-tools mvn install 与Maven一起使用 变更版本 附加...
在felix2.0.1扩展Hibernate,使之工作于OSGI框架之中。
osgi介绍osgi介绍osgi介绍osgi介绍osgi介绍osgi介绍osgi介绍osgi介绍osgi介绍osgi介绍