下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
1、java調(diào)用webservice .soapmapregistry smr = new soapmappingregistry(); stringdeserializer sd = new stringdeserializer(); arrayserializer arrayser = new arrayserializer(); beanserializer beanser = new beanserializer(); smr.maptypes(constants.ns_uri_soap_enc, new qname( / , helloworldresu
2、lt ), string.class, null, sd); smr.maptypes(constants.ns_uri_soap_enc, new qname( / , temp ), string.class, beanser, beanser); url url = new url(uri); call call = new call(); call.setsoapmappingregistry(smr); call.settargetobjecturi( urn:xmethods-service1 call.setmethodname( hellowo
3、rld call.setencodingstyleuri(constants.ns_uri_soap_enc); vector soapparams = new vector(); soapparams.addelement(new parameter( temp , string.class, u, null); call.setparams(soapparams); response soapresponse = call.invoke(url, /helloworld if (soapresponse.generatedfault() fault fau
4、lt = soapresponse.getfault(); system.out.println(fault); else parameter soapresult = soapresponse.getreturnvalue(); object obj = soapresult.getvalue(); system.out.println( = + obj); catch (exception e) e.printstacktrace(); return null; /* * 調(diào)用 c 的webservice接口 * soaprpcmethod(action = , * requestname
5、space = , * responsenamespace = , * use = soapbindinguse.literal) * * */ public static void addtest() try integer i = 1; integer j = 2; / webservice url string service_url = http:/localhost:4079/ws/service.asmx service service = new service(); call call = (call) service.createcall(); call.settargete
6、ndpointaddress(new .url(service_url); / 設置要調(diào)用的辦法 call.setoperationname(new qname( , add ); / 該辦法需要的參數(shù) call.addparameter( a , org.apache.axis.encoding.xmltype.xsd_int, javax.xml.rpc.parametermode.in); call.addparameter( b , org.apache.axis.encoding.xmltype.xsd_int, javax.xml.rpc.parametermode.in); /
7、辦法的返回值類型 call.setreturntype(org.apache.axis.encoding.xmltype.xsd_int); call.setusesoapaction(true); call.setsoapactionuri( / 調(diào)用該辦法 integer res = (integer) call.invoke(new object i, j ); system.out.println( result: + res.tostring(); catch (exception e) system.err.println(e); /* * 調(diào)用 c 的webservice接口 *
8、 soaprpcmethod(action = , * requestnamespace = , * responsenamespace = , * use = soapbindinguse.literal) * * */ public static void hellotest() try string endpoint = http:/localhost:4079/ws/service.asmx service service = new service(); call call = (call) service.createcall(); call.settargetendpointaddress(new .url(endpoint); call.setoperationname(new qname( , helloworld ); call.setusesoapaction(true); call.setsoapactionuri( string res = (strin
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026云南高黎貢山國家級自然保護區(qū)保山管護局招聘公益性崗位人員1人備考題庫及參考答案詳解
- 2025年12月江蘇南京市江北新區(qū)教育局所屬事業(yè)單位招聘教師20人備考題庫及答案詳解1套
- 2026年福建莆田第五中學初中部編外教師招聘若干人備考題庫(含答案詳解)
- 2026年徽商職業(yè)學院2025-2026學年第二學期校外兼職教師招聘53名備考題庫(含答案詳解)
- 2026北京首都醫(yī)科大學附屬北京天壇醫(yī)院國家神經(jīng)疾病醫(yī)學中心招聘3人備考題庫及一套答案詳解
- 2025河南漯河市科教文化藝術(shù)中心人才引進1人備考題庫及參考答案詳解一套
- 2025北京工業(yè)大學聘用制人員招聘1人備考題庫(第十八批)有完整答案詳解
- 2026暨南大學附屬第一醫(yī)院粵西醫(yī)院(陽西總醫(yī)院)就業(yè)見習崗位74人備考題庫(廣東)帶答案詳解
- 2026云南金智瑞貴金屬冶煉股份有限公司招聘備考題庫及完整答案詳解
- 2026年甘肅省蘭州天立學校后勤部招聘備考題庫(19+人)及參考答案詳解一套
- 地鐵施工現(xiàn)場防臺風措施
- 種植業(yè)合作社賬務處理
- 【麗江玉龍旅游薪酬制度的創(chuàng)新研究6100字】
- 公司兩權(quán)分離管理制度
- 車輛叉車日常檢查記錄表
- 廣東高校畢業(yè)生“三支一扶”計劃招募考試真題2024
- 膠帶機硫化工藝.課件
- 種雞免疫工作總結(jié)
- 河南省商丘市柘城縣2024-2025學年八年級上學期期末數(shù)學試題(含答案)
- 河南省信陽市2024-2025學年高二上學期1月期末英語試題(含答案無聽力原文及音頻)
- 給女朋友申請書
評論
0/150
提交評論