1 / 36

Web Services & SOAP kapitulli 2

Web Services & SOAP kapitulli 2. Një vështrim i përgjithshëm. Web Servicet dhe SOAP. 1. Çfarë është SOAP?. 2. Gjëndja aktuale e standarteve SOAP. 3. Ndërtimi i strukturës së SOAP-eve & Exceptions. 4. Çfarë është SOAP?. Simple Object Access Protocol

miette
Télécharger la présentation

Web Services & SOAP kapitulli 2

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. Web Services & SOAPkapitulli 2

  2. Një vështrim i përgjithshëm Web Servicet dhe SOAP 1 Çfarë është SOAP? 2 Gjëndja aktuale e standarteve SOAP 3 Ndërtimi i strukturës së SOAP-eve & Exceptions 4

  3. Çfarë është SOAP? • Simple Object Access Protocol • Jo vetëm protokoll por edhe framework. • Kombinohet me HTTP,SMTP,FTP. • Një dokument I mirë formuar XML. • Merret me dërgimin e mesazheve nga Clienti ne Web Service.

  4. SOAP & WSDL WSDLpërshkruajnefunksionin e Web Serviceve . WSDL WSDL përshkruajnë parametrat e Web serviceve. WSDLpërshkruajnëplotësisht përmbajtjen e mesazheve SOAP.

  5. Struktura e mesazhit SOAP SOAP Cdo element i të mesazhit I vendoset namespace :soap Zgjidhet ky namespace sepse është default ne .NET 3 seksione kryesore: 1.<Envelope> 2.<Body> 3.<Header>(opsional)

  6. Struktura e SOAP-it

  7. Namespace • Luajnë një rol të rëndësishëm në SOAP. • Luftojnë problemet që hasen në paqartësitë qe gjenden në 2 se me shumë dokumente XML,në lidhje me një element apo emrin e atributit. • Namespace-et në vetvete janë URL arbitrare. Namespace Envelope SOAP Standari SOAP 1.1 Namespace Seralization SOAP

  8. Dave Winer dhe Don Box punuan për dërgimin e RPC npmXML 1998 XML-RPC U shtuan edhe strukturat dhe Arrays 1999 SOAP 1.0 Realizimi përfundimtar I produkteve. SOAP 1.1 Për përmirësimin e SOAP 1.1 2001 SOAP 1.2 SOAP dhe gjëndja aktuale

  9. Bazohet në XML: Envelope Tipi I të dhënave 4 pjesë Pjesë opsionale Shkëmbim sms SOAP 1.1

  10. SOAP 1.1 • Envelope enkapsulim të dhënash • Rregullat opsionalëpër të koduar tipin e të dhënave të përcaktuar ne aplikacion. • Një model shkëmbimi mesazhi • Një pjesë opsionale për të përcktuar SOAP-in në HTTP.

  11. Soap 1.2 Nyjet Rolet Modelet e mesazheve Exchange 5 pjesë Features Modulet SOAP 1.2

  12. Soap 1.2 • NyjetLogjika e përpunimit për të dërguar dhe marrë info. • RoletZëvendësojnë aktorët tek standarti 1.1 • Featurespjesë abstrakte të funksionimit lidhur me kalimin e mesazheve. • ModuletNjë karakteristikë e shprehur si SOAP header. • Message Exchange Patternstemplate për shkëmbim mesazhi

  13. Elementët e përcaktuara në një SOAP standart • <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope">.... SOAP Header and Body here ... </soap:Envelope> • SOAP Envelope Gjithmonë ngelet elementi kryesor në mesazhet SOAP. Një SOAP Envelope tipik ka një pamje të tillë & me namespace soap. Koka e SOAP-it është opsioale se mban një info extra. Trupi SOAP përmban XML payload-info I destinuar për Web Servicet ose që është kthyer mbrapsht nga to.

  14. SOAP Body [WebMethod (Description="Calculates the percentage value " + "given a percentage and a number")] public doubleCalcPercent (int Percent, double Number) { double Value = Number / 100 * Percent; return Value; } • Përdoret zakonisht për të transmetuar emrin e metodës që do të thirret,së bashku me parametrat e lidhur dhe një përgjigje nga aplikacioni marrës. • Jepet një shembull I metodave në Web me anë të C#:

  15. SOAP Body Request <?xml version="1.0" encoding="utf-8" ?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <CalcPercent xmlns="http://www.notashop.com/wscr"> <Percent>25</Percent> <Number>4</Number> </CalcPercent> </soap:Body></soap:Envelope>

  16. SOAP Body Request <?xml version="1.0" encoding="utf-8" ?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <CalcPercent xmlns="http://www.notashop.com/wscr"> <Percent>25</Percent> <Number>4</Number> </CalcPercent> </soap:Body></soap:Envelope>

  17. SOAP Body Response <?xml version="1.0" encoding="utf-8" ?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <CalcPercentResponse xmlns="http://www.notashop.com/wscr"> <CalcPercentResult>1</CalcPercentResult> </CalcPercentResponse> </soap:Body></soap:Envelope>

  18. Document Format • ⋮<soap:Body> <CalculatePercent xmlns="http://www.notashop.com/wscr"> <Percent>25</Percent> <Number>4</Number> </CalculatePercent></soap:Body>⋮ • Atribut SOAP Document Method • Action • Përcaktimi • Oneway • Parametri STYLE • Request Element Name • Request Namespace • Response Element Name • TypeId Një shembull I thjshtë: Elemenët e një Document Format

  19. Krijon lidhje me disa protokolle HTTP SMTP SOAP FTP Envelope SOAP POST GET

  20. Trasportimi I SOAP përmes HTTP HTTP ka pak a shumë të njëtin ndërtim si SOAP ku në kokën e tij mbahet info rreth kërkesës së klientit tek trupi përveç mesazhit të caktuar të mbahet dhe data e dërgimit të kërkesës

  21. Dërgimi I një dataset-I përmesnjëaplikacioni 1 Ndërtimi I basës së të dhënave Web Service 2 Klasa communicator 3 4 Klienti ASP.Net

  22. WEB SERVICE

  23. Diagram Text SOAPRequest Text Text Text Text

  24. ADDSOAP ReturnSOAPResponse Concept Text Text Text

  25. ASP.Net Client

  26. SOAP Header 1 2 3 Janë analogët e proxy ne HTTP,por shumë më fleksibel,pasi SOAP nuk limiton tipin apo nr e tyre. Përdoret për të zgjeruar përmbajtjen e msg duke shtuar të dhëna mbi të dhënat që ndodhen në trupin e SOAP Përdoret për të përcjell informacione si çelsat e sigurisë apo shenjat digitale

  27. Atributet e AOSP header mustUnderstand Role

  28. Proçesimi dhe ndërtimi I header-it SOAp me anë të .Net

  29. Dërgimi I informacionit përmes SOAP header

  30. Panelet Instanca

  31. Soap Exception & errror fault code Elemnti fault detail faultstring faultactor

  32. Elemnti Fault Gabimi I gjeneruar

  33. Fault Code Sender Reciever Must Understand Data Encoding Unknoën endpointi gjenoren nje gabim te tille ne rastet kur informacioni apo formati nuk jane te konfirmuar nga specifikat e endpointit endpointi ka gjeneruar nje msg errori qe ska lidhje me permbajtjen e msg te SOAP nje elemnet i shenuar si mustUnderstand nuk eshte procesuar tipi i shifrimit te disa apo te gjithe elemneteve te SOAP nuk njihet nga endpointi

  34. Objekti Soap Exception Code Detail Aplication Message Actor Inner Exception Help Link Target Site Strack Trace Source

  35. Konstantet e objektit code mustUnderstand Client Server VersionMismatch FaultCode FaultCode FaultCode FaultCode

  36. Shembull

More Related