




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Axis1.4 wsdl生成webservice服務(wù)端代碼最近做了一個(gè)項(xiàng)目,要用到webservice. 我方為服務(wù)方,wsdl被合作方已寫好.下面記錄步驟詳解 以備以后使用.1. 創(chuàng)建一web項(xiàng)目: 例子TestWebService2. 下載axis1.4 得到lib下面的全部jar. Copy至TestWebService 的lib目錄下.3. 在WebRoot下新建文件夾doc,將 wsdl文件(例:SIInterface.wsdl )拷貝到doc 下4. 在doc中新建bat文件WSDL2Java.bat編輯WSDL2Java.bat : set Axis_Lib=D:javawork
2、spaceTestWebServiceWebRootWEB-INFlibset Java_Cmd=java -Djava.ext.dirs=%Axis_Lib% set Output_Path=D:javaworkspaceTestWebServicesrc set Package=miniboss.server %Java_Cmd% org.apache.axis.wsdl.WSDL2Java -o%Output_Path% -p%Package% -server-side SIInterface.wsdl 保存,雙擊bat . 會(huì)生成一些服務(wù)端代碼.有 AdcSiRequest.java
3、(自定義輸入類)AdcSiResponse.java (自定義輸出類)SIInterface.javaSIInterfaceLocator.javaSIInterfaceSoap12Impl.javaSIInterfaceSoap12Stub.javaSIInterfaceSoap_BindingImpl.java (服務(wù)類)SIInterfaceSoap_BindingStub.java (客戶端調(diào)用的類)SIInterfaceSoap_PortType.java和部署文件: deploy.wsddundeploy.wsdd5. 拷貝一份axis的web.xml 覆蓋工程中的web.xml6
4、. 新建一份server-config.wsdd,從deploy.wsdd拷貝相關(guān)的內(nèi)容<service></service>7. 就可以部署到tomcat下了,啟動(dòng)tomcat,打開(kāi):8080/ TestWebService /services/ SIInterface?wsdl wsdl與原來(lái)創(chuàng)建的wsdl是一樣的。8. 使用Class 調(diào)用webservice.9. 如果要開(kāi)發(fā)服務(wù)器端 配置文件用下面的即可.例子的使用文件: -server-config.wsdd -<?xml version="1.0" e
5、ncoding="UTF-8" ?> - <wsdl:definitions targetNamespace=" xmlns:apachesoap="/xml-soap" xmlns:impl=" xmlns:intf=" xmlns:wsdl="/wsdl/" xmlns:wsdlsoap="/wsdl/soap/" xmlns:xs
6、d="/2001/XMLSchema">- <!- WSDL created by Apache Axis version: 1.4Built on Apr 22, 2006 (06:55:48 PDT) -> - <wsdl:types>- <schema elementFormDefault="qualified" targetNamespace=" xmlns="/2001/XMLSchema">+ &
7、lt;element name="ADCSIInterface">+ <complexType>- <sequence> <element name="request" type="impl:AdcSiRequest" /> </sequence> </complexType> </element>- <complexType name="AdcSiRequest">- <
8、;sequence> <element maxOccurs="1" minOccurs="0" name="BizCode" nillable="true" type="xsd:string" /> <element maxOccurs="1" minOccurs="0" name="TransID" nillable="true" type="xsd:st
9、ring" /> <element maxOccurs="1" minOccurs="0" name="TimeStamp" nillable="true" type="xsd:string" /> <element name="ActionCode" type="xsd:int" /> <element maxOccurs="1" minOccur
10、s="0" name="SIAppID" type="xsd:string" /> <element name="TestFlag" type="xsd:int" /> <element name="Dealkind" type="xsd:int" /> <element name="Priority" type="xsd:int" /&g
11、t; <element maxOccurs="1" minOccurs="0" name="Version" nillable="true" type="xsd:string" /> <element maxOccurs="1" minOccurs="0" name="SvcCont" nillable="true" type="xsd:string"
12、 /> </sequence> </complexType>- <element name="ADCSIInterfaceResponse">- <complexType>- <sequence> <element name="ADCSIInterfaceResult" type="impl:AdcSiResponse" /> </sequence> </complexType
13、> </element>- <complexType name="AdcSiResponse">- <sequence> <element maxOccurs="1" minOccurs="0" name="BizCode" nillable="true" type="xsd:string" /> <element maxOccurs="1" minOccur
14、s="0" name="TransID" nillable="true" type="xsd:string" /> <element name="ActionCode" type="xsd:int" /> <element maxOccurs="1" minOccurs="0" name="TimeStamp" nillable="true" t
15、ype="xsd:string" /> <element maxOccurs="1" minOccurs="0" name="SIAppID" type="xsd:string" /> <element name="TestFlag" type="xsd:int" /> <element name="Dealkind" type="xsd:int&q
16、uot; /> <element name="Priority" type="xsd:int" /> <element maxOccurs="1" minOccurs="0" name="Version" nillable="true" type="xsd:string" /> <element maxOccurs="1" minOccurs="0&
17、quot; name="ResultCode" nillable="true" type="xsd:string" /> <element maxOccurs="1" minOccurs="0" name="ResultMsg" nillable="true" type="xsd:string" /> <element maxOccurs="1" minOccurs
18、="0" name="SvcCont" nillable="true" type="xsd:string" /> </sequence> </complexType> </schema> </wsdl:types>- <wsdl:message name="ADCSIInterfaceResponse"> <wsdl:part element="impl
19、:ADCSIInterfaceResponse" name="parameters" /> </wsdl:message>- <wsdl:message name="ADCSIInterfaceRequest"> <wsdl:part element="impl:ADCSIInterface" name="parameters" /> </wsdl:message>- <wsdl:portType name
20、="SIInterfaceSoap">- <wsdl:operation name="ADCSIInterface"> <wsdl:input message="impl:ADCSIInterfaceRequest" name="ADCSIInterfaceRequest" /> <wsdl:output message="impl:ADCSIInterfaceResponse" name="ADCSIInterfaceRe
21、sponse" /> </wsdl:operation> </wsdl:portType>- <wsdl:binding name="SIInterfaceSoapSoapBinding" type="impl:SIInterfaceSoap"> <wsdlsoap:binding style="document" transport="/soap/http" />
22、 - <wsdl:operation name="ADCSIInterface"> <wsdlsoap:operation soapAction=" /> - <wsdl:input name="ADCSIInterfaceRequest"> <wsdlsoap:body use="literal" /> </wsdl:input>- <wsdl:output name="ADCSIInterfaceRespon
23、se"> <wsdlsoap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding>- <wsdl:service name="SIInterface">- <wsdl:port binding="impl:SIInterfaceSoapSoapBinding" name="SIInterfaceSoap&qu
24、ot;> <wsdlsoap:address location="http:/localhost:10010/TestWebService/services/SIInterfaceSoap" /> </wsdl:port> </wsdl:service> </wsdl:definitions>-web.xml-<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE
25、web-app PUBLIC "-/Sun Microsystems, Inc./DTD WebApplication 2.3/EN" "<web-app><display-name>Apache-Axis</display-name><listener><listener-class>org.apache.axis.transport.http.AxisHTTPSessionListener</listener-class></listener><servlet>&l
26、t;servlet-name>AxisServlet</servlet-name><display-name>Apache-Axis Servlet</display-name><servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class></servlet><servlet><servlet-name>AdminServlet</servlet-name><display-name>A
27、xis Admin Servlet</display-name><servlet-class>org.apache.axis.transport.http.AdminServlet</servlet-class><load-on-startup>100</load-on-startup></servlet><servlet><servlet-name>SOAPMonitorService</servlet-name><display-name>SOAPMonitorServi
28、ce</display-name><servlet-class>org.apache.axis.monitor.SOAPMonitorService</servlet-class><init-param><param-name>SOAPMonitorPort</param-name><param-value>5001</param-value></init-param><load-on-startup>100</load-on-startup></servl
29、et><servlet-mapping><servlet-name>AxisServlet</servlet-name><url-pattern>/servlet/AxisServlet</url-pattern></servlet-mapping><servlet-mapping><servlet-name>AxisServlet</servlet-name><url-pattern>*.jws</url-pattern></servlet-mapp
30、ing><servlet-mapping><servlet-name>AxisServlet</servlet-name><url-pattern>/services/*</url-pattern></servlet-mapping><servlet-mapping><servlet-name>SOAPMonitorService</servlet-name><url-pattern>/SOAPMonitor</url-pattern></servlet-mapping><!- uncomment this if you want the admin s
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年常州信息職業(yè)技術(shù)學(xué)院高職單招職業(yè)適應(yīng)性測(cè)試歷年(2019-2024年)真題考點(diǎn)試卷含答案解析
- 2025年03月上半年浙江舟山市普陀區(qū)部分事業(yè)單位公開(kāi)招聘工作人員20人筆試歷年典型考題(歷年真題考點(diǎn))解題思路附帶答案詳解
- 2025年山西林業(yè)職業(yè)技術(shù)學(xué)院高職單招職業(yè)技能測(cè)試近5年??及鎱⒖碱}庫(kù)含答案解析
- 2025年山東文化產(chǎn)業(yè)職業(yè)學(xué)院高職單招(數(shù)學(xué))歷年真題考點(diǎn)含答案解析
- 2025年宿遷職業(yè)技術(shù)學(xué)院高職單招職業(yè)技能測(cè)試近5年??及鎱⒖碱}庫(kù)含答案解析
- 2025年寶雞職業(yè)技術(shù)學(xué)院高職單招職業(yè)適應(yīng)性測(cè)試歷年(2019-2024年)真題考點(diǎn)試卷含答案解析
- IP基礎(chǔ)知識(shí)課件下載
- 下肢靜脈血栓用藥護(hù)理
- 2025年天津?yàn)I海汽車工程職業(yè)學(xué)院高職單招語(yǔ)文2019-2024歷年真題考點(diǎn)試卷含答案解析
- 2025年天津工程職業(yè)技術(shù)學(xué)院高職單招職業(yè)適應(yīng)性測(cè)試歷年(2019-2024年)真題考點(diǎn)試卷含答案解析
- 2024年高考真題-地理(河北卷) 含答案
- 2024年湖北省高考數(shù)學(xué)第二次聯(lián)考試卷附答案解析
- 4.1.2-指數(shù)函數(shù)的性質(zhì)與圖象教學(xué)設(shè)計(jì)
- 醫(yī)院質(zhì)量管理及評(píng)估制度
- 平房區(qū)全面推進(jìn)信訪工作法治化測(cè)試練習(xí)試卷附答案
- 大英賽練習(xí)題
- 2024年湖南省中考數(shù)學(xué)試題卷(含答案解析)
- 九年級(jí)語(yǔ)文下冊(cè) 第二單元 8 蒲柳人家(節(jié)選)教案 新人教版
- 經(jīng)營(yíng)分析培訓(xùn)課件(課件)
- 2024CSCO腫瘤患者靜脈血栓防治指南解讀
- 2023-2024學(xué)年湖北省荊門市京山市八年級(jí)(下)期中數(shù)學(xué)試卷(含解析)
評(píng)論
0/150
提交評(píng)論