service-enabled)_第1页
service-enabled)_第2页
service-enabled)_第3页
service-enabled)_第4页
service-enabled)_第5页
已阅读5页,还剩33页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Lecture 10:Web ServicesOutlineOverview of Web ServicesSOAP (messaging)WSDL (service description)UDDI (registry)A bit of buzz (1)“By 2006, Web services will take hold as a competitive differentiator in business relationships and product innovation. Enterprises that want to remain competitive will nee

2、d to use Web services to provide commonly requested data to their partners. It is imperative that enterprises develop a strategy for how to use Web services to develop products, including hard goods, digital goods and services.”Gartner Research, November 2003 A bit of buzz (2)Yankee Group, Nov. 2004

3、 survey (437 entreprises)48% have already deployed Web Services39% will deploy Web Services within one year71% will increase spending on Web Services in 2005Jeff Bezos (CEO Amazon), Tech. Review 01/2005“Web 1.0 was making the Internet for people; Web 2.0 is making the Internet better for computers”W

4、hat is a Web Service?A web service is a network accessible interface to application programs, built using standard Internet technologies.Clients of web services do NOT need to know how it is implemented. ApplicationclientApplicationprogramNetworkWebServiceA Web Service is a URL-addressable software

5、resource that performs functions (or a function).Web services are a new breed of Web application. They are self-contained, self-describing, modular applications that can be published, located, and invoked across the Web. Web services perform functions, which can be anything from simple requests to c

6、omplicated business processes. Once a Web service is deployed, other applications (and other Web services) can discover and invoke the deployed service.” IBM web service tutorial Web Services: Some DefinitionsWeb EvolutionTechnologyTCP/IPHTMLXMLPurposeConnectivityPresentationProgrammabilityApplicati

7、onsE-Mail, FTPWeb PagesWeb ServicesOutcomeCreate the WebBrowse the WebProgram the WebWeb Service ArchitectureService providerService brokerService requestorpublish(WSDL)find(UDDI)bind(SOAP)serverclientnaming serviceWeb Service StackA set of standards for implementing web servicesTransport: HTTP, SMT

8、P, FTTP, Messaging: SOAPService Description: WSDLPublication and Discovery: UDDIextends HTTPextends HTMLextends URI9Basic Web Service Usage ScenarioWeb Service Repository(UDDI)publish webserviceWeb ServiceProvider 1 registerWSDL file(manually)(manual) web service lookup2 http get 3 WSDL file write c

9、lientapplicationdeploy clientapplication4 SOAP request 5 SOAP response Web Services ImplementationApplication Server (web service-enabled)provides implementation of services and exposes it through WSDL/SOAPimplementation in Java, as EJB, as .NET (C#) etc.SOAP serverimplements the SOAP protocolHTTP s

10、erverstandard Web serverSOAP clientimplements the SOAP protocol on the client siteRequestor(SOAP client)Web Service Provider(endpoint)HTTP serverSOAP serverapplication serverSOAP messages(http transport)Down to earth example: Amazon Web Services/gp/aws/landing.htmlExposes worlds largest product data

11、base through Web ServicesCounterintuitive strategy? (cf. Google)Idea: let others figure out how to sell products for usAssociates program enables Web sites to link to A and earn referral feesBy November 2004: 65000 developersSome interesting examples: Lightweight messaging framework based on XMLSupp

12、orts simple messaging and RPCSOAP consists ofEnvelope construct: defines the overall structure of messagesEncoding rules: define the serialization of application data typesSOAP RPC: defines representation of remote procedure calls and responsesBinding framework: binding to protocols such as HTTP, SM

13、TPFault handlingSoap supports advanced message processing:forwarding intermediaries: route messages based on the semantics of messageactive intermediaries: do additional processing before forwarding messages, may modify message2. SOAP Simple Object Access Protocol13SOAP MessageSOAP messages consist

14、ofEnvelope: top element of XML message (required)Header: general information on message such as security (optional)Body: data exchanged (required)Headerelements are application-specificmay be processed and changedby intermediaries or recipientBodyelements are application-specificprocessed by recipie

15、nt onlyenvelopeheaderbodySkeleton SOAP Message . . . . . . 2001-11-29T13:20:00.000-05:00 ke Jgvan yvind New York Los Angeles 2001-12-14 Los Angeles New York 2001-12-20 Example: SOAP MessageEnvelopeHeader Body SOAP attributes SOAP attributes 16Conversational Message Exchanges in SOAPproposeditinerary

16、alternativeschoicetravel agencycustomerSOAP RPCEncapsulate RPC into SOAP messagesprocedure name and argumentsresponse (return value)processing instructions (transactional RPC!)Example: Request message 5 FT35ZBQ ke Jgvan yvind 123456789099999 2005-02 transaction information TID method invocation para

17、meter 1 parameter 2 SOAP RPCExample cntd.: Response message 5 FT35ZBQ http:/reservations?code=FT35ZBQ method result output parametersSOAP Processing Model (1)Elements in the Header may carry SOAP-specific attributes controlling the message processingattributes from namespace /2002/12/soap-envelopero

18、le, mustUnderstand, relay, encodingStylerole attributeif processing node matches role in header it must process the headerspecial role next: receiving node must be capable of processing headerspecial role ultimateRceiver: receiving node must be capable of processing bodymustUnderstand attributeproce

19、ssing of header information is mandatorySOAP Processing Model (2)relay attributeheader block must be relayed if it is not processed encodingStyle attributeIndicates the encoding rules used to serialize parts of a SOAP messages/2003/05/soap-encoding Base64date hexBinary http:/encoding/ /2003/05/soap-

20、envelope/encoding/none The Fault elementCarries an error messageIf present, must appear as a child of Must only appear onceHas the following sub-elements:Sub ElementDescriptionA code for identifying the fault (VersionMismatch, MustUnderstand, Client, Server)A human readable explanation of the faultI

21、nformation about who caused the fault to happenHolds application specific error information related to the Body elementProtocol BindingBindings to different protocols possible: HTTP, SMTPDifferent HTTP bindings: HTTP POST, HTTP GETstandard HTPP POST for request-responsePOST /Reservations?code=FT35ZB

22、Q HTTP/1.1 Host: Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnnn SOAP request message HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnnn SOAP response message HTTP POSTrequestHTTP responseDescription of Web services in XML formatabstract des

23、cription of operations and their parameters (messages)binding to a concrete network protocol (e.g. SOAP)specification of endpoints for accessing the serviceStructure of a WSDL documentTypes: structureof messagesMessages: usedby operations(abstract)OperationsPortType: operations supported by serviceB

24、inding: concrete protocol Service: collection of related portsPort: Binding and a network address(protocol)Operationsabstract concrete 3. WSDL Web Service Description Language24Overview of Defining WSDL Services Define in XML Schema the message types used when invoking the service: MT1, MT2 etc.Defi

25、ne (named) messages by using these types, e.g.message m1 has type MT1message m2 has type MT2 etc.Define Services that consist of one or more operations; each operation is implemented by the exchange of messagesservice S offers operation O1; for executing O1 first send a request message m1, then a re

26、sponse message m2 is returnedDefine a Binding B to a specific protocol, e.g. SOAPservice S is implemented in SOAP; the SOAP messages are constructed from the abstract messages m1 and m2 by, e.g. inlining the message as body of SOAP messagesService S is provided with binding B at the following URIs (

27、called ports)Example: Overall Document Structure definition of types in XML Schema definition of a message definition of an operation definition of a binding definition of a port Example: Definition of Types27Example: Definition of Messages and PortTypeOperation uses these messages 28Example: Defini

28、tion of Binding and ServiceBinding provided at this URIabstract operation GetLastTradePriceof portType StockQuotePortTypeimplemented by these SOAP messages29PortTypesWSDL supports 4 message patterns that an endpoint (=service provider!) can support for an operationone-way: message is sent to service

29、 provider without expecting responserequest-response: request is sent to service provider expecting responsesolicit-response: provider sends a message and expects responsenotification: message is sent by service providerMessage patterns are distinguished by the use of input/output elementsone way: *

30、 request/response: * * /wsdl:operation Standard for describing, publishing and finding web servicesStill evolvingUse XML-based description files for servicesMain componentsWhite pages: basic contact information about an organizationYellow pages: classification of organization based on industrial categorizationGreen pages: technical description of services offered by registered organizationsAccess to UDDI RegistryStandard UDDI API (accessible via SOAP)Web browserData Structures (XML)Business en

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论