CXF发布webservice入门
1、设置CXF的bin目录进环境变量
2、CXF导入相关的jar包。
3、建立接口
@WebService
public interface HelloWorld {
public void say(String name);
}
4、实现接口
@WebService(endpointInterface="com.webservice.HelloWorld",serviceName="HelloWorldWs")
public class HelloWorldImpl implements HelloWorld {
@Override
public void say(String name) {
System.out.println("hello"+name);
}
}
5、 发布webservice
public class ServiceMain {
public static void main(String[] args) {
HelloWorld hw = new HelloWorldImpl();
Endpoint.publish("http://本地ip地址:端口/HelloWorldWs", hw);//发布helloworld
}
}
6、测试
http://本地地址:端口/HelloWorldWs?wsdl
出现wsdl相关xml文件即可
出错:
1、端口可能被占用
解决:使用其他端口
2、 java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory incompatible with javax.xml.stream.
解决:
http://www.findjar.com进去查找相关jar包,发现缺失wstx-asl-*.jar这个jar包
wstx-asl-3.0.0.jar)
CXF发布webservice入门的更多相关文章
- CXF发布webService服务以及客户端调用
这篇随笔内容是CXF发布webService服务以及客户端调用的方法 CXF是什么? 开发工作之前需要下载CXF和安装 下载地址:http://cxf.apache.org 安装过程: <1&g ...
- SpringBoot整合cxf发布webService
1. 看看项目结构图 2. cxf的pom依赖 1 <dependency>2 <groupId>org.apache.cxf</groupId>3 <art ...
- SpringMVC4整合CXF发布WebService
SpringMVC4整合CXF发布WebService版本:SpringMVC 4.1.6,CXF 3.1.0项目管理:apache-maven-3.3.3 pom.xml <project x ...
- Spring集成CXF发布WebService并在客户端调用
Spring集成CXF发布WebService 1.导入jar包 因为官方下载的包里面有其他版本的sprring包,全导入会产生版本冲突,所以去掉spring的部分,然后在项目根目录下新建了一个CXF ...
- 使用CXF发布WebService
这里普及一下WebService和cxf的知识.关于webservice和cxf: WebService.各种提供服务的组件 .企业总线.通讯总线(ESB)CXF:是一个SOA框架,Axi ...
- Apache CXF实现WebService入门教程(附完整源码)
Apache CXF实现WebService非常简单实用,只需要几步就可以实现一个简单的web service. 首先我们需要新建一个maven项目,在pom中添加依赖和jetty作为测试的web s ...
- 使用CXF发布WebService服务简单实例
一.说明: 前面介绍了使用axis2来发布Webservice服务,现在介绍一种更popular,更高效的Webservice服务发布技术:CXF Apache CXF = Celtix + XFir ...
- [置顶] 利用CXF发布webService的小demo
其实webService的发布不仅仅只有xfire,今天,给大家介绍一下用CXF发布一个webService的小demo,CXF也是我做webService用的第一个框架... 先将相关的jar引进来 ...
- cxf发布 webservice服务
导包 antlr-2.7.7.jar aopalliance-1.0.jar asm-3.3.jar commons-collections-3.2.1.jar commons-lang-2.6.ja ...
随机推荐
- python选择排序实现与C选择排序实现
python代码: #coding=utf-8 if __name__=="__main__": arr=[3,2,1,7,11,4,5,8] print "Before ...
- HDU 3634 City Planning (离散化)
City Planning Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...
- Median of Two Sorted Arrays (找两个序列的中位数,O(log (m+n))限制) 【面试算法leetcode】
题目: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sor ...
- 转:APK反编译
使用工具: CSDN上下载地址: apktool (资源文件获取) 下载 dex2jar(源码文件获取) 下载 jd-gui (源码查看) 下载 Android反编译整合工具包(最新) 下载 ...
- jdbc——CallableStatement,cst调用存储过程
package CST对象调用存储过程; import java.sql.CallableStatement; import java.sql.Types; import org.junit.Test ...
- 在windows中使用VMWare安装Mac OS 10.7
请参考http://www.cnblogs.com/huwlnew/archive/2011/11/15/2250342.html http://unmi.cc/vmware9-install-mac ...
- Java-----隐藏手机号中间四位
phone.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2");152****4799 idCard.replace ...
- Android系统五大布局详解Layout
我们知道Android系统应用程序一般是由多个Activity组成,而这些Activity以视图的形式展现在我们面前, 视图都是由一个一个的组件构成的.组件就是我们常见的Button.TextEdit ...
- Struts2中使用Session的两种方法
在Struts2里,如果需要在Action中使用到session,可以使用下面两种方式: 通过ActionContext 类中的方法getSession得到 Action实现org.apache.st ...
- 从汇编看c++成员函数指针(二)
下面先看一段c++源码: #include <cstdio> using namespace std; class X { public: virtual int get1() { ; } ...