下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
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); / 設(shè)置要調(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)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年江西南昌萬壽宮文化街區(qū)運營管理有限公司招聘筆試參考題庫附帶答案詳解
- 2025版協(xié)議離婚特殊規(guī)定及子女撫養(yǎng)權(quán)分割與贍養(yǎng)協(xié)議書9篇
- 2025年度個人財產(chǎn)質(zhì)押擔(dān)保合同模板大全
- 2025年度個人信用評分貸款合同范本參考
- 2025-2030全球異型坯連鑄機行業(yè)調(diào)研及趨勢分析報告
- 2025-2030全球無齒槽空心杯減速電機行業(yè)調(diào)研及趨勢分析報告
- 2025版軍事基地視頻監(jiān)控設(shè)備升級與維護服務(wù)合同3篇
- 2025-2030全球結(jié)構(gòu)型隔音用蜂窩行業(yè)調(diào)研及趨勢分析報告
- 2025年全球及中國廢棄食用油轉(zhuǎn)化催化劑行業(yè)頭部企業(yè)市場占有率及排名調(diào)研報告
- 2025年全球及中國輕型冷凍柜行業(yè)頭部企業(yè)市場占有率及排名調(diào)研報告
- 完整版秸稈炭化成型綜合利用項目可行性研究報告
- 油氣行業(yè)人才需求預(yù)測-洞察分析
- 《數(shù)據(jù)采集技術(shù)》課件-Scrapy 框架的基本操作
- (2024)河南省公務(wù)員考試《行測》真題及答案解析
- 圍城讀書分享課件
- 2025年河北省單招語文模擬測試二(原卷版)
- 工作計劃 2025年度醫(yī)院工作計劃
- 高一化學(xué)《活潑的金屬單質(zhì)-鈉》分層練習(xí)含答案解析
- DB34∕T 4010-2021 水利工程外觀質(zhì)量評定規(guī)程
- 2024年內(nèi)蒙古中考英語試卷五套合卷附答案
- 2024年電工(高級)證考試題庫及答案
評論
0/150
提交評論