aa ta ta t XML Puzzle - PowerPoint PPT Presentation

1 / 81
About This Presentation
Title:

aa ta ta t XML Puzzle

Description:

zip 157 72 /zip /address age 33 /age /client 6. S????a ??a t? XML a??e?? ... SOAP Fault Codes. ?? SOAP ????e? ??a s????? ap? ????: VersionMismatch ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 82
Provided by: papadak
Category:
Tags: xml | address | by | codes | puzzle | zip

less

Transcript and Presenter's Notes

Title: aa ta ta t XML Puzzle


1
??a-??a ta ??µµ?t?a t?? XML Puzzle
  • XML (datasheet)
  • XSL (?aµ?? f??? ?a? T)
  • DTD
  • XML Schemas
  • CSS
  • HTML
  • Client-side JavaScript
  • Server-side transforming technology

2
??sa???? st? XML
  • ??????eta? ap? t?? SGML
  • ?e????e? µ??? d?µ?µ??? p????f???a, ?????
    p????f???a p?? ?a af??? t?? eµf???s? (se a?t??es?
    µe t?? HTML)
  • ? ???s? t??
  • ??ta??a?? p????f????? µeta?? efa?µ????
  • Write once, view anywhere applications
  • ???sµ?? ???? p?? e?d??e?µ???? markup ???ss??
    (WML, NewsML, ?t?p.)

3
?a? t? ??? ?a ?e?d?s? ap? t?? XML?
  • ?? µe???? p?e????t?µa t?? XML
  • ??a????sµ?? t?? ded?µ???? ap? t?? t??p? eµf???s??
    t??? ?a? t?? ?e???sµ? t???
  • ?a ded?µ??a e??a? ???a??µ??a ?? ded?µ??a ?a? ???
    ??a t?? t??p? eµf???s?? t??? (se a?t??es? µe t??
    HTML)

4
? ???ta µ??
  • Name Nikos Papadakis
  • Address
  • 9 Iroon Politehniou Street
  • Zografou, Athens
  • Greece
  • 157 72
  • Age 33

5
?? a?t?st???? XML a??e??
  • lt?xml version"1.0"?gt
  • ltclientgt
  • ltnamegt
  • ltfirstnamegtNikoslt/firstnamegt
  • ltlastnamegtPapadakislt/lastnamegt
  • lt/namegt
  • ltaddress type"home"gt
  • ltstreet_addressgt9 Iroon Politehniou
    St.lt/street_addressgt
  • ltcitygtAthenslt/citygt
  • ltstategtGreecelt/stategt
  • ltzipgt157 72lt/zipgt
  • lt/addressgt
  • ltagegt33lt/agegt
  • lt/clientgt

6
S????a ??a t? XML a??e??
  • ?e????e? µ??? d?µ?µ??? p????f???a, ????? ?aµ??
    with no ?p?de??? ??a t? p?? ?a p??pe? ?a
    pa???s?aste? a?t?
  • ?a lt? ?gt tags e??a? st?? ????f? t?? a??e??? ?a?
    e??a? processing instructions (t? µ??? st?
    p??????µe?? pa??de??µa de???e? t?? ??d?s? t??
    XML).
  • ??? ? pe????? µ?sa se ??a tag (p?, ltagegtlt/agegt)
    a?af??eta? st?? ??µß? ? st? element a?t?

7
S????a ??a t? XML a??e??
  • ?a Attributes (p?., typehome) ???s?µ?p?????ta?
    ?p??d?p?te µp????? ?a ?p?????? pepe?asµ????
    a???µ?? t?µ??. ??t?? ?? pepe?asµ??e? t?µ??
    µp????? ?a ??????ta? d?aµ?s?? e??? DTD (Document
    Type Definition).
  • ?a Attributes µp????? ep?s?? ?a p??sd???????? t??
    µ???da µ?t??s?? p.?, ltweight unitkggt70lt/weightgt
  • ???e ??µß?? µp??e? ?a ??e? µ??? ??a pat??a a???
    p???? pa?d??
  • ?? p??????µe?? a??e?? ?a µp????se ?a ??e? p??????
    ??µß??? ltclientgt µ?sa se ??a ltclientsgt ??µß?

8
XML ?a???e? s??ta???
  • ? s??ta?? p??pe? ?a e??a? a?st??? ??t?? ?ste ??
    parsers ?a µp????? ?a ?ata??ß??? t?? d?µ?
  • ???pe? ?a a????e? µe µ?a d???s? ??a t?? ??d?s?
    t?? XML
  • ???pe? ?a ??e? ??a ?a? µ??? ??a root element
  • ?? t?µ?? t?? Attributes p??pe? ?a e??a? µ?sa se
  • p?., typehome

9
XML ?a???e? s??ta???
  • ??a ta tags p??pe? ?a e??a? µe t? ?d?? case (t?
    lowercase e??a? p??te???µe??)
  • ??a ta tags p??pe? ?a e??a? s?st? eµf??e?µ??a
    e?d????? ??a ????? e?????t?ta? ?a p?????e? ?ta?
    ??p???? ?e??se? ?a ???s?µ?p???se? t? a??e??
  • S?st? ltpetgtltnamegtFidolt/namegtlt/petgt
  • ????? ltpetgtltnamegtFidolt/petgtlt/namegt

10
XML ?a???e? s??ta???
  • ?p?p???? tabs ?a? ?e?? de? ????? s?µas?a ?a?
    µp????? ?a ???s?µ?p?????ta? ??a ?a ?????? t? XML
    a??e?? p?? e?a?????st?
  • ??a ta tags p?? a??????? p??pe? ?a? ?a ??e?????.
    ??., ltgender typefemalegt ap? µ??? t?? de?
    e??a? s?st?
  • ??se??
  • ltgender typefemalegtlt/gendergt
  • ltgender typefemale /gt

11
???e? XML ?e???????e??? Validation
  • DTD Document Type Definition
  • ????e? t?? ap?de?t? d?µ? t?? tags ??a ??a a??e??
  • ?a?e?sµ??? ap? t?? SGML
  • pa??de??µa
  • XML Schemas
  • Ta a?t??atast?se? e?te??? ta DTDs,
  • ??apt?????e e?d??? ??a t? validation t?? XML
  • pa??de??µa

12
XML Parsers
  • ?p?????? d?? d?af??et???? f???s?f?e? ??a t?
    Parsing
  • DOM
  • SAX
  • ???e? e??a? ?? d?af???? t??? ?

13
???e? XML ?e???????e? Display
  • CSS - Cascading Style Sheets
  • ?p?? e?????? ???sµ?? ?d??t?t?? eµf???s?? e???
    XML element
  • ?at? ?e? e??a? p??? d??at?
  • ???? ??a ta Web browser
  • pa??de??µa
  • XSL Extensible Stylesheet Language
  • ?p?? µp??e? ?a µetas??µat?se? ??a XML se µ?a
    ?p??ad?p?te ???? markup ???ssa. (p??? d??at?)
  • ?at? p??? p???p????
  • pa??de??µa

14
XSL µetas??µat?sµ??
15
Client Side XML
  • ?p??
  • ???????
  • ???sa?µ???µe??? ?e???sµ?? t?? ded?µ????
  • pa??de??µa sorting
  • pa??de??µa expand/collapse display
  • ????? ep?p???? traffic µe t?? server

16
Client Side XML
  • ?at?
  • ???? st?? IE5
  • ??af??et???? Parsers IE5 IE5.5
  • ?e? µp??e? ?a µetas??µat?ste? se ???? MIME t?p?
    (µ??? se HTML)

17
Server Side XML
  • ?p??
  • ?p?t??pe? cross-compatibility
  • ?a??de??µa XML/XSL µetas??µat?sµ?? st?? server
  • ?????? pa?a???? XML ap? ded?µ??a se database
  • ?a??de??µa mapping ded?µ???? ß?s?? se XML on
    the fly
  • ??e??????e? t?? a?ta??a?? server-based ded?µ????

18
Server Side XML
  • ?at?
  • ?? XML/XSL µetas??µat?sµ?? µp????? ?a ??????
    t?? server a? ?p???e? ?d? p??? traffic. (??s?
    pe???d??? s?s?µ? µe????? µetas??µat?sµ??)
  • ???eta? ?at? ??p???? t??p? ? d??at?t?ta ?a
    d?µ?????????? d??f??a display effects p?? ?a
    apa?t??sa? ?? XML/XSL µetas??µat?sµ?? ?a ??????
    st?? client

19
URLs
  • http//www.xml.com ??a ????a ?a? tutorials
  • http//www.xml.org/xmlorg_registry/ ??sta µe
    d??f??e? markup ???sse? ßas?sµ??e? se XML
  • http//www.w3.org ??a t? ep?s?µ? XML
    specification ?a? ???e? s?et???µe?e? te???????e?

20
SOAPSimple Object Access Protocol
21
??sa???? - pe??e??µe?a
  • ? a????? ??a ??a?e?t???????t?ta
  • G?at? XML?
  • SOAP ??a Universal RPC
  • ?a??de??µa t? SOAP se d??s?
  • ??a??a?t????
  • ? ?at?stas? t??a
  • ?a?ap?µp??....?a? ???a

22
?p??es?e? ??ad??t??? (Web services)
  • ?? µ????? t?? d?ad??t??? ßas??eta? st??
    e??a??d??s? e??? p?? ap?d?t???? µ?s?? a?ta??a???
    ded?µ????, ap? t?? HTML se??de? p??
    ???s?µ?p?????ta? s?µe?a.
  • ??e???eta? ??a e?d?? a?t?µat?p???s?? t??
    a???t?s?? t?? p????f???a? (????? t?? pa??µßas?
    t?? a????p??).
  • ??t? µp??e? ?a ???e? ef??t?, se µe???? µ????, µe
    t?? ?p??es?e? ??ad??t???.
  • St? e??? ?a a?af???µa? se ep??e???se?? ?a?
    ?p??es?e? p?? ?????? ?a d?µ?s?e???? ?p??es?e?
    t??? st? d??t??.

23
?p??es?e? ??ad??t???
  • ?? ep??e???se?? p??pe? ?a e??a? ??a???
    ?a
  • ??µ?s?e???? interfaces ??a t?? ?p??es?e? p??
    pa??????, ?ts? ?ste ???e? ep??e???se?? ?a
    µp????? ?a ß???? a?t?? t?? ?p??es?e? ?a? ?a t??
    ???s?µ?p???s???.
  • ??a??t?s??? ?a? ?a a?a?a??pt??? d?µ?s?e?µ??a
    interfaces eµp?????? s??e??at??, µe t??? ?p?????
    ep???µ??? s??e??as?a µ?s? t?? d?ad??t???.
  • ?????ep?d???? µe ?p??es?e? p?? d?µ?s?e???ta? ap?
    ???e? ep??e???se??, ?a? a?t?st??fa ?a ep?t??p???
    se ???e? ep??e???se?? ?a s??e??????ta? µe t??
    d???? t??? ?p??es?e?.

24
?e?? Web Services
  • ?? ?p??es?e? d?ad??t??? e??a? XML a?apa?ast?se??
    p????aµµ?t??, a?t??e?µ???? ? ?e?µ???? p?? e??a?
    p??spe??s?µa µ?s? t?? d??t???
  • ??t?? ?? a?apa?ast?se?? e??a? ??a ap e??e?a?
    a????ep?d?as? µeta?? efa?µ????
  • Ge???? ?? ?p??es?e? d?ad??t??? µp????? ?a
    p??spe?ast??? µe ???s? Browsers, a??? p?????
    f???? de? ?????µe ?a apa?te?ta? ? ???s? ??te
    Browser ??te HTML
  • ?? ?p??es?e? d?ad??t??? pa?????? ??a? a?e???t?t?
    ap? ded?µ??a µ??a??sµ? pa???s?as?? t?? ?p??es???
    t?? ep??e???s??, µe ???s? Standard XML
    p??t???????.

25
?p?te ?
  • To SOAP e??a? ??a p?a?s?? a?ta??a??? µ???µ?t??
    ßas?sµ??? se XML. ???a? e?d??? s?ed?asµ??? ??a
    t?? a?ta??a?? µ???µ?t?? µ?s? d?ad??t???. ???a?
    ap?? st? ???s?, ?a? e?te??? a?e???t?t? ap?
    ?e?t??????? s?st?µa, ???ssa p????aµµat?sµ?? ?
    p?atf??µa ?ata?eµ?µ???? s?st?µ?t??.
  • ??t?? ap? t? ?a pa???e? µ?a a?t?st????s? se ??a
    ep?ped? µetaf???? ??a t?? a?ta??a?? XML µ???µ?t??
    µ?s? t?? d?ad??t???, µe t? SOAP µ?a ep??e???s?
    µp??e? ?a
  • ??µ?s??p???se? t?? ?p??es?e? t?? ??a a?ta??a??
    XML eta?????? ded?µ????.
  • ??a?a???e? t?? t?p??es?a ?a? t?? µ??f? ?p??es???
    ????? ep??e???se??.
  • ?a????se? ?d??t?te? t?? a?ta??as?µe??? µ???µ?t??
    p?? s?et????ta? µe t?? p???t?ta t?? ?p??es?a?.

26
??s? SOAP
  • ? ep??e???s? ? ???s?µ?p??e? ??a URL p?? pa???eta?
    ap? t?? ep??e???s? ? ??a ?a a?a?t?se? µ?a ??sta
    µe t?? ?p??es?e? p?? d?µ?s?e?e? ? ?.
  • ? ep??e???s? ? ?ateß??e? ta XML schemas
    (s?????? se WSDL) p?? pe?????f??? t?? µ??f? t??
    µ???µ?t?? p?? a?aµ????ta? ap? t?? ?p??es?e? t??
    eta??e?a? ?.
  • ? ep??e???s? A s??µat??e? t? a?????? XML µ???µa
    ?a? t? ap?st???e? µ?s? SOAP st?? ep??e???s? ?.
  • ? ep??e???s? ? st???e? µ?a ap??t?s?, µ?s? SOAP,
    t?? ?p??a ? ep??e???s? ? e?µ??e?e?
    ???s?µ?p????ta? t?? p????f???a ??a t? XML schema
    p?? ??aße st? ß?µa 2.

27
?a? s??µat???...
? d?ad??as?a t?? ep????????a? a?t?p??s?pe?eta?
ap? ta ??t???a ß??? ?a? ? se??? ap? p??? p??? ta
??t?.
28
SOAP e?a?t??? ...
  • COM/CORBA p?? pe?????st???, web-centric
  • XML-RPC p??? ap?????
  • HTTP-NG (? ep?µe?? ?e???) p?? e??a? ?

29
G?at? SOAP?
  • S?µe?a, t? Web e??a? µeta?? a????p?? ?a? µ??a???

30
st? µ?????
  • ?? SOAP e??a? ep????????a µeta?? µ??a???!

31
???? ?st???a (e?d?se??)
  • ???t?????? s?ed?asµ??? ??a Web Services ?a? t?
    ??te??et
  • XML-RPC
  • ap?????
  • SOAP 0.9, 1.0
  • ?as?sµ??? st? RPC
  • SOAP 1.1
  • pe??ss?te?? ?e???e?µ???

32
SOAP ?a? XML
  • ?a SOAP ap?te????ta? ap? XML elements.
  • ?? SOAP ??e? d?? XML namespaces
  • http//schemas.xmlsoap.org/soap/envelope/
  • http//schemas.xmlsoap.org/soap/encoding/
  • G?a pe??ss?te?? saf??e?a, ???s?µ?p????µe
    a??a??eta prefixes SOAP-ENV, SOAP-ENC e?????ta?
    ta pa?ap??? namespaces.

33
?? ped??
  • ?? SOAP af??e? ep?µ????? ??µµ?t?a t?? se ???a
    specs ?p??
  • ?a datatypes (XML schemas)
  • ?? discovery (UDDI)
  • ?a contracts (SCL, NASSL)
  • ?? security (SSL, https, )

34
?ed??
  • ?? SOAP de? as???e?ta? µe ???sµ??a ??µata ?p??
  • object references
  • distributed garbage collection
  • batch messaging
  • ?s?? ???a µeta-SOAP specs d?µ?????????? ??a ?a
    as???????? - ??s??? t?t???? e?d??? ??µata.

35
??ast??µ?t?s? t?? Standards
Encoding t?? Data
???t??????
?? p??t?????? µa?
?? ?e???? µa?
SOAP
SOAP
HTTP
Xschema/XDR/...
TCP
XML Namespaces
IP
XML
Ethernet/V.42/
Unicode
36
? efa?µ??? t?? SOAP
  • ? SOAP efa?µ??? p??pe? ?a ???e? ta pa?a??t?
  • ?a a?a?????se? ta µ??? t?? µ???µat?? p?? p??pe?
    ?a e?te?est??? ap? s???e???µ??e? efa?µ????.
  • ?pe?e??as?a ?p???e?t???? tµ?µ?t?? ? ???d?? a?
    de? ???eta?.
  • ?fa??es? t?? tµ?µ?t?? p?? ????? epe?e??aste? ?a?
    p?????s? st? ep?µe?? (ef?s?? ?p???e?).

37
?a µ???p?t?a t?? µ???µat??
  • ?? SOAP ta??de?e? ap? t?? originator st???
    e?d??µes??? ??µß??? ?a? te???? st?? te????
    p?????sµ?.
  • ???e e?d??µes?? ??µß?? ?e????eta? ??a ??µµ?t? t??
    µ???µat?? ?a? t? p????e? st?? ep?µe??.

38
? d?µ? t?? SOAP Message
  • SOAP Messages pe??????ta? µ?sa sta
    SOAP-ENVEnvelope elements.
  • ?? Envelope ?????? ?a ??e? SOAP-ENVHeader.
  • ?? Envelope ?????? ?a ??e? ??a SOAP-ENVBody.

39
To SOAP Envelope
  • ltSOAP-ENVEnvelopegt
  • ltSOAP-ENVHeadergt lt/SOAP-ENVHeadergt
  • ltSOAP-ENVBodygtlt/SOAP-ENVBodygt
  • ltMyOtherStuff gt lt/MyOtherStuffgt
  • ltYourOtherStuff gt lt/YourOtherStuffgt
  • lt/SOAP-ENVEnvelopegt

40
?? SOAP Header
  • ?? header pe????e? application-specific elements.
  • ??e? t?? ??s? e??? mime headers.
  • St? SOAP ???µ????ta? header entries.

41
?? Body t?? SOAP
  • ?? SOAP body s??t?sseta? a???ß?? ?p?? t? header.
  • ltSOAP-ENVHeadergt
  • ltmynsDategtWed, 7 July 2002lt/myns Dategt
  • ltmynsFromgtnkpap_at_telecom.ntua.gr
  • lt/mynsFromgt
  • lt/SOAP-ENVHeadergt

42
? d?µ? t?? SOAP Faults
  • ?? SOAP ????e? µ??? ??a body entry t?
    SOAP-ENVFault.
  • ?a? ta sub-elements t?? e??a?
  • faultcode ??e? s??s? µe t? namespace
  • faultstring t? string
  • faultactor ? actor p?? d?µ??????se t? fault
  • detail pe??ss?te?e? p????f???e?

43
SOAP Fault Codes
  • ?? SOAP ????e? ??a s????? ap? ????
  • VersionMismatch (????? st?? Header)
  • MustUnderstand (a??? de? ?ata?aßa???!)
  • Client (µ? s?st? f??µ?t)
  • Server (????? t?? server)
  • ?a??de??µa
  • ltenvFaultgt
    ltfaultcodegtenvMustUnderstandlt/faultcodegt
    ltfaultstringgtSOAP Must
    Understand Errorlt/faultstringgt
    lt/envFaultgt
  • ?p???e? d??at?t?ta ???sµ?? d???? µa? fault codes.

44
?a SOAP Types ?a? Structures
  • Simple value primitive type
  • Compound value structured type
  • Arrays s??d?asµ??e? t?µ?? ta????µ?µ??e? ?at?
    ??s?
  • Structs s??d?asµ??e? t?µ?? ta????µ?µ??e? ?at?
    ???µa
  • st?? p?a?µat???t?ta ???? p?? p???p????

45
?? SOAP Encoding
  • T? SOAP encoding e??a? p??a??et???.
  • ?p??e? ?a ???s?µ?p????e? ?p???d?p?te d??? µa?.
  • ?p?s?? µp??e? ?a ???s?e? ??a encodingStyle
    attribute se ?p??ad?p?te element.

46
?? SOAP HTTP Request
  • ?? HTTP Request p??pe? ?a ??e? ??a SOAPAction
    header.
  • ?a Firewalls µp????? ?a f??t?????? ßas???µe?a st?
    action a?t?.
  • SOAPActionhttp//nkpap.org/abcMyMsg

47
?? SOAP HTTP Response
  • ???e? ???s? t?? standard HTTP responses ??a
    success ? failure.
  • ?? Failure message body p??pe? ?a e??a? SOAP
    message µe SOAP fault.

48
?? SOAP p?atf??µe?
  • Apache (ßas?sµ??? st? SOAP4J)
  • ßas??? RPC support
  • http//xml.apache.org
  • .NET
  • ?a Components ?a e??a? p??sß?s?µa d??t?a?? µe
    SOAP
  • COM (4S4C)
  • G?f??a µeta?? SOAP ?a? COM objects.
  • http//www.zaks.demon.co.uk/com/soap.html

49
Ge???? s??µa t?? SOAP
50
Background
  • ?????? ap? IBM, Microsoft, Lotus, ARIBA
  • ?p?ß?????e st? W3C - ????e W3C Note t?? ???? t??
    1998
  • ? t?????sa ??d?s? e??a? ? 1.1 ß??pe
  • http//www.w3.org/TR/SOAP

51
? a????? ??a Interoperability
ASP, VB, Java, ISAPI, NSAPI, Oracle, Sybase,
SQL-Server, Eiffel, C, CORBA, COM, EJB,
Smalltalk, COBOL, MVS, Unix, W2K, Linux,
X-Windows, DOS, SQL, C, ?t?, ?t?., ?t?...
???
52
? a????? ??a Interoperability
VB Client ??????µa W2K
COM Application (DLL) ??????µa W2K
µe DCOM...
53
? a????? ??a Interoperability
VB Client W2K µ?????µa
Java Objects Linux Server
54
? a????? ??a Interoperability
Ost?s?...
VB Client W2K µ?????µa
Java Objects Linux Server
µe HTTP...
55
? d?µ? e??? SOAP Message
HTTP Headers
Headers
Message Name Data
56
G?at? XML?
  • ?? pe??e??µe?? t?? XML documents µp????? ?a
    ???st??? ap? eµ??
  • ?? a??e?? e??a? text-based
  • ?a ded?µ??a e??a? a?t?-pe????af?µe?a

57
?a??de??µa ap??? XML
lt?xml version1.0 ?gt ltCDgt ltArtistgtMarc Cohn
ltSongsgt ltSonggt ltNamegtAlready
Homelt/Namegt ltTimegt442lt/Timegt
lt/Songgt ltSonggt ltNamegtEllis
Islandlt/Namegt ltTimegt512lt/Timegt
lt/Songgt lt/Songsgt lt/Artistgt lt/CDgt
58
SOAP ??a Universal RPC
?? st???? t?? SOAP
  • ?a ?????? ta ?d? ?p?????ta p?????µµata
    pe??ss?te?? p??s?t? st??? ???ste?
  • ?a µ?? ??e???eta? ep????s? ???? te????????? (???
    ???a ORBs, APIs, ?t?.)
  • ?st?as? st? HTTP ?? p??t?????? µetaf????
    ded?µ????

59
SOAP ??a Universal RPC
??? µ????e? ??a SOAP request?
ltSOAPEnvelope xmlnsSOAP"urnschemas-xmlsoap-org
soap.v1"gt ltSOAPBodygt ltmAdd
xmlnsm"urnProgIDSOAPMath.CSOAPMath"gt
ltxgt4lt/xgt ltygt5lt/ygt
lt/mAddgt lt/SOAPBodygt lt/SOAPEnvelopegt
60
SOAP ??a Universal RPC
??? µ????e? ??a SOAP responce?
ltSOAPEnvelope xmlnsSOAP"urnschemas-xmlsoap-org
soap.v1"gt ltSOAPBodygt ltmAdd
xmlnsm"urnProgIDSOAPMath.CSOAPMath"gt
ltreturngt9lt/returngt lt/mAddgt
lt/SOAPBodygt lt/SOAPEnvelopegt
61
SOAP ??a Universal RPC
??? e??a? ??a response ?????? st? SOAP?
ltSOAPEnvelope xmlnsSOAP"urnschemas-xmlsoap-org
soap.v1"gt ltSOAPBodygt ltSOAPFaultgt
ltfaultcodegt400lt/faultcodegt
ltfaultstringgtApplication Faultedlt/faultstringgt
ltruncodegt1lt/runcodegt
lt/SOAPFaultgt lt/SOAPBodygt lt/SOAPEnvelopegt
62
????????µ??? Soap Message
  • POST /StockQuote HTTP/1.1Host
    www.stockquoteserver.comContent-Type text/xml
    charset"utf-8"Content-Length nnnnSOAPAction
    "Some-URI"ltSOAP-ENVEnvelopexmlnsSOAP-ENV"htt
    p//schemas.xmlsoap.org/soap/envelope/"SOAP-ENVe
    ncodingStyle"http//schemas.xmlsoap.org/soap/enco
    ding/"gtltSOAP-ENVBodygtltmGetLastTradePrice
    xmlnsm"Some-URI"gtltsymbolgtDISlt/symbolgtlt/mGetLa
    stTradePricegtlt/SOAP-ENVBodygtlt/SOAP-ENVEnvelope
    gt

63
????????µ??? Response Message
  • HTTP/1.1 200 OKContent-Type text/xml
    charset"utf-8"Content-Length
    nnnnltSOAP-ENVEnvelope xmlnsSOAP-ENV"http/
    /schemas.xmlsoap.org/soap/envelope/"
    SOAP-ENVencodingStyle"http//schemas.xmlsoap.org
    /soap/encoding/"/gt ltSOAP-ENVBodygt
    ltmGetLastTradePriceResponse xmlnsm"Some-URI"gt
    ltPricegt34.5lt/Pricegt lt/mGetLastTradePri
    ceResponsegt lt/SOAP-ENVBodygtlt/SOAP-ENVEnvelop
    egt

64
SOAP ??a Universal RPC
?e????? apa?t?se?? t?? SOAP
  • ?? Content-Type p??pe? ?a e??a? text/xml
  • ?e? apa?te? DTD ??a validation
  • T? Envelope element p??pe? ?a e??a? t? root
    element
  • ?? Header ?a? Body elements p??pe? ?a e??a?
    first-level elements ??t? ap? t? Envelope.
  • ?? p?????e? ?????, ??a Fault element p??pe? ?a
    ep?st???e? (es???e?eta? µ?sa st? Envelope ?a? st?
    Body elements)

65
??e??e?t?µata
  • ?p??e? ?a pe??se? µ?sa ap? Firewalls
  • ???? ap? HTTP (??a p?e? pa?t?? t? HTTP e??a? ??a
    Universal p??t??????)
  • ?sfa??? (?????ta? ???s? HTTPS)
  • Open standard (ßas?sµ??? st? XML ?a? W3C Group)
  • ?p??t?ta
  • Multicast

66
?e???e?t?µata
  • ?? semantic t?? d?af???? t?p?? p??pe? ?a ???ste?
    ??a pe??ss?te?? d???e?? ??a t?? ???st?
  • ??te??? text based p??t??????
  • ??p?? ??a ?a ???s???? ta endpoints
  • ???e? bandwidth
  • Synchronous ep????????a

67
?a??de??µa t? SOAP se d??s?
Server Setup
  • To request ???eta? se ??a web server (se µ?a
    se??da ASP ? JSP), p.?. http//castle.ntua.gr/soap
    server/default.jsp.
  • H ASP se??da d?µ?????e? t? CSOAPServer object ?a?
    t?? ??e? ?a ???e? handle t? request.
  • ?? CSOAPServer object pa?s??e? t?? p????f???a
    p?? ??e? ???e? POST ?a? ???e? ???s? st? ??t??µe??
    object.

68
?a??de??µa t? SOAP se d??s?
Server
  • The CSOAPServer object ?a d?µ??????se? µ?a SOAP
    ap??t?s?.

CSOAPServer
PWS
ASP
lt Dim oSOAP gt
69
?a??de??µa t? SOAP se d??s?
  • T? client µ?????µa ???e? ??a SOAP request ?a? t?
    st???e? st?? server.
  • ????? ??ße? ? client ??ße? t?? ap??t?s? ap? t??
    server, ? client e?µ??e?e? t? SOAP ap?t??esµa.

Client
PWS
70
??a??a?t???? te???????e?
  • XML-RPC (http//www.xmlrpc.com)
  • XMOP (http//jabr.ne.mediaone.net/default.htm)\
  • WDDX
  • ebXML
  • ?a? ???a p????...

71
???a ????a ??a t? WSDL
  • Web Services Description Language (WSDL)
  • ?f?? t? SOAP ????e d?a??s?µ? sa? ??a? µ??a??sµ??
    a?ta??a??? XML µ???µ?t?? µeta?? ep??e???se??,
    pa???s??st??e ? a????? e??? ?a??te??? t??p?? ??a
    t?? pe????af? t?? µ???µ?t?? ?a??? ?a? t?? t??p??
    µe t?? ?p??? ???eta? ? a?ta??a?? t???.
  • ?? WSDL e??a? ??a XML schema, p?? a?apt?????e ap?
    t?? Microsoft ?a? t?? IBM µe s??p? ?a ???se? t?
    XML µ???µa, t? ?e?t?????a ?a? t? p??t??????
    a?t?st????s?? µ?a? ?p??es?a? d?ad??t??? p??
    p??spe?a??eta? ???s?µ?p????ta? SOAP ? ??p??? ????
    XML p??t??????.
  • ?? s??ta?t??? t?? WSDL ep?t??pe? t?? afa??et???
    ???sµ? t?s? t?? µ???µ?t?? ?s? ?a? t?? ?e?t???????
    t?? µ???µ?t??, ?ts? ?ste ?a µp????? ?a
    a?t?st???????? se p???ap??? f?s???? ???p???se??.

72
?a? ???a ??a t? UDDI
  • Universal Desrciption, Discovery, and
    Integration (UDDI)
  • To UDDI, ????e? ??a µ??t??? ded?µ???? (se XML)
    ?a? SOAP APIs ??a ?ata????s? ?a? a?a??t?s?
    p????f???a? µ?a? ep??e???s??, s?µpe???aµßa??µ????
    t?? p????f???a? p?? s?et??eta? µe t?? ?p??es?e?
    p?? pa???e? ? ep??e???s? st? d?ad??t??.
  • ?? ep??e???se?? ???s?µ?p????? ta SOAP APIs ??a ?a
    ?ata?????? t?? ?p??es?e? p?? pa?????? st? UDDI.
    ?? ???e? ep??e???se?? ??????? st? UDDI ?ta?
    ?????? ?a a?a?a?????? ??a? eµp????? s??e???t?. ??
    UDDI µp??e? ?a pa???e? p????f???a e??es?? t??
    ?p??es??? p?? pa???e? ? ep??e???s?, d????ta?
    ??s?ast??? ??a? de??t? st? WSDL a??e?? p??
    pe?????fe? t?? ?p??es?e? d?ad??t??? p?? pa???e? ?
    s???e???µ??? ep??e???s?.

73
?? UDDI s??µat???
  • ?? s??µa de???e? p?? µ?a efa?µ??? µp??e? ?a
    ?ata???e? t? WSDL a??e?? t?? st? UDDI

74
??a?????? ?p??es???
??t??e?µe?a
?? SOAP request
SOAP
? Client
?? SOAP response
WSDL
? UDDI registry ??µß??
75
? ?at?stas? t??a
  • ??a????sµ?? HTTP spec ap? t? SOAP spec
  • ???sp??e?a e??p???s?? ??a ta ?s????ta XML
    messaging specifications (p?. ?? SOAP ?s??
    e?afa??ste?)
  • SOAP ! ?d???t?s?a t?? Microsoft technology

76
?a?ap?µp??
  • SOAP Resources http//www.develop.com/soap
  • SOAP Specification
  • http//www.w3c.org/2002/ws/
  • http//www.msdn.microsoft.com/xml/general/soapspec
    -v1.asp
  • XML Manifesto, by Don Box,
  • http//msdn.microsoft.com/workshop/xml/articles/xm
    lmanifesto.asp
  • http//msdn.microsoft.com/vstudio/nextgen/langauge
    .asp

77
?a?ap?µp??
  • A Young Persons Guide to the Simple Object
    Access Protocol, by Don Box, http//msdn.microsof
    t.com/msdnmag/issues/0300/soap/soap.asp
  • Professional XML, by Mark Birbeck, et. al.,
    Wrox Press

78
Microsoft .Net
  • ?a??µ??? µe t? J2EE
  • Language neutral (a? ?a? platform dependent)
  • ?? SOAP ???s?µ?p??e?ta? ??a t?? µetaf??? ???? t??
    .Net components ?a? ??a t?? ep????????a t???
  • ???a? ?d???t?s?a t?? Microsoft

79
.Net e?a?t??? J2EE
  • ? .Net ???s?µ?p??e? SOAP ??a ?a st???e? µ???µata
    µeta?? t?? d?af???? d?e??as???
  • ? J2EE ???s?µ?p??e? CORBA.

80
? Java ?a? t? XML ?a??? s??e???te?
  • G?at? ?
  • ? XML ???e? ta ded?µ??a µetaf??s?µa
  • ? Java ???e? t?? ??d??a µetaf??s?µ?

81
?? µ??e? ?e??s?a? ?
Write a Comment
User Comments (0)
About PowerShow.com