欢迎来到天天文库
浏览记录
ID:51617612
大小:627.50 KB
页数:13页
时间:2020-03-26
《Java语言程序设计与数据结构 基础篇原书第11版PPT及其他教辅资源41slide.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、1Chapter41WebServices2ObjectivesTodescribewhataWebserviceis(§41.1).TocreateaWebserviceclass(§41.2).TopublishandtestaWebservice(§41.3).TocreateaWebserviceclientreference(§41.4).ToexplaintheroleofWSDL(§41.4).TopassobjecttypeofargumentsinaWebservice(§41.5).Todiscoverhowaclientc
2、ommunicateswithaWebservice(§41.5).TodescribewhatareSOAPrequestandSOAPresponse(§41.5).TotrackasessioninWebservices(§41.6).3WhatisaWebService?WebserviceisatechnologythatenablesprogramstocommunicatethroughHTTPontheInternet.Webservicesenableaprogramononesystemtoinvokeamethodinan
3、objectonanothersystem.YoucandevelopanduseWebservicesusinganylanguagesonanyplatform.Webservicesaresimpleandeasytodevelop.4WhatisSOAP?WebservicesrunontheWebusingHTTP.ThereareseveralAPIsforWebservices.ApopularstandardistheSimpleObjectAccessProtocol(SOAP),whichisbasedonXML.Theco
4、mputeronwhichaWebserviceresidesisreferredtoasaserver.Theserverneedstomaketheserviceavailabletotheclient,knownaspublishingaWebservice.UsingaWebservicefromaclientisknownasconsumingaWebservice.5HowdoesaclientcommunicatewithaWebserviceAclientinteractswithaWebservicethroughaproxy
5、object.TheproxyobjectfacilitatesthecommunicationbetweentheclientandtheWebservice.Theclientpassesargumentstoinvokemethodsontheproxyobject.Theproxyobjectsendstherequesttotheserverandreceivestheresultbackfromtheserver,asshowninFigure41.1.6CreatingWebServicesUsingNetBeansCreatea
6、Webproject,CreateaWebservice,deployWebservice7TestingWebServices8TestingWebServices9ConsumingWebServicesCreatingaWebserviceclient10WhatisWSDL?WhenyoucreatedaWebservicereference,youenteredaWSDLURL,asshowninFigure41.6.A.wsdlfileiscreatedunderthexm-resourcesfolder,asshowninFigu
7、re41.8.SowhatisWSDL?WSDLstandsforWebServiceDescriptionLanguage.A.wsdlfileisanXMLfilethatdescribestheavailableWebservicetotheclient,i.e.,theremotemethods,theirparameters,andreturnvaluetypes,etc.11PassingandReturningArguments12XMLserialization/deserializationCanyoupassanargume
8、ntofanytypebetweenaclientandaWebservice?No.SOAPonlysupportsprimitivetypes,w
此文档下载收益归作者所有