码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2014-05-07 08:40:25      阅读:351      评论:0      收藏:0      [点我收藏+]

标签: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);  

	}

}


WebService之CXF注解之四(测试类),布布扣,bubuko.com

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

标签:webservice   cxf   注解   

原文地址:http://blog.csdn.net/you23hai45/article/details/25083331

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!