《Project 1 SOAP Extensions ---- 网页服务程序构件设计指要.docx》由会员分享,可在线阅读,更多相关《Project 1 SOAP Extensions ---- 网页服务程序构件设计指要.docx(5页珍藏版)》请在优知文库上搜索。
1、Project1SOAPExtensions-网页服务程序构件设计指要詹叔浩TheprojectrequiresapplicationdeveloperstoaddcreditcardpaymentfeatureintoanexistingretailsalessystemIbrachainstore.Stepbystep,thedocumenthighlightshow(odevelopapplicationofSOAPXM1.WebServicesandSOAPWebServices.Anddocumentwillissueimportantdetailsifyouworkonacompl
2、exsystemwhichcontainsbothWebServicesandXM1.WebServices.KEYWORDS:WebServices.XM1.WebServices.SOAP.SOAPExtensions,SOAHeadersModelofClientandServerSOAPCommunicationClientSideReferringto(hefigureabove,wewilladdfeatureofprocessingSOAPmessagetothebelowexistingSOAPWebServiceswithoutSOAPEXIenS沁ns.Also,theSO
3、APmassageincludescostumercreditcardinfosuchascardnumber. ASynehronoUSCailIoaWebmethoddoesnotblockothercallingswhilethiscalliswaitingforaresult.Wheneverdevelopercreatesaproxyclassonclientside.NETautomaticallyenablesasynchronouscallstoWebmethods. SerializationprocessesSOAPmessageandconvertsoneormoreme
4、ssageobjectstotheirXM1.reresentaUon. De-serializationprocessesSOAPmessageandconvertsoneormoremessageobjectstotheirbinaryrepresentation. SOAPRequestmeansaSOAPmessagesentfromclienttoserverforinvokingaWebInCIhod. SOAPResponsemeansaSOPmessagesentfromservertoclientwiththeresultsofaWebmethod.$1SolutionMod
5、elandAlgorithmReferringIothefigurebelow,(heblackdisksindicatewhereSOAPExtensionsperlb11n. TheXM1.WebServiceisnamed1.ookUpService. Theservice1.ookUpServiceexposesaWebmethodnamedRetrieveCardInfo. ThemethodRetiieveCaidInfotakescreditcardinfofromSQ1.serverdatabaseandreturnsit. Wecaptureandinspectandmlif
6、ySOAPmessageinWebmethtxlRetrieveCardInfo.ModelofClientandServerSO.PCommunicationWITHSoAPExtensions$2ThreeMajorCodingSteps1. WecreateHTTPandSOAPXM1.webser,iceusing.NETFramework(selectingConsoleApplication).2. WederiveSOAPExtensionsCIaSSeSfromSoapExtensionbaseclass.Thus,theclassesexposeanditnplenenthe
7、followingmethods:*Getlnitialize(tobecalledonetimewhenasoapextensionisfirstloaded),*Initialize(tobecalledeachtimeforeachcallingSOAPwebservice);*ChainStream(forinterceptingactualsoapmessagestream),and*ProcessMessage(tobecalledwihactualrequestandresponse).3. WeinterceptaSOAPmessageandcallmethodEncrplMe
8、ssageafterserializationstageandcallmethodDecryptMessagebeforedeserializationstage.$3TechnicalNotesWhydorselectSQAPExtensionsratherthanS。APheaderSinthisproject?ThiSprojectrequiresonlycaptureandPrOCCdUreOfconfideniiaiSOAPmessagesinsteadofsecurityconcernssuchasauthentication(Ex:usernameandpasswordfor,l
9、og-in)andauthorization(Ex:applicationrole)andencryption(Ex.convertingtextlosecretcode). SOAPCX)CnSiOnSareaclassIobeinvokedduringtheserializationordeserializationofSOAPmessageandtoallowdevelopertoinsertcustomer-owncodeintoSOAPrequestandresponseprocessloop.SOAPextensionsareusuallydeployedinpairswithma
10、tchinglheextensiononclientandserver. SOAPheadersareaclasslobederivedfromSoapHeaderbaseclassandrepresentlhedatainaparticularSOAPheader.SOAPheadershandleauthentication,encryption,andsigningdirectlyinSOAPmessages.$4WholePictureofVVebServicesandXM1.WebServicesShowingastheFigbelow,supposeanobjectofclient
11、applicationinteractswithoneobjectofanotherclientapplicationoverinternetandserverofwebservices.ReferringtotheSketchFigureonthelastpage,wediscussthetechnicaltermsbelow.(示意图) SOAP(SilnPlCObjectAccessProtocol)isastandardoencapsulatemessagesbetweenWebservicesSerVerandWebservicesclientwhenthemessageobject
12、s(aswellasmethodsandproperties)aretransmittedasXM1.formatthroughHTTPchannel.Remember,messageobjectscannobeinvoked! DiscoisaMicrosoftstandardtodiscoverdocumentsofWebservicesonserverbydirectoryconnectingtotheserver. UDDI(UniversalDescription.Discovery,andIntegration)isamultivendorstandardtodiscovercod
13、edetails(documents,classes,methods,andsoon)oftheWebservicesandotheronlinebusinesssericesbydirectoryvia(heInternet. VVSD1.(WebSerViCeDescription1.anguage)isastandardodescribetheinterfacebetweentheWebservicesandtheWebSerViCeSserver.InIact,WSD1.letdevelopertoretrieveinformationontheclassesandmethodssup
14、portedbyaparticularWebservice. Disco.exeisa100lrelatedIoDiscotodiscoverdocumentsofWebSerViCeSonserver. VVsd1.exemaycreatePrOXyClaSSconnecedloWebReferenCeforcommunicatingwithXM1.Webservice.Also,aIQCalProxyCIUSSconnectedtoWebReferencemaybecreatedforcommunicatingwithWebservice.Whendowcselectthetechniqu
15、esWsdl.cxc?TherearebothofWebserviceandXM1.Webserviceintheexistinginternetsystem.Andadevelopermayaddnew-bothsendeestotheexistingsystem. SOAPProxyToolisused(otestanddebugWebservicewithoutexecutingWebserviceclientapplication. XW1.wireformatistheStnictureofactualXM1.passedbetweenWebservicesserverandWebS
16、erViCeSclient.Byusingattributes,.NETallowsdevelopertotailorXM1.wireformatofSOAPmessageinordertointeroperatewithotherWebservicescomponentstonotbecreatedby.NETframeworkor.NETlanguage.(示意图)SketchFigureShowingArchitectureOfWebServiceandXM1.WebService(ContinuingtotheNextPage)ManulyCreateWsd1.exe.NETStudoAutoCfteDEVE1.OPERADDVVetSerVgCbertProduce1.ess