首页 技术 正文
技术 2022年11月16日
0 收藏 405 点赞 3,927 浏览 1320 个字

一、CXF

  1.什么是CXF

  Apache CXF = Celtix + XFire,开始叫 Apache CeltiXfire,后来更名为 Apache CXF 了,以下简称为 CXF。CXF 继承了 Celtix 和 XFire 两大开源项目的精华,提供了对 JAX-WS 全面的支持,并且提供了多种 Binding 、DataBinding、Transport 以及各种 Format 的支持,并且可以根据实际项目的需要,采用代码优先(Code First)或者 WSDL 优先(WSDL First)来轻松地实现 Web Services 的发布和使用。Apache CXF已经是一个正式的Apache顶级项目。

  // 来自百度百科(也就是一个WebService的框架)

  官网:http://cxf.apache.org/index.html

  2.入门案例

  参见:http://www.cnblogs.com/frankliiu-java/articles/1641949.html

    http://blog.csdn.net/accountwcx/article/details/47082487

  下载CXF后可以使用它的命令实现代码的生成以便调用:——实际中基本不会再使用JDK自带的wsimport的命令

    WebService第二天——WebService框架CXF

  当然,官方下载的压缩包中也有例子和文档:

    与spring整合的例子可以结合samples与网友随笔:http://sunny.blog.51cto.com/182601/625540/

    WebService第二天——WebService框架CXF

  使用JQuery调用webService:

$(function(){
$("#mybutton").click(function(){
var data = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://server.web.cxf.rl.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'
+'<soapenv:Body>'
+'<q0:sayHello>'
+' <arg0>sss</arg0>'
+' </q0:sayHello>'
+'</soapenv:Body>'
+'</soapenv:Envelope>'; $.ajax({
url:'http://localhost:8080/cxf-web-server/services/hello',
type:'post',
dataType:'xml',
contentType:'text/xml;charset=UTF-8',
data:data,
success:function(responseText){
alert($(responseText).find('return').text());
},
error:function(){
alert("error");
}
})
})
})

  这里详细的使用方法,待补充…

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,950
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,476
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,289
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,107
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,739
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,772