使用axis2访问webservice(webserivice基于.net平台实现)
webservice url=http://10.90.11.240:8081/ExceptionWebService.asmx?WSDL;
下载axis2组件,解压,进入bin目录,通过命令wsdl2java -uri http://10.90.11.240:8081/ExceptionWebService.asmx?WSDL -p com.zsp.proxy -s -o source
-uri 后面运行的是 你的wsdl地址, -p 是文件生成的包名 -o source生成的文件目录,在bin目录下。
把生成的代理类,拷贝到你的工程目录中,导入对应的包即可访问:
例如
POST /ExceptionWebService.asmx HTTP/1.1
Host: 10.90.11.240
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/ApproveException" <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ApproveException xmlns="http://tempuri.org/">
<eventName>string</eventName>
<description>string</description>
<occurTime>string</occurTime>
<livingPlace>string</livingPlace>
<eventLevel>一般 or 急件 or 紧急 or 特急</eventLevel>
<bussinessCategory>运销 or 管道 or 设备 or HSE or 经营 or 管理 or 工程 or 科技 or 信息 or 党群 or 其它</bussinessCategory>
<reporterId>string</reporterId>
<contact>string</contact>
<systemId>string</systemId>
<businessPK>string</businessPK>
<remark>string</remark>
<isRelease>boolean</isRelease>
<measures>string</measures>
</ApproveException>
</soap:Body>
</soap:Envelope>
访问时:
public class Test2 {
public static void main(String[] args) throws RemoteException {
// TODO Auto-generated method stub
ExceptionServiceStub proxy = new ExceptionServiceStub();
ExceptionServiceStub.ApproveException exp = new ExceptionServiceStub.ApproveException();
exp.setContact("374378");
exp.setDescription("描述");
exp.setEventName("测试异常");
exp.setIsRelease(true);
exp.setLivingPlace("发生地点");
exp.setMeasures("47477474");
exp.setOccurTime("2019-09-09");
exp.setSystemId("xj_001");
exp.setRemark("备注");
exp.setEventLevel(EmergencyDegree.一般);
exp.setBussinessCategory(BusinessCategory.HSE);
exp.setBusinessPK("bpk");
exp.setReporterId("xxxx");
ApproveExceptionResponse res = proxy.approveException(exp);
System.out.println(res.getApproveExceptionResult());
}
}
使用内部类的方式设置参数,很方便,这种方式和C#通过VS生成代理的操作方式基本一致。
客户端需要导入的包如下:

使用axis2访问webservice(webserivice基于.net平台实现)的更多相关文章
- 微信小程序访问webservice(wsdl)+ axis2发布服务端(Java)
0.主要思路:使用axis2发布webservice服务端,微信小程序作为客户端访问.步骤如下: 1.服务端: 首先微信小程序仅支持访问https的url,且必须是已备案域名.因此前期的服务器端工作需 ...
- 使用axis2进行WebService的开发
使用axis2进行WebService的开发 Apache Axis2 是 Apache Axis SOAP 项目的后继项目.此项目是 Web 服务核心引擎的重要改进,目标是成为 Web 服务和面向服 ...
- Java借助axis2发布WebService
Webservice: 1.Xml: 2.WSDL: Web service描述语言(WSDL)就是这样一个基于XML(标准通用标记语言下的一个子集)的语言,用于描述Web service及其函数.参 ...
- 使用Axis2实现WebService的发布和调用
一.Axis2的下载和安装 1.可从http://ws.apache.org/axis2/ 下载Axis2的最新版本: 可以下载如下三个zip包: axis2-1.7.3-bin.zip(用 ...
- WebService---Android中访问WebService接口的方法
最近公司有个项目需要从Android平台访问WebService接口,实现向发布的函数传递对象.在网上找了一些资料,发现使用ksoap2可以调用WebService传递对象. 需要引入ksoap ...
- Android访问WebService的两种方法
首先解释一下WebService:WebService是一种基于SOAP协议的远程调用标准.通过WebService可以将不同操作系统平台,不同语言.不同技术整合到一起.详细见:http://baik ...
- WebService学习之旅(七)Axis2发布WebService的几种方式
前面几篇文章中简单的介绍了如何使用Axis2发布WebService及如何使用Axis2实现Web服务的客户端调用,本节將详细介绍Axis2发布WebService的几种方式. 一.使用aar包方式发 ...
- Axis2开发webservice详解
Axis2开发webservice详解 标签: javawebserviceAxis2 2015-08-10 10:58 1827人阅读 评论(0) 收藏 举报 分类: JAVA(275) 服务器 ...
- 十九、.net core使用SoapCore开发webservice接口,以及使用HttpClientFactory动态访问webservice接口
使用SoapCore实现在.net core平台下开发webservice:以及使用HttpClientFactory动态访问webservice. 首先,需要在包项目下面引用SoapCore: 然后 ...
随机推荐
- 中英文url解码vc++源程序
本文主要讨论中文url解码实现问题,没有具体解说url编码,utf-8编码.想对编解码问题有更加具体的了解,请查阅相关文档 url编码:实质字符ascii码的十六进制.仅仅是略微有些变动,须要在前面加 ...
- Java设计模式之装饰者模式
要实现装饰者模式,注意一下几点内容: 1.装饰者类要实现真实类同样的接口 2.装饰者类内有一个真实对象的引用(可以通过装饰者类的构造器传入) 3.装饰类对象在主类中接受请求,将请求发送给真实的对象(相 ...
- 怎么会Sql serverW数据库模型图转化成ord于--您还可以查看属性信息字段
1. 于Sql server数据库,创建数据库模型图 -- Database Diagrams watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvamN4NTA ...
- eclipese with gdbserver and Jlink configuration
最近的项目,很感动于linux和gdbserver内容,I think must write something to record it . 各位对不起,图片挂了.. Ok, at first I' ...
- JVMTI 中间JNI系列功能,线程安全和故障排除技巧
JVMTI 中间JNI系列功能,线程安全和故障排除技巧 jni functions 在使用 JVMTI 的过程中,有一大系列的函数是在 JVMTI 的文档中 没有提及的,但在实际使用却是很实用的. 这 ...
- Topcoder SRM 628 DIV 2
被自己蠢哭了.... 250-point problem 国际象棋棋盘上给出两个坐标,问象从一个走到还有一个最少要几步. 黑格象仅仅能走黑格,白格象仅仅能走白格,仅仅要推断两个坐标的颜色是否同样就能推 ...
- GitFlow使用说明
———————安装--------------- $ git clone --recursive git://github.com/nvie/gitflow.git $ cd gitflow $ [s ...
- GetDirectories 出错的解决方法
我想找到D盘里面所有 "*.pst文件,类似 windows 下的磁盘搜索功能, using System.IO; Directory.GetFiles(@"d:\", ...
- 关于MariaDB和Mysql
最近安装数据库的时候发现执行yum install mysql 命令时安装成了mariadb的数据库,它其实也是mysql的一个分支,完全兼容mysql 安装数据库: yum install mysq ...
- Pku1218
<span style="background-color: rgb(204, 204, 204);">/* A - THE DRUNK JAILER Time Lim ...