版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Axis1.4 wsdl生成webservice服务端代码最近做了一个项目,要用到webservice. 我方为服务方,wsdl被合作方已写好.下面记录步骤详解 以备以后使用.1. 创建一web项目: 例子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 . 会生成一些服务端代码.有 AdcSiRequest.java
3、(自定义输入类)AdcSiResponse.java (自定义输出类)SIInterface.javaSIInterfaceLocator.javaSIInterfaceSoap12Impl.javaSIInterfaceSoap12Stub.javaSIInterfaceSoap_BindingImpl.java (服务类)SIInterfaceSoap_BindingStub.java (客户端调用的类)SIInterfaceSoap_PortType.java和部署文件: deploy.wsddundeploy.wsdd5. 拷贝一份axis的web.xml 覆盖工程中的web.xml6
4、. 新建一份server-config.wsdd,从deploy.wsdd拷贝相关的内容<service></service>7. 就可以部署到tomcat下了,启动tomcat,打开:8080/ TestWebService /services/ SIInterface?wsdl wsdl与原来创建的wsdl是一样的。8. 使用Class 调用webservice.9. 如果要开发服务器端 配置文件用下面的即可.例子的使用文件: -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. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 《FZT 50056-2021合成纤维 短纤维拒水性能试验方法》专题研究报告
- 道路安全培训会议通知课件
- 2026年广西壮族自治区河池市高职单招语文试题附答案
- 道口安全知识培训小结课件
- 2024+共识声明:成人心脏手术患者快速拔管建议
- 边检站消防安全培训记录课件
- 辰溪消防安全培训课件
- 车队安全培训美篇标题课件
- 防雷接地工程量计算试题及答案
- 车间质量问题培训课件
- 高压值班安全培训内容课件
- 网络信息安全运维管理手册
- 公安副职竞聘考试题库及答案
- 智慧方案智慧生活垃圾焚烧发电厂解决方案
- 呛奶窒息培训课件
- 《寻找时传祥》课件
- 安全质量组织机构及各岗位职责
- 2025年度商铺装修工程总包与施工合同
- 弘历指标源码6个(仅提供源码)
- DBJT15-206-2020 广东省农村生活污水处理设施建设技术规程
- 软件产品用户体验评估报告
评论
0/150
提交评论