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

基于cxf的webservice 基础

时间:2014-12-31 08:42:49      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:

- 借用上一个例子的代码:
SOAP Request Envelope:
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://wa.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <q0:sayHello>
<arg0>fuck</arg0>
</q0:sayHello>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response Envelope:
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <soap:Body>
- <ns2:sayHelloResponse xmlns:ns2="http://wa.com/">
<return>hello,fuck</return>
</ns2:sayHelloResponse>
</soap:Body>
</soap:Envelope>
 
用apache-cxf 3.0.3生成客户端代码:
 环境变量的配置:

一、环境配置

        新建CXF_HOME      D:\java\apache-cxf-3.0.3

        在CLASSPATH          %CXF_HOME%\lib

        在PATH中添加           %CXF_HOME%\bin

二、测试:

   在window命令框中输入: wsdl2java -v

出现 wsdl2java - Apache CXF 3.0.3 表示配置成功。

 

利用cxf生成客户端代码:

 wsdl2java http://192.168.1.110:8989/d01ws/hello?wsdl

即可生成。 

基于cxf的webservice 基础

标签:

原文地址:http://www.cnblogs.com/lonelywolfmoutain/p/4194964.html

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