- 浏览: 527135 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (174)
- Groovy (28)
- Grails (14)
- DHTML (5)
- JS (4)
- jQuery (16)
- JAVA (16)
- Eclipse (4)
- Hibernate (2)
- Resin (2)
- Oracle (25)
- Maven (4)
- Struts2 (1)
- WebWork2 (3)
- Tomcat (2)
- Windows7 (4)
- Griffon (2)
- PowerDesigner (1)
- Pro*C (2)
- JDK (1)
- 乱码 (2)
- WebService (3)
- .NET (1)
- 性能 (2)
- 安装 (1)
- 命令行 (1)
- function (1)
- type (1)
- Mysql (1)
- 同步 (1)
- Synchronized (1)
- json (3)
- Office (1)
- Visio (1)
- 自定义形状 (1)
- jsong (0)
- gson (1)
- fastjson (1)
- EM (1)
- DB2 (6)
- Sequence (1)
- RHEL5.x (1)
- WAS6.1 ND (1)
- SQL (1)
- -964 (1)
- Linux (4)
- Date (1)
- Format (1)
- Add (1)
- SHELL (1)
- CSS (2)
- Bootstrap (1)
- nginx (1)
- Openresty (2)
- JWPlayer (1)
- showdoc (1)
- 常用网址 (1)
- lua (2)
- SpringBoot (1)
- Office pdf linux (1)
最新评论
-
纵观全局:
Great
阿里巴巴开源JSON解析组件FastJson简单使用笔记 -
guxuede:
...
Groovy编程技巧 -
a1439226817:
groovy用的多吗?我还没发现有哪个java项目在用这个?
Groovy同步 -
晴子9034:
在网上搜到的几乎全是说满了就扩充。但是我有个疑问,满了就扩充, ...
解决DB2 SQLCODE=-964日志文件满的问题 -
在世界的中心呼喚愛:
好东西啊,就用这个包。
阿里巴巴开源JSON解析组件FastJson简单使用笔记
import javax.xml.rpc.ParameterMode; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.XMLType; public class caClient { /** * @param args */ public static void main(String[] args) { try { String endpoint = "http://ls.cqu.edu.cn/WebService/LibraryInterface.asmx?WSDL"; // 直接引用远程的wsdl文件 // 以下都是套路 Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(endpoint); call.setOperationName("SetLibraryValue");// WSDL里面描述的接口名称 call.setSOAPActionURI("http://ls.cqu.edu.cn/SetLibraryValue"); call.addParameter("Key", XMLType.XSD_STRING, ParameterMode.IN);// 接口的参数 call.addParameter("XH", XMLType.XSD_STRING, ParameterMode.IN);// 接口的参数 call.addParameter("HJDM", XMLType.XSD_STRING, ParameterMode.IN);// 接口的参数 call.addParameter("BLSM", XMLType.XSD_STRING, ParameterMode.IN);// 接口的参数 call.addParameter("SetState", XMLType.XSD_STRING, ParameterMode.IN);// 接口的参数 call.addParameter("CZRID", XMLType.XSD_STRING, ParameterMode.IN);// 接口的参数 call.addParameter("LogIP", XMLType.XSD_STRING, ParameterMode.IN);// 接口的参数 call.setReturnType(XMLType.XSD_STRING);// 设置返回类型 String key = "ewfasdfdsafew23434"; String xh = "22"; String hjdm = "33"; String blsm = "33"; String ss = "33"; String cid = "33"; String ip = "33"; String result = (String) call.invoke(new Object[] { key, xh, hjdm, blsm, ss, cid, ip }); // 给方法传递参数,并且调用方法 System.out.println("result is " + result); } catch (Exception e) { System.err.println(e.toString()); } } }
上面的 WSDL 返回内容为:
<?xml version="1.0" encoding="utf-8" ?> - <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://ls.cqu.edu.cn/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://ls.cqu.edu.cn/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> - <wsdl:types> - <s:schema elementFormDefault="qualified" targetNamespace="http://ls.cqu.edu.cn/"> - <s:element name="GetLibraryValue"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Key" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="XH" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="HJDM" type="s:string" /> </s:sequence> </s:complexType> </s:element> - <s:element name="GetLibraryValueResponse"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="GetLibraryValueResult" type="s:string" /> </s:sequence> </s:complexType> </s:element> - <s:element name="SetLibraryValue"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Key" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="XH" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="HJDM" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="BLSM" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="SetState" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="CZRID" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="LogIP" type="s:string" /> </s:sequence> </s:complexType> </s:element> - <s:element name="SetLibraryValueResponse"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="SetLibraryValueResult" type="s:string" /> </s:sequence> </s:complexType> </s:element> </s:schema> </wsdl:types> - <wsdl:message name="GetLibraryValueSoapIn"> <wsdl:part name="parameters" element="tns:GetLibraryValue" /> </wsdl:message> - <wsdl:message name="GetLibraryValueSoapOut"> <wsdl:part name="parameters" element="tns:GetLibraryValueResponse" /> </wsdl:message> - <wsdl:message name="SetLibraryValueSoapIn"> <wsdl:part name="parameters" element="tns:SetLibraryValue" /> </wsdl:message> - <wsdl:message name="SetLibraryValueSoapOut"> <wsdl:part name="parameters" element="tns:SetLibraryValueResponse" /> </wsdl:message> - <wsdl:portType name="LibraryInterfaceSoap"> - <wsdl:operation name="GetLibraryValue"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><B>获取学生某环节办理情况</B><p> <span style='color:green'><B>参数说明:</B></span> Key:钥匙 XH:学号 HJDM:环节代码 </BR><span style='color:red'><B>返回值说明:</B> 0:未通过办理 1:已通过办理 420:批次未启用 430:钥匙错误 440:学号不存在或者该学生未进入离校系统 450:环节代码错误</span><BR/></wsdl:documentation> <wsdl:input message="tns:GetLibraryValueSoapIn" /> <wsdl:output message="tns:GetLibraryValueSoapOut" /> </wsdl:operation> - <wsdl:operation name="SetLibraryValue"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><B>设置学生某环节办理状态</B><p> <span style='color:green'><B>参数说明:</B></span> Key:钥匙 XH:学号 HJDM:环节代码 BLSM:办理说明 SetState:设置状态[1,0](分别为已通过和未通过) CZRID:办理人身份认证号 LogIP:办理人登陆IP</BR><span style='color:red'><B>返回值说明:</B> 200:设置成功 420:批次未启用 430:钥匙错误 440:学号不存在或者该学生未进入离校系统 450:环节代码错误 460:环节状态设置错误 470:写入日志出错</span><BR/><center>版权所有:Copyright 重庆大学 www.cqu.edu.cn</center></wsdl:documentation> <wsdl:input message="tns:SetLibraryValueSoapIn" /> <wsdl:output message="tns:SetLibraryValueSoapOut" /> </wsdl:operation> </wsdl:portType> - <wsdl:binding name="LibraryInterfaceSoap" type="tns:LibraryInterfaceSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> - <wsdl:operation name="GetLibraryValue"> <soap:operation soapAction="http://ls.cqu.edu.cn/GetLibraryValue" style="document" /> - <wsdl:input> <soap:body use="literal" /> </wsdl:input> - <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> - <wsdl:operation name="SetLibraryValue"> <soap:operation soapAction="http://ls.cqu.edu.cn/SetLibraryValue" style="document" /> - <wsdl:input> <soap:body use="literal" /> </wsdl:input> - <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> - <wsdl:binding name="LibraryInterfaceSoap12" type="tns:LibraryInterfaceSoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> - <wsdl:operation name="GetLibraryValue"> <soap12:operation soapAction="http://ls.cqu.edu.cn/GetLibraryValue" style="document" /> - <wsdl:input> <soap12:body use="literal" /> </wsdl:input> - <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> - <wsdl:operation name="SetLibraryValue"> <soap12:operation soapAction="http://ls.cqu.edu.cn/SetLibraryValue" style="document" /> - <wsdl:input> <soap12:body use="literal" /> </wsdl:input> - <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> - <wsdl:service name="LibraryInterface"> - <wsdl:port name="LibraryInterfaceSoap" binding="tns:LibraryInterfaceSoap"> <soap:address location="http://ls.cqu.edu.cn/WebService/LibraryInterface.asmx" /> </wsdl:port> - <wsdl:port name="LibraryInterfaceSoap12" binding="tns:LibraryInterfaceSoap12"> <soap12:address location="http://ls.cqu.edu.cn/WebService/LibraryInterface.asmx" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
评论
2 楼
leon1509
2011-10-18
只要有数据返回,不管是啥格式,该咋处理咋处理!XML就用dom4j或sax或jdom处理呗!
1 楼
zq_zero
2011-10-17
如果接口方返回的是xml,该怎么处理啊?
发表评论
-
转:Java编程中“为了性能”尽量要做到的一些地方
2012-03-28 14:16 1093原贴:http://www.iteye.com/m ... -
System.getProperty()方法大全
2012-01-04 15:52 2718System.out.println("ja ... -
[JAVA]使用axis调用.NET写的WebService
2011-12-21 16:28 1899参考:http://wenwen.soso.com ... -
Groovy连接2个数据库进行数据操作
2011-11-21 11:37 2011import groovy.sql.Sql clas ... -
真正解决dbca、netca、em等乱码问题(含jdk安装)
2011-10-27 16:49 3894参考地址:猛击这里 注意:62位系统此方法貌似无效,会报“j ... -
手动生成jar包及可执行jar包
2011-10-11 15:30 1300执行: jar cvf xxx.jar path\path1\ ... -
使用JNative调用DLL
2011-10-11 14:39 1663ref: TermTx.dll接口调用说明书 1. 将目标D ... -
DES加解密之三
2011-08-16 16:37 2755目前客户端使用的。 import java.securi ... -
DES加解密之二
2011-08-15 17:40 1591import javax.crypto.Cipher; ... -
MD5加密
2011-08-15 16:18 1050import java.io.UnsupportedEnc ... -
DES加解密之一
2011-08-15 16:17 1242import java.security.Key; im ... -
(转)查看class被什么版本jdk编译
2011-06-21 17:50 1138转自:http://www.cnblogs.com/gladt ... -
迄今为止,个人认为最好用的java返编译器(欢迎推荐)
2011-06-14 18:00 999看图: -
Base64加密算法源码(java版)
2009-10-28 13:33 1464public class Base64 { priva ... -
在Ubuntu中安装多个JDK(TOMCAT也可以)---关键字alternatives
2009-10-28 13:08 2132注册jdk5到alternatives: sudo upd ...
相关推荐
Java Axis 直接调用webservice 接口工具类, 无需根据wsdl编译客户端,需要axis相关包,测试使用axis 1.4, 附demo引入axis包后直接可以测试;
本案例实现使用Axis2生成.arr包发布WebService服务,并使用Axis2生成客户端代码方式调用WebService
java 调用https发布的webservice接口实例及axis包及详细说明
axis调用第三方webservice接口所需的jar包,包括axis-1.4.jar,axis-jaxrpc-1.3.jar,axis-jaxrpc-1.4.jar,commons-discovery-0.5.jar,commons-logging-1.2.jar,cxf-rt-databinding-jaxb-3.3.1.jar,javax.mail-...
最近项目中遇到需要去掉老系统的webservice服务中的insert方法,找了很久,发现这样最简单,实测有效!!!
利用AXIS,通过wsdl的url直接调用webservice接口时所需要的jar包,经测试可直接使用
1)Java用axis发布/调用webservice demo;调用方式为wsdl2java生成本地client代码调用; 2)资源中包含代码和axis1.4安装文件;
使用axis手动编写webservice服务发布,并调用。 使用wsdl2java命令 ---------注意导入axis jar包
在eclipse中先用代理的方式获取实例然后在直接调用,压缩包中包括axis调用webService接口所需的jar包和案例,包括java代码部分和jar部分
JAVA WEBSERVICE 建的实例工程,给PB调用, 因VS建的 WEBSERVICE PB很难调用,所以用JAVA的axis做了个小实例 共大家参考
2、使用wsdl生成客户端HelloStub.java、OtherStub.java【通过axis2插件的Axis2 code generator生成】 3、测试类或者jsp页面,可以通过2中的客户端类来调用服务 例如: HelloStub helloStub=new HelloStub(...
里面包含axis2-adb-codegen-1.5.4.jar、axis2-java2wsdl-1.5.4.jar、axis2-transport-local-1.5.4.jar、mail-1.4.jar、woden-impl-dom-1.0M8.jar、XmlSchema-1.4.3.jar等十几个jar包
springboot调用webservice接口的两种方式,不使用axis
资源包含了:axis2-1.7.4-bin.zip、axis2-1.7.4-war.zip、axis2-eclipse-...备注:资源超过了70M 分成了2部分 见axis2方式开发webservice(一)和 axis2方式开发webservice(二)、 axis2方式开发webservice(三)
springboot 集成axis1.4的webservice,该为maven的工程
根据天气预报webservice的wsdl解析成本地的Java代码;用Java代码调用webservice天气...本资源已用axis将webservice的wsdl解析成本地的Java代码,并实现Java代码调用天气预报;现将其打包上传,望对有需要的人有所帮助!
当然可以调用任何 wsdl地址。只要是webservice 这里是比较流行的。 这里有2个测试地址。 (1):http://www.webservicex.com/stockquote.asmx<br>(2):...
利用axis jar包 根据wsdl文件生成java webservice 工具 (附带生成后调用方法和详细说明) 及其适合工作着与初学者调试和学习,已经通过测试完全可用
axis-1.6.0.jar,axis-ant.jar,commons-discovery.jar,commons-logging-1.0.4.jar,jaxrpc.jar,wsdl4j-1.5.1.jar
Axis WebService 技术指南,开发文档,很全面、详细。 Axis的简单入门实例 Axis的jws发布WebService Axis的wsdd模式发布WebService Axis中传递复杂对象和内部类 Axis中的handler、chain的特性....Net调用Axis出现的问题