91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

Java調用.NET的WebService接口實例,jar包刪減到三個,干凈清爽,里面包含注多注釋和圖解,搞了半天的家伙拿出來與大家分享,無任何BUG,修改里面的參數即可直接運行,對于這種好東西,花了半天時間10分不算高,重在這種分享精神

資源截圖

代碼片段和文件信息

package?util;
import?org.apache.axiom.om.OMAbstractFactory;
import?org.apache.axiom.om.OMElement;
import?org.apache.axiom.om.OMFactory;
import?org.apache.axiom.om.OMNamespace;?
import?org.apache.axis2.AxisFault;
import?org.apache.axis2.addressing.EndpointReference;
import?org.apache.axis2.client.Options;
import?org.apache.axis2.client.ServiceClient;

import?java.rmi.RemoteException;
import?java.util.Iterator;

public?class?webServiceTest
{

????public?static?String?test()?throws?AxisFault?{
????
???? //在.NET接口中打開asmx相關的cs文件,代碼最上邊會有[WebService(Namespace?=?“http://tempuri.org/“)]字樣
???? //不知道命名空間的的,在此資料中有個“命名空間.png”圖片,可以看下
????????try?{
????????????String?url?=?“http://xxxx.com/xxx.asmx?WSDL“;//接口地址
????????????Options?options?=?new?Options();
????????????EndpointReference?targetEPR?=?new?EndpointReference(url);
????????????options.setTo(targetEPR);
????????????options.setAction(“http://tempuri.org/Add“);//命名空間+方法名
????????????ServiceClient?sender?=?new?ServiceClient();
????????????sender.setOptions(options);
????????????OMFactory?fac?=?OMAbstractFactory.getOMFactory();
????????????String?tns?=?“http://tempuri.org/“;//命名空間
????????????OMNamespace?omNs?=?fac.createOMNamespace(tns?““);
????????????OMElement?method?=?fac.createOMElement(“Add“?omNs);//Add為方法名
????????????OMElement?symbol?=?fac.createOMElement(“qqortel“?omNs);//參數名稱,如接口上面方法Add(String?qqortel)我這里寫的和上面一至,沒測試不一樣是什么結果
????????????symbol.addChild(fac.createOMText(symbol?“13081545944“));//參數值
????????????method.addChild(symbol);
????????????method.build();
????????????OMElement?result?=?sender.sendReceive(method);
????????????return?result.toString();
????????}?catch?(AxisFault?axisFault)?{
????????????axisFault.printStackTrace();
????????}
????????return?“ERROR“;
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-03-08?12:19??web\
?????文件?????????580??2018-03-08?16:40??web\.classpath
?????目錄???????????0??2018-03-08?12:19??web\.myeclipse\
?????文件?????????282??2018-03-08?12:19??web\.mymetadata
?????文件????????1409??2018-03-08?13:17??web\.project
?????目錄???????????0??2018-03-08?12:19??web\.settings\
?????文件?????????500??2018-03-08?12:19??web\.settings\.jsdtscope
?????文件?????????334??2018-03-08?12:19??web\.settings\org.eclipse.jdt.core.prefs
?????文件??????????49??2018-03-08?12:19??web\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2018-03-08?12:19??web\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2018-03-08?12:20??web\src\
?????目錄???????????0??2018-03-08?12:21??web\src\util\
?????文件????????1911??2018-03-08?16:58??web\src\util\webServiceTest.java
?????目錄???????????0??2018-03-08?12:19??web\WebRoot\
?????文件?????????876??2018-03-08?15:25??web\WebRoot\index.jsp
?????目錄???????????0??2018-03-08?12:19??web\WebRoot\meta-INF\
?????文件??????????36??2018-03-08?12:19??web\WebRoot\meta-INF\MANIFEST.MF
?????目錄???????????0??2018-03-08?12:19??web\WebRoot\WEB-INF\
?????目錄???????????0??2018-03-08?16:40??web\WebRoot\WEB-INF\classes\
?????目錄???????????0??2018-03-08?16:40??web\WebRoot\WEB-INF\classes\util\
?????文件????????2320??2018-03-08?16:58??web\WebRoot\WEB-INF\classes\util\webServiceTest.class
?????目錄???????????0??2018-03-08?16:40??web\WebRoot\WEB-INF\lib\
?????文件??????423802??2018-03-08?16:36??web\WebRoot\WEB-INF\lib\axiom-api-1.2.20.jar
?????文件?????1024594??2018-03-08?16:37??web\WebRoot\WEB-INF\lib\axis2-kernel-1.7.4.jar
?????文件??????374014??2018-03-08?16:31??web\WebRoot\WEB-INF\lib\woden-core-1.0M10.jar
?????文件?????????365??2018-03-08?12:19??web\WebRoot\WEB-INF\web.xml
?????目錄???????????0??2018-03-08?17:01??web\命名空間獲取方法\
?????文件???????13403??2018-03-08?16:52??web\命名空間獲取方法\已發布網站查看命名空間方法1.png
?????文件???????15987??2018-03-08?16:53??web\命名空間獲取方法\已發布網站查看命名空間方法2.png
?????文件???????16999??2018-03-08?16:45??web\命名空間獲取方法\程序開發查看命名空間.png
?????文件????????9122??2018-03-08?17:07??web\命名空間獲取方法\結果.png
............此處省略0個文件信息

評論

共有 條評論