欢迎来到天天文库
浏览记录
ID:51617556
大小:630.00 KB
页数:13页
时间:2020-03-26
《Java语言程序设计10E LiangPPT习题案例39slide.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、1Chapter39WebServices2ObjectivesTodescribewhataWebserviceis(§39.1).TocreateaWebserviceclass(§39.2).TopublishandtestaWebservice(§39.3).TocreateaWebserviceclientreference(§39.4).ToexplaintheroleofWSDL(§39.4).TopassobjecttypeofargumentsinaWebservice(§39
2、.5).TodiscoverhowaclientcommunicateswithaWebservice(§39.5).TodescribewhatareSOAPrequestandSOAPresponse(§39.5).TotrackasessioninWebservices(§39.6).3WhatisaWebService?WebserviceisatechnologythatenablesprogramstocommunicatethroughHTTPontheInternet.Webse
3、rvicesenableaprogramononesystemtoinvokeamethodinanobjectonanothersystem.YoucandevelopanduseWebservicesusinganylanguagesonanyplatform.Webservicesaresimpleandeasytodevelop.4WhatisSOAP?WebservicesrunontheWebusingHTTP.ThereareseveralAPIsforWebservices.Ap
4、opularstandardistheSimpleObjectAccessProtocol(SOAP),whichisbasedonXML.ThecomputeronwhichaWebserviceresidesisreferredtoasaserver.Theserverneedstomaketheserviceavailabletotheclient,knownaspublishingaWebservice.UsingaWebservicefromaclientisknownasconsum
5、ingaWebservice.5HowdoesaclientcommunicatewithaWebserviceAclientinteractswithaWebservicethroughaproxyobject.TheproxyobjectfacilitatesthecommunicationbetweentheclientandtheWebservice.Theclientpassesargumentstoinvokemethodsontheproxyobject.Theproxyobjec
6、tsendstherequesttotheserverandreceivestheresultbackfromtheserver,asshowninFigure39.1.6CreatingWebServicesUsingNetBeansCreateaWebproject,CreateaWebservice,deployWebservice7TestingWebServices8TestingWebServices9ConsumingWebServicesCreatingaWebservicecl
7、ient10WhatisWSDL?WhenyoucreatedaWebservicereference,youenteredaWSDLURL,asshowninFigure39.6.A.wsdlfileiscreatedunderthexm-resourcesfolder,asshowninFigure39.8.SowhatisWSDL?WSDLstandsforWebServiceDescriptionLanguage.A.wsdlfileisanXMLfilethatdescribesthe
8、availableWebservicetotheclient,i.e.,theremotemethods,theirparameters,andreturnvaluetypes,etc.11PassingandReturningArguments12XMLserialization/deserializationCanyoupassanargumentofanytypebetweenaclientandaWebservice?No.SOAPonlysupportsprimitivetypes,w
此文档下载收益归作者所有