使用Axis2编写webservice客户端,服务端
1、编写客户端
【参考帖子】
http://blog.csdn.net/wangjinwei6912/article/details/8512598 报错:org.xml.sax.SAXException: Bad envelope tag: definitions
http://stackoverflow.com/questions/5548282/org-xml-sax-saxexception-bad-envelope-tag-definitions
http://bbs.csdn.net/topics/210008741
http://blog.csdn.net/wjwwgh/article/details/4349744 报错:SimpleDeserializer encountered a child element, which is NOT expected
2、编写服务端
MyEclipse8.5+Axis2 1.6.2插件安装问题

【参考资料】
1:axis2 官方安装说明文档 http://axis.apache.org/axis2/java/core/tools/eclipse/plugin-installation.html
2:renxiao2003博文 http://blog.chinaunix.net/uid-78707-id-283547.html
3:myEclipse8.5 安装 axis2 jar 包整理(可下载) http://download.csdn.net/detail/hob007/4457837
5:http://zwy20034751-163-com.iteye.com/blog/1897809
3、发布webservice服务端
利用axis2工具生成aar文件;然后把生成的arr文件复制到%TOMCAT-HOME%/webapps/axis2/WEB-INF/services下;启动tomcat,浏览器中http://localhost:8080/axis2/services/listServices就可以看到结果了
1、生成步骤 http://www.educity.cn/wenda/138802.html
利用工具生成aar文件

下面是一个超简单的service,看不懂的同学请举手
package com.demo.service.impl;
import com.demo.service.UserService;
public class UserServiceImpl implements UserService {
@Override public int Login(String username, String password)
{ // TODO Auto-generated method stub
if (username.equals("a") && password.equals("a"))
{ return 1; } return 0;
}
}
选择服务器端项目的classes目录







2、注意事项:http://www.oschina.net/question/101738_47314
4、发布到webservice服务端后,用客户端调用时出现的异常
(1)、报错com.coast.foundation.dbutil.DBManager; 这个是所写服务端CoremailService,数据库调用时使用的工具coast.jar包,需要将此包加入%TOMCAT-HOME%/webapps/axis2/
(2)、 报错 Exception occurred while trying to invoke service method loginCheck stackoverflow
首先,更改 axis2.xml可以更详细地跟踪错误;
in the axis2.xml ...
<parameter name="sendStacktraceDetailsWithFaults">false</parameter>
set the sendStacktraceDetailsWithFaults parameter to true and you should get a copy of the stacktrace in the response (reset to false for production)
然后,发现是webservice客户端报错:EpDB:Caused by: java.lang.NullPointerException;
webservice服务端报错:数据库连接错误,请联系管理员。
解决方案:一方面是数据库驱动ojdbc14.jar没有放到%TOMCAT_HOME%\webapps\axis2\WEB-INF\lib下面,
二方面是数据库的配置文件jdbc.properties 需要拷贝到%TOMCAT-HOME%/webapps\axis2\WEB-INF\classes下面
使用Axis2编写webservice客户端,服务端的更多相关文章
- Axis2开发WebService客户端 的3种方式
Axis2开发WebService客户端 的3种方式 在dos命令下 wsdl2java -uri wsdl的地址(网络上或者本地) -p com.whir.ezoffi ...
- [并发并行]_[线程模型]_[Pthread线程使用模型之三 客户端/服务端模型(Client/Server]
Pthread线程使用模型之三 客户端/服务端模型(Client/Server) 场景 1.在客户端/服务端模型时,客户端向服务端请求一些数据集的操作. 服务端执行执行操作独立的(多进程或跨网络)– ...
- win10操作系统下oracle11g客户端/服务端的下载安装配置卸载总结
win10操作系统下oracle11g客户端/服务端的下载安装配置卸载总结 一:前提 注意:现在有两种安装的方式 1. oracle11g服务端(64位)+oracle客户端(32位)+plsql(3 ...
- 使用Thrift RPC编写程序(服务端和客户端)
1. Thrift类介绍 Thrift代码包(位于thrift-0.6.1/lib/cpp/src)有以下几个目录: concurrency:并发和时钟管理方面的库processor:Processo ...
- WebService从服务端到客户端的用例
1.首先编写Wsdl(基于契约优先的方式),要注意的是命名空间(若是使用include或import)最好使用一致的,代码如下: <?xml version="1.0" en ...
- spring mvc + mybaties + mysql 完美整合cxf 实现webservice接口 (服务端、客户端)
spring-3.1.2.cxf-3.1.3.mybaties.mysql 整合实现webservice需要的完整jar文件 地址:http://download.csdn.net/detail/xu ...
- 采用RPC方式和document方式 开发Axis2的WebService客户端
import javax.xml.namespace.QName; import org.apache.axiom.om.OMAbstractFactory; import org.apache.ax ...
- webservice调用服务端数据时给soapenv:Envelope 添加自定义的命名空间
最近做第三方接口,服务端需要 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/&qu ...
- WebService学习之旅(六)使用Apache Axis2实现WebService客户端调用
上节介绍了如何使用Axis2 发布一个WebService,Axis2除了为我们编写WebService应用带来了便利,也同样简化的客户端调用的过程,本节在上节的基础上使用Axis2自带的工具生成客户 ...
随机推荐
- localdb
<connectionStrings> - <add name="default" connectionString="Data Source=.; I ...
- XML模块
XML 例子: # -*- encoding:utf-8 -*- import requests from xml.etree import ElementTree as ET f = request ...
- mysql主从数据库不同步的2种解决方法(转)
今天发现Mysql的主从数据库没有同步 先上Master库: mysql>show processlist; 查看下进程是否Sleep太多.发现很正常. show master status; ...
- jqxTreeGrid
基本TreeGrid样本 <!DOCTYPE html> <html lang="en"> <head> <title id=" ...
- clang
1.安装 clang 可以从官网下载,如果是CentOS 6 系统,也可以在 /etc/yum.repos.d/ 目录下增加一个 epel.repo 文件,内容如下: [epel] name=Extr ...
- thinkPHP3.2.3集成swoole扩展
swoole.php #!/bin/env php <?php /** * 默认时区定义 */ date_default_timezone_set('Asia/Shanghai'); /** * ...
- [译]git config
git config git config命令用来设置git的一些配置(包括全局配置和针对单个仓储的配置).git config命令能定义一个仓储的用户信息和用户偏好. 用法 git config u ...
- PHP简单封装MysqlHelper类
MysqlHelper.class.php 1: <?php 2: 3: /** 4: * Mysql数据帮助类 5: */ 6: class MysqlHelper 7: { 8: func ...
- POJ 3071 Football
很久以前就见过的...最基本的概率DP...除法配合位运算可以很容易的判断下一场要和谁比. from——Dinic算法 Football Time ...
- cf.301.D. Bad Luck Island(dp + probabilities)
D. Bad Luck Island time limit per test 2 seconds memory limit per test 256 megabytes input standard ...