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. SpringData,JPA,MongoDB,Solr,Elasticsearch底层逻辑关系

    一: Spring-data底层的接口路基: spring-data : PagingAndSortingRepository-> CrudRepository-> Repository ...

  2. 转 asterisk拨号规则

    asterisk拨号规则 一.前言     本文档以asterisk-1.4.32为基础写作而成,可能和其他版本有些区别. 二.Asterisk dialplan 基本结构 Asterisk dial ...

  3. Ubuntu 16.04安装Guake Terminal终端(使用一键唤醒功能)

    安装: sudo apt-get install guake-indicator sudo apt-get install guake 使用: 先启动guake-indicator,再启动guake. ...

  4. [转] OracleDataReader.Read()是否有值

    TongYu2009的原文地址 当你执行一次OracleDataReader.Read()是Bool型),注意是只读取一个!如果你的Select语句执行结果是空,或者所有的结果都已经读取完了则Orac ...

  5. xml解析工具mashaller javaee自带解析类

    1.怎样去掉Marshaller的格式化? : JAXBContext context = JAXBContext.newInstance(Entity.class); Marshaller mars ...

  6. eclipse默认指定项目的编译器版本

    eclipse 提示 @Override must override a superclass method 问题解决 今天新换了一个Eclipse 版本: Build id: 20140224-06 ...

  7. java.util.MissingResourceException: Can't find resource for bundle oracle.sysman.db.rsc.LoginResourc

    http://blog.itpub.net/197458/viewspace-1055358/   oracle 10.2.0.4 windows 2003 X64 平台 系统安装EMCA正常.第一次 ...

  8. php monolog 的写日志到unix domain socket 测试终于成功

    在另外一个客户端执行 php s.php后, 通过nc -lU /tmp/tg.sck 建立的unix domain socket 有接收到消息. <?php require 'vendor/a ...

  9. ubuntu16.04LTS安装软件

    1.安装chrome 下载源加入到系统的源列表 sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/ ...

  10. Visual Studio VS如何拷贝一个项目的窗体文件到另一个项目

    1 比如下我有一个项目,我要把这个Config整个窗体和代码拷贝到另一个项目   2 在新项目中添加现有项,然后把这个窗体相关的三个文件都添加到新的项目中   3 然后在新窗体中就什么都有了     ...