WebService之CXF注解之四(測试类)

TeacherTest.java:

/**
 * @Title:TeacherTest.java
 * @Package:com.test.service
 * @Description:
 * @author:Youhaidong(游海东)
 * @date:2014-5-5 下午11:14:09
 * @version V1.0
 */
package com.test.service;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

import com.you.model.Teacher;
import com.you.service.ITeacherService;

/**
 * 类功能说明
 * 类改动者 改动日期
 * 改动说明
 * <p>Title:TeacherTest.java</p>
 * <p>Description:游海东个人开发</p>
 * <p>Copyright:Copyright(c)2013</p>
 * @author:游海东
 * @date:2014-5-5 下午11:14:09
 * @version V1.0
 */
public class TeacherTest
{

	/**
	 * @Title:main
	 * @Description:
	 * @param:@param args
	 * @return: void
	 * @throws
	 */
	public static void main(String[] args)
	{
		JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        	factory.getInInterceptors().add(new LoggingInInterceptor());
        	factory.getOutInterceptors().add(new LoggingOutInterceptor());
        	factory.setServiceClass(ITeacherService.class);
        	factory.setAddress("http://localhost:8686/Webservice/services/testTeacher");
        	ITeacherService client = (ITeacherService) factory.create();
        	Teacher teacher = new Teacher();
        	teacher.setTeacherNum("2007101208");
        	teacher.setTeacherName("李思思");
        	teacher.setTeacherAge("38");
        	teacher.setTeacherSex("女");
        	teacher.setTeacherQQ("5623564545");
        	String info =  client.findTeacherInfo(teacher);
        	System.out.println(info);  

	}

}
时间: 2024-10-12 19:58:22

WebService之CXF注解之四(測试类)的相关文章

WebService之CXF注解之四(测试类)

TeacherTest.java: /** * @Title:TeacherTest.java * @Package:com.test.service * @Description: * @author:Youhaidong(游海东) * @date:2014-5-5 下午11:14:09 * @version V1.0 */ package com.test.service; import org.apache.cxf.interceptor.LoggingInInterceptor; imp

WebService之CXF注解报错(二)

WebService之CXF注解 1.具体报错如下 五月 04, 2014 11:24:12 下午 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass 信息: Creating Service {http://service.you.com/}IServiceService from class com.you.service.IService 五月 04, 2014 11:

WebService之CXF注解之一(封装类)

Teacher.java: /** * @Title:Teacher.java * @Package:com.you.model * @Description:老师封装类 * @author:Youhaidong(游海东) * @date:2014-5-5 下午11:03:13 * @version V1.0 */ package com.you.model; import java.io.Serializable; /** * 类功能说明 * 类修改者 修改日期 * 修改说明 * <p>Ti

WebService之CXF注解之二(Service接口)

ITeacherService.java: /** * @Title:ITeacherService.java * @Package:com.you.service * @Description:教师Service接口 * @author:Youhaidong(游海东) * @date:2014-5-5 下午11:06:24 * @version V1.0 */ package com.you.service; import javax.jws.WebMethod; import javax.j

Maven项目中mvn clean后找不到測试类问题

在Maven项目中进行单元測试,但mvn clean后又一次mvn install项目,再次进行单元測试.会有下面的错误. <span style="font-family:KaiTi_GB2312;font-size:18px;">Class not found com.core.order.service.impl.OrderServiceImplTest java.lang.ClassNotFoundException: com.core.order.service.

WebService之CXF注解报错(一)

WebService之CXF注解 1.具体报错如下 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-5-4 22:42:12 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native li

WebService之CXF注解报错(三)

如果你对项目管理.系统架构有兴趣,请加微信订阅号"softjg",加入这个PM.架构师的大家庭 要成为WEB架构师,首先要找到通往成功的正确方向,接下来我们就要往这个方向努力.然而如唐僧去西天取经一样,要历经种种磨难,一路上打败各种妖魔鬼怪才能继续前行,所以唐僧取经,第一件事,就是招徒弟,遇见妖魔鬼怪就让技术高超的徒弟打败它,徒弟不听话就念紧箍咒,徒弟也搞不定的妖怪,就请观音菩萨搞定,这就是唐僧成功的法宝,没法宝上路,看来我们会死的比较惨啊,哈哈. 我们在通往架构师的路上,同样会遇到各

WebService之CXF注解之三(Service接口实现类)

ITeacherServiceImpl.java: /** * @Title:ITeacherServiceImpl.java * @Package:com.you.service.impl * @Description: * @author:Youhaidong(游海东) * @date:2014-5-5 下午11:08:39 * @version V1.0 */ package com.you.service.impl; import com.you.model.Teacher; impor

JPA測试实例

依赖架包 实体 import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transien