1 / 30

Arhitectura serviciilor web

Arhitectura serviciilor web. Olteanu Ana Cristina. La inceput…. Interactiunea web traditionala. Arhitectura distribuita. Ce este un serviciu web ?.

Download Presentation

Arhitectura serviciilor web

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Arhitectura serviciilor web Olteanu Ana Cristina

  2. La inceput… Interactiunea web traditionala

  3. Arhitectura distribuita

  4. Ce este un serviciu web ? • Un serviciu web este o aplicatie modulara, auto-descriptiva care poate fi publicata si accesata prin Internet si care foloseste un sistem de mesaje standardizat XML

  5. Avantaje • Interoperabilitate • Arhitectura distribuita – reutilizabile • Distribuire usoara intre consumatori • Modularitate

  6. Tipuri de arhitecturi • Arhitectura de tip RPC • Arhitectura de tip REST Service (pe Server) Client

  7. Arhitectura RPC

  8. Arhitectura de tip RPC • Remote Procedure Call

  9. Mod de functionare • 3 operatii • Publicare • Descoperire • Conectare • Exemplu : conversie valutara

  10. Stiva unui serviciu web

  11. HTTP • HyperText Transport Protocol • HTTP 1.1 • Metode: GET,POST,PUT,DELETE,HEAD,TRACE • Arhitecura RPC foloseste doar • GET • POST

  12. SOAP • Simple Object Access Protocol\ • Diferentiaza major cele doua arhitecturi • Complex : mesajul incapsulat intr-un invelis • Bazat pe XML

  13. Transmitere mesaje XML folosind SOAP

  14. UDDI • Universal Description, Discovery and Integration • http://www.uddi.org • Specificatie tehnica pentru a publica si a gasi servicii web in Internet • White pages, yellow pages, green pages

  15. Exemplu de registru UDDI

  16. WSDL • Web Services Definition Language • http://www.w3.org/TR/wsdl/ • Limbaj bazat pe XML pentru descrirea interfetei serviciilor web • Ce face serviciul ( descriere) • Cum se foloseste serviciul (metodele) • Unde se gaseste serviciul Nu depinde de protocolul de pe nivelul inferior.

  17. Descriere serviciu cu WSDL(1) • <definitions name="WeatherService" targetNamespace="http://www.ecerami.com/wsdl/WeatherService.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> <message name="getWeatherRequest"> <part name="zipcode" type="xsd:string"/> </message> <message name="getWeatherResponse"> <part name="temperature" type="xsd:int"/> </message>

  18. Descriere serviciu cu WSDL (2) • <binding name="Weather_Binding" type="tns:Weather_PortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="getWeather"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:weatherservice" use="encoded"/> </input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:weatherservice" use="encoded"/> </output> </operation> </binding>

  19. Interactiunea intre acestea

  20. Arhitectura REST

  21. Arhitectura REST • REpresentational State Transfer • Arhitectura simpla • HTTP • XML • URI • In REST totul este o resursa

  22. Concepte REST (1) • O pagina web: reprezentare a unei resurse -> de aici si numele • URI ( Uniform Resource Identifier) : numele si adresa resursei • Anumit format impus de cei ce implementeaza serviciul • Exemplu : • http://www.example.com/relationships/Alice;Bob • http://www.example.com/nextprime/1024 ?1

  23. Concepte REST (2)

  24. Metode HTTP • Get (GET),Create (PUT), Update( POST), delete (DELETE) • GET /weatherforecast/02110 HTTP/1.1 • POST /weatherforecast HTTP/1.1 • PUT /weatherforecast/95101 HTTP/1.1 • DELETE /weatherforecast/02110 HTTP/1.1 • SOAP foloseste doar POST si GET

  25. Exemplu REST

  26. Interfata uniforma • Concept de baza in REST • URI ce respecta reguli : identifica o resursa • Clientul documentat • XML

  27. Tehnici de implementare in .NET • Windows Communication Foundation(WCF) • Componentele majore: - Adresa - Binding - Contract

  28. Concluzii • Arhitectura distribuita,scalabilitate • Cele doua arhitecturi: complex vs simplu • Arhitectura de tip REST necesita mai mult efort in partea clientului

  29. ?

More Related