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平台实现)的更多相关文章

  1. 微信小程序访问webservice(wsdl)+ axis2发布服务端(Java)

    0.主要思路:使用axis2发布webservice服务端,微信小程序作为客户端访问.步骤如下: 1.服务端: 首先微信小程序仅支持访问https的url,且必须是已备案域名.因此前期的服务器端工作需 ...

  2. 使用axis2进行WebService的开发

    使用axis2进行WebService的开发 Apache Axis2 是 Apache Axis SOAP 项目的后继项目.此项目是 Web 服务核心引擎的重要改进,目标是成为 Web 服务和面向服 ...

  3. Java借助axis2发布WebService

    Webservice: 1.Xml: 2.WSDL: Web service描述语言(WSDL)就是这样一个基于XML(标准通用标记语言下的一个子集)的语言,用于描述Web service及其函数.参 ...

  4. 使用Axis2实现WebService的发布和调用

    一.Axis2的下载和安装 1.可从http://ws.apache.org/axis2/ 下载Axis2的最新版本:      可以下载如下三个zip包: axis2-1.7.3-bin.zip(用 ...

  5. WebService---Android中访问WebService接口的方法

     最近公司有个项目需要从Android平台访问WebService接口,实现向发布的函数传递对象.在网上找了一些资料,发现使用ksoap2可以调用WebService传递对象.   需要引入ksoap ...

  6. Android访问WebService的两种方法

    首先解释一下WebService:WebService是一种基于SOAP协议的远程调用标准.通过WebService可以将不同操作系统平台,不同语言.不同技术整合到一起.详细见:http://baik ...

  7. WebService学习之旅(七)Axis2发布WebService的几种方式

    前面几篇文章中简单的介绍了如何使用Axis2发布WebService及如何使用Axis2实现Web服务的客户端调用,本节將详细介绍Axis2发布WebService的几种方式. 一.使用aar包方式发 ...

  8. Axis2开发webservice详解

    Axis2开发webservice详解 标签: javawebserviceAxis2 2015-08-10 10:58 1827人阅读 评论(0) 收藏 举报  分类: JAVA(275)  服务器 ...

  9. 十九、.net core使用SoapCore开发webservice接口,以及使用HttpClientFactory动态访问webservice接口

    使用SoapCore实现在.net core平台下开发webservice:以及使用HttpClientFactory动态访问webservice. 首先,需要在包项目下面引用SoapCore: 然后 ...

随机推荐

  1. Redis源代码分析(二十七)--- rio制I/O包裹

    I/O每个操作系统,它的一个组成部分.和I/O业务质量,在一定程度上也影响了系统的效率. 今天,我在了解了Redis中间I/O的,相同的,Redis在他自己的系统中.也封装了一个I/O层.简称RIO. ...

  2. Linux常用命令3--如何设置IP地址?如何更改系统时间?

    Linux常用命令 系统状态监控 [1]ps:用于显示当前系统中运行的进程. 语法:ps [-option]:常用的参数有:-a;-u;-x;-e;-f. -a:显示所有进程: -u:显示所有用户: ...

  3. asp.net JSON(一)

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  4. Android Notification通知详细解释

    Android Notification通知具体解释  Notification: (一).简单介绍:         显示在手机状态栏的通知. Notification所代表的是一种具有全局效果的通 ...

  5. Eclipse生成jsp 如何将GB18030 改成默认UTF-8

    前两天面试被问到了struts的问题,好久没用了准备复习下,用eclipse创建一个maven项目的时候发现创建的jsp文件都是GB18030编码的,如何更改为UTF-8呢,其实很简单,给各位分享一下 ...

  6. socket在windows下和linux下的区别

    原文:socket在windows下和linux下的区别 1)头文件 windows下winsock.h/winsock2.h linux下sys/socket.h    错误处理:errno.h 2 ...

  7. C#映射网络驱动器

    using System.Runtime.InteropServices; [StructLayout(LayoutKind.Sequential)] public class NetResource ...

  8. c# 委托详解

    1.委托声明 2.委托入门实例 namespace ConsoleApplication1 { public delegate void methodDelegate(string str); cla ...

  9. Ubuntu下编译程序是出现pthread_create未定义错误

    gcc -c node_list.c -o node_list.o gcc -lpthread sim.o cli.o list.o node_list.o -o sim.exe sim.o: In ...

  10. uva 11991 - Easy Problem from Rujia Liu?(STL)

    option=com_onlinejudge&Itemid=8&page=show_problem&problem=3142" target="_blank ...