使用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: 然后 ...
随机推荐
- MSSQL发现第五到数据的第十
第二十数据查询数据库,第十条数据,两起案件: 1,ID是连接的,当然这样的情况比較好查.直接SELECT就能够了.取ID大于5小于10就能够了, 这样的情况比較少. 2.ID不是连接的.假设要取第五条 ...
- STL 源代码分析 算法 stl_algo.h -- binary_search
本文为senlie原创.转载请保留此地址:http://blog.csdn.net/zhengsenlie binary_search -------------------------------- ...
- angularJS之站在jQuery的肩膀上
jQuery:用更少的代码,实现更强悍的功能 托互联网日新月异发展的福,浏览器变成了人们接入互联网的入口,而JavaScript 这个曾经的小语种,终于成功地站到了舞台的中央,唤起了开发者的兴趣. 浏 ...
- 找不到方法: Int32 System.Environment.get_CurrentManagedThreadId() .
这个问题在本地运行没错...放到服务器上就出现这个问题.. 原因:是这个方法是.NETFRAMWORK4.5的..服务器上用的是4.0就会出现这个问题. 解决办法:在本地WEB项目右键把项目改到FRA ...
- MVC模型部分验证
ASP.NET MVC模型部分验证 在很多情况下,我们为了代码的复用可能会存在ViewModel共用的情形.比方说,web应用中常常会遇到的一个需求就是用户找回密码的功能.用户首先要验证通过验证邮箱( ...
- C语言库函数大全及应用实例四
原文:C语言库函数大全及应用实例四 [编程资料]C语言库函数大全及应用实例四 couble fmod (double x, dou ...
- R - 变化plot字形,嵌入字体以pdf
近期使用R绘图遇到两个问题 1. 使用不同的字体 2. 保存 plot 至 pdf 当字体嵌入pdf (embed the font) 使用extrafont和Ghostscript能够解决这两个问题 ...
- PAT 1006. Sign In and Sign Out
#include<iostream> #include<string> using namespace std; int main(){ int cnt;cin>> ...
- 4行代码实现js模板引擎
在平时编码中,经常要做拼接字符串的工作,如把json数据用HTML展示出来,以往字符串拼接与逻辑混在在一起会让代码晦涩不堪,加大了多人协作与维护的成本.而采用前端模板机制就能很好的解决这个问题. 精妙 ...
- C#6.0 中的那些新特性
C#6.0 中的那些新特性 前言 VS2015在自己机器上确实是装好了,费了老劲了,想来体验一下跨平台的快感,结果被微软狠狠的来了一棒子了,装好了还是没什么用,应该还需要装Xarmain插件,配置一些 ...