http://observer.blog.51cto.com/4267416/1231205

手动发布:

public class ServerMain {

public static void main(String[] args) {
GradeService service = new GradeServiceImpl();
Endpoint.publish("http://localhost/webservices/services/Service", service);
}
}

客户端调用

package com.test.service;

public class ClientMain {

public static void main(String[] args) throws Exception {
GradeService_Service service = new GradeService_Service();
GradeService gradeServiceImplPort = service.getGradeServicePort();
System.out.println(gradeServiceImplPort.getGradeName(111)); //JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); //Client client = clientFactory.createClient("http://localhost/webservices/services/Service?wsdl"); //Object[] result = client.invoke("getGradeName", 11); //System.out.println(result[0]);
}
}

使用wsdl2java 生成的代码,运行时出现错误,删除包xfire-all-1.2.6可以运行了,实际不用导入任何包就可以运行。

注:wsdl2java 在 apache-cxf-3.1.12 的bin目录下面

cxf CXF搭建webService服务器的更多相关文章

  1. CXF+Spring搭建webservice服务

    Apache CXF 是一个开源的 Services 框架,CXF 帮助您利用 Frontend 编程 API 来构建和开发 Services ,像 JAX-WS .这些 Services 可以支持多 ...

  2. ibatis+spring+cxf+mysql搭建webservice

    首先需必备:mysql.myeclipse6.5.apache-cxf-2.6.2 一.建数据库,库名:cxf_demo:表名:book CREATE DATABASE `cxf_demo`  --数 ...

  3. 使用CXF和spring搭建webService服务

    虽然下一个项目需要使用xfire,但是在查资料的过程中还是看到有不少地方都说cxf比xfire更好,cxf继承了xfire,但是不仅仅包含xfire,因此便也一起来尝试尝试.大概是有了xfire的经验 ...

  4. Spring Boot+CXF搭建WebService(转)

    概述 最近项目用到在Spring boot下搭建WebService服务,对Java语言下的WebService了解甚少,而今抽个时间查阅资料整理下Spring Boot结合CXF打架WebServi ...

  5. cxf开发webservice服务器+客户端(各种类型的参数传递返回)

    开发环境:eclipse3.7+jdk1.6.0_29+tomcat6.0.37 XFire搭建webservice: http://www.cnblogs.com/gavinYang/p/35253 ...

  6. CXF+Spring 搭建的WebService

    1.创建类 2.接口编写 package com.fan; import javax.jws.WebService; @WebService public interface IHelloWorld ...

  7. Spring+CXF整合来管理webservice(服务器启动发布webservice)

    Spring+CXF整合来管理webservice    实现步骤:      1. 添加cxf.jar 包(集成了Spring.jar.servlet.jar ),spring.jar包 ,serv ...

  8. 基于CXF搭建webService

    1.导入相关jar包,具体哪些包我记不太清了 2.在applicationContext中加入相关配置信息,如下所示: <beans xmlns="http://www.springf ...

  9. webService学习之路(二):springMVC集成CXF快速发布webService

    继上一篇webService入门之后,http://www.cnblogs.com/xiaochangwei/p/4969448.html ,现在我将我周六在家研究的结果公布出来 本次集成是基于之前已 ...

随机推荐

  1. Go---Redis连接池

    之前一篇文章介绍过使用redigo连接redis数据库处理,在使用中发现如果初始化一条链接连接redis做相关操作,使用中发现当两个程序交替使用redis时,先前建立的链接会断掉,只能每次操作的时候重 ...

  2. 解决Coldfusion连接MySQL数据库的问题

    在连接MySQL时,出现了如下错误: Connections to MySQL Community Server are not supported. Please contact MySQL to ...

  3. 【APUE】信号量、互斥体和自旋锁

    http://www.cnblogs.com/biyeymyhjob/archive/2012/07/21/2602015.html http://blog.chinaunix.net/uid-205 ...

  4. [Angular] Write Compound Components with Angular’s ContentChild

    Allow the user to control the view of the toggle component. Break the toggle component up into multi ...

  5. OSX: 第三方部署Profile的方法和比較

    眼下至少有三个第三方部署Profile的方法. 一个Profile Handler, 是利用Launchd对制定文件夹改变而激活的机制,把须要的profiles文件斗存放在制定目标机器的文件夹内,系统 ...

  6. mysql手记

    myisam innoDB是mysql经常使用的存储引擎 MyISAM不支持事务.也不支持外键.但其訪问速度快.对事务完整性没有要求. InnoDB存储引擎提供了具有提交.回滚和崩溃恢复能力的事务安全 ...

  7. Python 之 读取txt文件

    本文直接给出三种实现方法,代码例如以下. 方法一: f = open("Proc_Data.txt") # 返回一个文件对象 line = f.readline() # 调用文件的 ...

  8. [外文理解] DDD创始人Eric Vans:要实现DDD原始意图,必须CQRS+Event Sourcing架构。

    原文:http://www.infoq.com/interviews/Technology-Influences-DDD# 要实现DDD(domain drive  design 领域驱动设计)原始意 ...

  9. HDU1542Atlantis(扫描线)

    HDU1542Atlantis(扫描线) 题目链接 题目大意:给你n个覆盖矩形,问最后覆盖的面积. 解题思路:将每一个矩形拆成两条线段,一条是+1的,还有一条是减1的.然后扫描先从上往下扫描,碰到加1 ...

  10. LoadRunner系列之—-02 基于webservice协议的接口测试(脚本实例)

    Loadrunner 基于webservice协议的接口压力测试(脚本实例) 接口功能如下:请求接口,报文只有一个参数为证件号码:返回报文中,有证件号码是否能查到对应数据,查到几条数据. 思路:请求w ...