资源预览内容
第1页 / 共18页
第2页 / 共18页
第3页 / 共18页
第4页 / 共18页
第5页 / 共18页
第6页 / 共18页
第7页 / 共18页
第8页 / 共18页
第9页 / 共18页
第10页 / 共18页
亲,该文档总共18页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
西北工业大学电子服务系统设计 实验才艮告一、实验目的及要求1、练习实验环境的搭建。2、 练习一个web服务的实施,包括创建一个 web服务、部署一个web服务和调 用一个web服务。3、练习取消(收回)一个 web服务。二、实验设备(环境)及要求PC机最低配置:2GH彼上CPU; 1G以上内存;1G自由硬盘空间JDK1.5.0 ; Eclipse ; Axis2 ; axis2-eclipse-codegen-wizard-1.4三、实验内容与步骤1、练习实验环境的搭建2、 练习用可视化的方法(或其它方法)生成WSDLC件3、校验WSDL:件4、生成服务桩5、实施web服务6、部署并查看web服务7、用客户桩产生客户端8、实施并运行web服务9、取消(收回)web服务四、实验结果与数据处理1、安装开发 WebService的插件(在实验二中已安装)FinishCancelC reate 目 Java 匚ImwsWizards;type filler text案Java Project from Existing Ant Buildffile 隅 Plug-in Praject二 Generalv Axis2 Wiaards4 Axi2 Cod GeneratorAxiService Archiverj - Connection ProfilesDatabase Web Srvict5Eclipse Modeling -rametvork EJB将Axis2服务部署到Tomcat下 本(E:) Tomcat webappV 0 aiweb, P-DB0修改日期大小a松2017 12/10 17;27次快dues2017/12/10 17126exanrples2017/12/10 17:26host-manager2017/12/1017i26文玲夹manager2017/12/10 17:2文牛奏ROOT2017/12/10 17;26文快axi日T猝ksUser Assistance 4 Webw Web Services宛 Ant Files=jgl Unit Test UDDlWfrb Servi二 V7eb Service Client& WSDL File & JAX-WS10 11 12r 131415 16IS 19 70 止WSD咛的原始代码如下:1 |c r*xnl er5icn=_l.0M encoding=H(/7F-* 5tandalone=i,no-?z w=,dl: dpfinitins wulns; aap=thttp: /chffna . xmL snap. arg/udL /aoap/1 xmlng;tns wx$d: ichtina tarfietNameipace=r7ictp:/7tc;fev,xxsd: ccxnplPxTypp?Kbtl:clQirent namein,r type-xsd:str/x5d: sflquf?nc/xbdiconplexlype*p0nefl-i/xsd sequence/xsd;r FF 1g iN H.MJI Ji.p dr1*1 concatRequsst(E : EnEtTyp 财E stringI cl 我 stringDesign Source事 Linrip.$) Ini nm MebiFFa n-linnpIp&Frvire HI #回 BratK*pod|Tppci回 匚 EcmtReguieEl:画匚 nw武;stringiDrign : r-ir t摩 SimpkSeTvitcwdl 23Simple ServiceQ SmpeSenflce& $ impleS tryioeSOAP季 ccrcathrtpiZ/1 q LdlliQit 80SG,白】inputE3 paranwtercE concMKquttJlcutpjtparametersE concat:Response3、校验WSDLe件验证 WSD或件,以确保它符合各种 web服务标准。右键单击 eclipse 中的 SimpleService.wsdl文件,选择验证,如果有错,在该窗口会有问题报告。3E AitisZ Codegen Wizard XOutputS-i&t ilie Output OCStr&n for the generated CQCeSelect one of below to the codegen output either on eclipse workspace project or on file system and then browse to enter the output path Broy And ?elect r project on rurrent eclipse workspaceQ) Browse and select location on local file s/stemOutput pathE:edi pseifforkspaceSimpleServiceBrowse.Add the Ajcis2 ccdeqen jas tc the codecen resullted projectMAdd Axis2 libraries to the ccdeqer result projectAxss Home:ajas2-1 -6.2-binaxis2-1.6.2Browse-BChrk Lib,. I Axis libs loaded successfully n01 Create a jar file of codegen resiblt p rojec: ndl add to re-sulted project lib f elder (Default: Cod c g e nRe su Its J a rjJar Hie NameP*ge Hint EnMhCancel生成后项目代码结构如下:7 _ SimpleS ?rvkev srtv ;廿 com.ttdew.ssCencatRequestJa/3.i ConcatRcponejava.ExtensionMapper.javsi Si mpl eServi c eM e s sa geReceive r| n Outj avaSimpleServiceSkeleton.java疗 SimpleServiceSkeletonlnterfaceJaYaf- u J RE System Library Jav ,E土 Referenced Ubrariww Dbv , rsGourees,X 5BFVBCE5 .XITil0 Simpl&Gervice,w?dI爵 build-Km IEimpleSen/ice.wsdl5、实施 WebService修改 SimpleServiceSkeleton.java的代码如下:jj SiiiTpEtSef - ce&keletDnjatfai 我12 public class SimpIqSorvi(.eSkeleton implements SimplScrviceSkcletonlnterfjlq13141116 xAuto generatedmethod signature117 *gl*param roncatequetR|19*Return国 721|22public com.ttdcv*s5,ConcatRcspunconcat肛s(com. ttdev.i*,CDnatRet|ueit ehl业札一中心山)M9S2SString result = roncat:equestgetSl( + S 0 151Using AK S7_H011E F. e-L, n. S-binaris- r 6. 2bln.LltffOl LSirpl ATLsServer 1 Starti
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号