




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年全球及中国特种碳材料用浸渍沥青行业头部企业市场占有率及排名调研报告
- 柴油发动机生产项目可行性研究报告立项新版
- 行业规范电子交易平台运营计划
- 秸秆饲料项目可行性研究报告
- 新小学体育个人工作计划
- 2020-2025年中国环保花盆行业发展潜力分析及投资方向研究报告
- 社交媒体平台用户增长策略方案
- 纺织机械项目可行性分析报告(模板参考范文)
- 新货代工作计划
- 宣城松香项目商业计划书
- Python编程基础(项目式微课版)教案1 1.1 Python概述
- 内科护理学心肌病病人的护理
- 广东省2024年中考数学试卷(含答案)
- 2024年共青团入团发展对象、积极分子考试测试题库(附答案)
- 重大决策社会稳定风险评估规范
- 2024年全国职业院校技能大赛“装配式建筑构件安装”赛项备赛试题库500题(含答案)
- 施工组织设计-麒麟人工智能产业园 D 区项目1-1#、1-2#、2-1#、2-2#、3-1#、3-2#、4#、5#楼及地下车库工程总承包(装配式)
- 食材配送服务方案投标方案(技术方案)
- CJJT148-2010 城镇燃气加臭技术规程
- Unit3TravelPlansLesson3(课件)人教新起点版英语四年级下册
- 《3-6岁儿童学习与发展指南》考试复习题库350题(含答案)
评论
0/150
提交评论