36

Web Services & SOAP kapitulli 2

  • Upload
    miette

  • View
    83

  • Download
    9

Embed Size (px)

DESCRIPTION

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 - PowerPoint PPT Presentation

Citation preview

Page 1: Web Services & SOAP kapitulli  2
Page 2: Web Services & SOAP kapitulli  2

Web Servicet dhe SOAP1

Çfarë është SOAP?2

Gjëndja aktuale e standarteve SOAP3

4 Ndërtimi i strukturës së SOAP-eve & Exceptions

Page 3: Web Services & SOAP kapitulli  2

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.

Page 4: Web Services & SOAP kapitulli  2

WSDL përshkruajne funksionin e Web Serviceve .

WSDL përshkruajnë parametrat e Web serviceve.

WSDL përshkruajnë plotësisht përmbajtjen e mesazheve SOAP.

WSDLWSDL

Page 5: Web Services & SOAP kapitulli  2

3 seksione kryesore:

1.<Envelope>

2.<Body>

3.<Header>(opsional)

SOAP

Cdo element i të mesazhit I vendoset namespace :soap

Zgjidhet ky namespace sepse është default ne .NET

Page 6: Web Services & SOAP kapitulli  2
Page 7: Web Services & SOAP kapitulli  2

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

Page 8: Web Services & SOAP kapitulli  2

Dave Winer dhe Don Box punuan për dërgimin e RPC npmXML

U shtuan edhe strukturat dhe Arrays

Për përmirësimin e SOAP 1.1

XML-RPC

SOAP 1.0 Realizimi përfundimtar I produkteve.

SOAP 1.1

SOAP 1.2

1998

1999

2001

Page 9: Web Services & SOAP kapitulli  2

Envelope

Tipi I të dhënave

Shkëmbim sms

Pjesë opsionale

4 pjesë

Bazohet në XML:

Page 10: Web Services & SOAP kapitulli  2

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.

Page 11: Web Services & SOAP kapitulli  2

Modelet e mesazheve Exchange

NyjetRolet

Features

Modulet

5 pjesë

Soap 1.2

Page 12: Web Services & SOAP kapitulli  2

NyjetLogjika e përpunimit për të dërguar dhe marrë info.

RoletZëvendësojnë aktorët tek standarti 1.1

Featurespjesë abstrakte të funksionimit lidhur me kalimin e mesazheve.

ModuletNjë karakteristikë e shprehur si SOAP header.

Message Exchange Patternstemplate për shkëmbim mesazhi

Page 13: Web Services & SOAP kapitulli  2

SOAP EnvelopeGjithmonë 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.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope">.... SOAP Header and Body here ... </soap:Envelope>

Page 14: Web Services & SOAP kapitulli  2

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#:

[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;}

Page 15: Web Services & SOAP kapitulli  2

<?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>

Page 16: Web Services & SOAP kapitulli  2

<?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>

Page 17: Web Services & SOAP kapitulli  2

<?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>

Page 18: Web Services & SOAP kapitulli  2

Një shembull I thjshtë: Elemenët e një 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

Page 19: Web Services & SOAP kapitulli  2

HTTPSMTP

FTP

SOAP

POST

GET

Envelope SOAP

Page 20: Web Services & SOAP kapitulli  2

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

Page 21: Web Services & SOAP kapitulli  2

Ndërtimi I basës së të dhënave1

Web Service2

Klasa communicator3

4 Klienti ASP.Net

Page 22: Web Services & SOAP kapitulli  2

WEB SERVICE

Page 23: Web Services & SOAP kapitulli  2

Text

Text

Text

Text

Text

SOAPRequest

Page 24: Web Services & SOAP kapitulli  2

Concept

ADDSOAP

Text

Text

Text

ReturnSOAPResponse

Page 25: Web Services & SOAP kapitulli  2

ASP.NetClient

Page 26: Web Services & SOAP kapitulli  2

1

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

2

Përdoret për të përcjell informacione si çelsat e sigurisë apo shenjat digitale

3

Janë analogët e proxy ne HTTP,por shumë më fleksibel,pasi SOAP nuk limiton tipin apo nr e tyre.

Page 27: Web Services & SOAP kapitulli  2

mustUnderstand Role

Page 28: Web Services & SOAP kapitulli  2
Page 29: Web Services & SOAP kapitulli  2
Page 30: Web Services & SOAP kapitulli  2

Panelet

Instanca

Page 31: Web Services & SOAP kapitulli  2

Elemnti fault

fault code

faultstringdetail

faultactor

Page 32: Web Services & SOAP kapitulli  2

Elemnti FaultGabimi I gjeneruar

Page 33: Web Services & SOAP kapitulli  2

Sender

Reciever

Must Understand

Data Encoding Unknoën

tipi i shifrimit te disa apo te gjithe elemneteve te SOAP nuk njihet nga endpointi

nje elemnet i shenuar si mustUnderstand

nuk eshte procesuar

endpointi ka gjeneruar nje msg errori qe ska lidhje me permbajtjen e msg te SOAP

endpointi gjenoren nje gabim te tille ne rastet kur informacioni apo formati nuk jane te

konfirmuar nga specifikat e endpointit

Page 34: Web Services & SOAP kapitulli  2

Message

Code

Detail Aplication

Actor

Help Link

Inner Exception Source

Target Site

Strack Trace

Page 35: Web Services & SOAP kapitulli  2

VersionM

ismatch

FaultCode

FaultCode

mustU

nderstand

FaultCode

Client

FaultCode

Server

Page 36: Web Services & SOAP kapitulli  2