SOAP - PowerPoint PPT Presentation

1 / 65
About This Presentation
Title:

SOAP

Description:

soap 2006-05 soap soap rpc http soap soap 1. – PowerPoint PPT presentation

Number of Views:240
Avg rating:3.0/5.0
Slides: 66
Provided by: MaDi70
Category:
Tags: soap | biztalk

less

Transcript and Presenter's Notes

Title: SOAP


1
SOAP
  • ???????
  • ???????
  • 2006-05

2
????
  1. SOAP??
  2. SOAP??
  3. ??
  4. RPC
  5. HTTP??
  6. SOAP??????
  7. Soap??

3
1. ????
  • SOAP???Dave Winner?Don Box?Bod Atkinson???
  • ?1987?,Microsoft??????XML??????,?????????????HTTP?
    ????????(RPC)?????DevelopMentor?Userland???????
  • ?1998??,S0AP?????????Userland?1998??????XML-RPC???
  • 1999?9?SOAP0.9??IETF?
  • 2000?5?8?,SOAP1.1??Note??W3C?IBM??Java
    SOAP??,?????????Apache XML Project?Sun???Web?????J
    2EE??
  • 2000?9?13?,W3C???XML?????,??????XML??,??????XML???
    ????????????SOAP1.1????,??2001?7?9????????????SOAP
    1.2?

4
  • SOAP ????????????????XML??????????????????????????
    ???
  • SOAP1.1????????(Simple Object Access
    Propotol)?Web????????
  • ????????????????
  • ????????????????????
  • ??????????????????????????,???????????????????????
    ,???????????????
  • ?????????????????????????????

5
(No Transcript)
6
Intermediator
SOAP
Network Protocol
7
SOAP????
  • ?????????
  • ??SOAP?????????????
  • ????????????,??????????XML?????
  • ??????
  • ?????????????,??????????????????????
  • ??????
  • ??XML?????????,???????
  • ?????????
  • ?????????????????,???????XML??????????????????????
    ?????
  • ????????(RPC)??????SOAP?????,?????????????????
  • ????????????
  • ?SOAP?????HTTP???,??HTTP?Internd??????????

8
SOAP
  • ??XML???,??????
  • ??(Envelope)?????????,??????????,?????,??????????
    ??????
  • ????(Encoding Rules)?????????????????????
  • ??(Binding)????????,???????
  • RPC???????????????

9
2. SOAP????
  • SOAP??????????SOAP??4?XML??
  • ??(envEnvelope)
  • ?(envHeader)
  • ?(envBody)?????SOAP??????
  • ??(envFault)??????????SOAP??

10
SOAP?????XML??
  • SOAP???XML??????????????????
  • ???SOAP??????SOAP???????????????SOAP???????????SOA
    P?????????????
  • ??SOAP???????SOAP????????????,?????????envSender
    ????
  • ??,?????????,?????????????????????????????,???????
    ???????????????????
  • ?????????document element???????????,?????????????
    ???????

11
????
  • "http//schemas.xmlsoap.org/soap/envelope "
  • "http//www.w3.org/2001/XML.Schema-instance "
  • "http//www.w3.org/2001/XML.Schema "
  • "http//schemas.xmlsoap.org/soap/encoding "
  • "http//schemas.xmlsoap.org/wsdl/"
  • "http//schemas.xmlsoap.org/wsdl/soap "
  • "http//ws-i.org/schema/conformanceClain"

12
SOAP??
  • ltenvEnvelope xmlnsenv"http//www.w3.org/2001/06
    /soap-envelope"gt
  • ltenvHeadergt   
  • ltnalertcontrol xmlnsn"http//example.org/
    alertcontrol"gt
  • ltnprioritygt1lt/nprioritygt
  • ltnexpiresgt2001-06-22T140000-0500lt
    /nexpiresgt  
  •   lt/nalertcontrolgt
  • lt/envHeadergt  
  • ltenvBodygt  
  •  ltmalert xmlnsm"http//example.org/alert"gt
  • ltmmsggtPick up Mary at school at
    2pmlt/mmsggt   
  • lt/malertgt
  • lt/envBodygt
  • lt/envEnvelopegt

13
(1) SOAP??
  • SOAP????????SOAP????????,???
  • ??Envelope?????
  • ??http//www.w3.org/2003/05/soap-envelope???????
  • ???attributes?????????????????????????
  • ???children?????????????????,????
  • ???????????
  • ???????????

14
SOAP ????
  • encodingStyle?? encodingStyle?????????SOAP???????
    ?????????
  • SOAP???encodingStyle????????SOAP????????????
  • encodingStyle??????????????,??????????????????????
    ???????????
  • SOAP??
  • SOAP?????????????????????SOAP???????
  • SOAP Detail????????????
  • ??1?2?3??????
  • encodingStyle??????????????SOAP??????????????

15
SOAP Header
  • SOAP??????????????????????????SOAP??,?????????????
    ?????????????????????????????????Header???
  • Header????????SOAP Envelope XML???????????Header??
    ??????????Header???

16
  • ltenvHeader xmlnsenv"http//www.w3.org/2003/05/s
    oap-envelope" gt
  • lttTransaction xmlnst"http//example.org/2001/
    06/tx"
  • envmustUnderstand"true" gt5
  • lt/tTransactiongt
  • lt/envHeadergt

17
  • Header?????????
  • ??SOAP Header????????????????,??????????????????UR
    I????????
  • SOAP Header????????????????????
  • encodingStyle????????Header????????
  • role???SOAP mustUnderstand???????????SOAP?????????
    ???????

18
SOAP Header
  • ??????
  • ??ID
  • ??
  • ????
  • ????
  • ??

19
role??
  • SOAP?????????????,????????????????SOAP?????SOAP???
    ???????????SOAP????????????????????????????URI????
  • role?????????xsanyURI?role??????????URI,?URI?????
    ???SOAP????????
  • ??????????SOAP???,???????,???????????????????

20
  • ????????SOAP???????,???SOAP????????????????

?? ?? ??
Next "http//www.w3.org/2003/05/soap-envelope/role/next" ??SOAP?????SOAP??????????
None "http//www.w3.org/2003/05/soap-envelope/role/none" ??SOAP??????????
Ultimate Receiver "http//www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" ????????????
21
  • ?????????????Header????????Header?SOAP????????????
    ??
  • ???SOAP role??,???role?????http//www.w3.org/2003/
    05/soap-envelope/role/ultimateReceiver,??????SOAP?
    ????????

22
mustUnderstand??
  • mustUnderstand??????????Header???????????????????
  • Header????????SOAP role??????mustUnderstand??????
    0?1??????SOAP mustUnderstand??,????????mustUder
    stand?????????0 ?
  • ?Header??????1?mustUnderstand??,??Header????????
    ?????????????????,?????????????
  • mustUnderstand??????????????????????1?SOAP
    mustUnderstand???????????????????????????????????

23
SOAP relay??
  • SOAP relay?????????,?????SOAP????SOAP???????,?????
    ??????
  • relay?????????xsboolean?
  • ?????,???????????false?relay???
  • SOAP??????????false?0?SOAP relay?????,?SOAP???
    ?????????????
  • ????SOAP relay?????,SOAP?????????????????true?SO
    AP?????????????????????
  • ??SOAP???SOAP???????SOAP?????relay??????

24
SOAP Body
  • SOAP Body???????????????????????????????Body??????
    ??????RPC????????
  • Body????????SOAP Envelope???????????????Header??,?
    Body????????Header??,??Body?????Envelope??????????
    ?
  • ??Body???????????SOAP Body??,?????Body????????SOAP
    Body???????????

25
SOAP Body
  • Body?????????
  • 1.??Body????????????????,??????????????????URI????
    ????SOAP Body???????????????????
  • 2.SOAP encodingStyle?????????Body???????????
  • 3.SOAP?????Body??,???????Fault???

26
SOAP Fault
  • SOAP Fault??????SOAP???????????????SOAP??????SOAP
    Fault????,???????Body????,???Body?????????????
  • SOAP Fault??????????
  • 1.faultcode?????????????????????????????faultcode?
    ??SOAP Fault??????SOAP????????SOAP??????????????SO
    AP???
  • 2.faultstring????????????????????????,??????????,?
    ??????????????
  • 3.faultactor?????SOAP?????????????????????????faul
    tactor??????????????URI???????SOAP???????????????S
    OAP Fault?????faultactor????????????????faultactor
    ?????????????????
  • 4.detail????????SOAP Body???????????????????Body??
    ???????????????,??????????????????Header????????

27
SOAP Fault
  • ?SOAP Fault??????detail??,?????????Body???????????
    ??????????Body?????SOAP??????????
  • detail??????????????detail??,????detail?????detail
    ????????????????
  • detail?????????
  • 1.??detail?????????????????detail?????????????????
    ??
  • 2.SOAP encodingStyle?????????detail???????????

28
3. SOAP??
  • ???? SOAP????XML Schema Part 2
    Datatypes?Build-in datatypes?????????,????????(
    lexical spaces)
  • 1.???string?????XML Schema Part 2
    Datatypes?????
  • 2.??XML Schema Part 2 Datatypes???????????(en
    umeration)????
  • 3.??????Byte???????????????????????Byte??????????
    ?XML Schema??????base64?????
  • 4.?????????????????,?????????????????????????????
    ???xsitype????????????

29
SOAP??
  • ????SOAP??????????????????????????
  • 1.struct????????,???????????????????,????????
  • 2.array????????,???????????????????

30
4. SOAP??????
  • SOAP-RPC SOAP????????????XML????????????????RPC??
    ?
  • ?????????,??????
  • 1.??SOAP???URI
  • 2.???
  • 3.???????????
  • 4.????????
  • 5.??????

31
RPC?SOAP Body
  • RPC????????SOAP Body?????,????????
  • 1.??????????????struct???????????????struct,????i
    n?in/out??????????????????????????????
  • 2.??in?in/out?????????????,???????????????????
    ????????????????RPC?????
  • 3.??????????????struct?

32
SOAP ????
  • ltSOAP-ENVEnvelope xmlnsSOAP-ENV"http//soaporg
    /envelope/"SOAP-ENVencodingStyle
    "http//soaporg/encoding/"gt
  • ltSOAP-ENVBodygt
  • ltmQuotePrice xmlnsm"Some-URI"gt
  • ltcommoditygtComputerlt/commoditygt
  • lt/mQuotePricegt
  • lt/SOAP-ENVBodygt
  • lt/SOAP-ENVEnvelopegt

33
RPC?SOAP Body
  • ??????????????struct,????out?in/out???????????
    ?????????,?????????????????
  • ??out?in/out?????????????,????????????????????
    ????????????????????????,???????????????,????,????
    Response???????,???????????
  • ?????????SOAP Fault??????????????????????????,????
    ?????????
  • ?????????????????,??????encodingStyle???????????
  • ???????????????????????????
  • ?????????result?????,???fault?????,???????????
    ???result?fault??????

34
SOAP ????
  • ltSOAP-ENVEnvelope xmlnsSOAP-ENV"http//soapor
    g/envelope/"SOAP-ENVencodingStyle"http//soap
    org/encoding/"gt
  • ltSOAP-ENVBodygt
  • ltmQuotePriceResponse xmlnsm"Some-URI"gt
  • ltPricegt8000.00lt/Pricegt
  • lt/mQuoteStockPriceResponsegt
  • lt/SOAP-ENVBodygt
  • lt/SOAP-ENVEnvelopegt

35
????
  • RPC (Remote Proceduce Call) SOAP Request
    Message ?SOAP Body ?, ??? sub-element
    ???operation ???
  • ltSOAPBodygt
  • ltrpc-operationgt
  • ltmessage-part-1gtlt!-- mapped to a parameter-- gt
  • ltmessage-part-2gtlt!-- mapped to a parameter-- gt
  • lt/rpc-operationgt
  • lt/SOAPBodygt

36
  • Document ?? messaging oriented document
    exchange. ??document-oriented Service ?
    messaging-oriented Service, ???operation
    ,??SOAP Body ?????message part, ????? operation
    element
  • ltSOAPBodygt
  • ltmessage-part-1gt ...
  • ltmessage-part-2gt ...
  • lt/SOAPBodygt
  • ??????, ???.NET ? JAVA, ??????? operation
    ?????????,??? RPC Operation ??? Document
    Operation, ??????? Method ???

37
????
  • 1.rpc/encoded
  • 2.rpc/literal
  • 3.document/encoded
  • 4.document/literal

38
??
  • public class myServices
  • public void myMethod (int x)
  • return

39
rpc/encoded??
  • SOAP????
  • ltsoapenvelopegt
  • ltsoapbodygt
  • ltmyMethodgt
  • ltx xsitype"xsdint"gt5lt/xgt
  • lt/myMethodgt
  • lt/soapbodygt
  • lt/soapenvelopegt

40
rpc/literal??
  • ltsoapenvelopegt
  • ltsoapbodygt
  • ltmyMethodgt
  • ltxgt5lt/xgt
  • lt/myMethodgt
  • lt/soapbodygt
  • lt/soapenvelopegt

41
document /encoded
  • ltsoapenvelopegt
  • ltsoapbodygt
  • ltxElement xsitype"xsdint
    "gt5lt/xElementgt
  • lt/soapbodygt
  • lt/soapenvelopegt

42
document /literal
  • ltsoapenvelopegt
  • ltsoapbodygt
  • ltxElementgt5lt/xElementgt
  • lt/soapbodygt
  • lt/soapenvelopegt

43
document / literal-wrap
  • ltsoapenvelopegt
  • ltsoapbodygt
  • ltmyMethodgt
  • ltxgt5lt/xgt
  • lt/myMethodgt
  • lt/soapbodygt
  • lt/soapenvelopegt

44
  • It's just that there are two ways to structure a
    SOAP message.
  • In the early versions of SOAP, SOAP was designed
    to support only RPC style.
  • When using RPC style, the contents of the SOAP
    Body must conform to a structure that indicates
    the method name and contains a set of parameters.
  • By the time the SOAP 1.0 spec was published, it
    was expanded to support both RPCs and
    unstructured messages (document).
  • When using Document style, you can structure the
    contents of the SOAP Body any way you like.

45
5. HTTP??SOAP
  • ??SOAP?????HTTP????????,??????????SOAP????HTTP
    Post???????
  • 1.HTTP Header??SOAPAction??SOAPAction
    HTTP?????(header field)??????SOAP
    HTTP??????????????????URI?
  • 2.SOAP HTTP???HTTP???SOAP?????HTTP????????HTTP???
    ???????,2xx?????????????SOAP????????????????????
  • 3.??????????SOAP?????,SOAP HTTP?????????HTTP 500
    Internal Server Error????????????SOAP????????SOA
    P Fault???
  • 4.HTTP????SOAP?????HTTP Extension
    Framework???????SOAP HTTP???

46
?HTTP???SOAP
  • SOAP??HTTP???/??????,?SOAP???????HTTP???,??SOAP???
    ????HTTP????
  • SOAPAction HTTP?????(header field)??????SOAP
    HTTP??????????????????URI?
  • POST /StockQuote HTTP/1.1
  • Content-Type text/xml charset"utf-8"
  • Content-Length nnnn
  • SOAPAction "http//electrocommerce.org/abcMyMess
    age"
  • ltenvEnvelope xmlnsenv"http//www.w3.org/2001/06
    /soap-envelope" gt
  • . . .
  • lt/envEnvelopegt

47
  • ?HTTP???SOAP?????HTTP????????HTTP????????
  • HTTP/1.1 200 OK
  • Content-Type text/xml charset"utf-8"
  • Content-Length nnnn
  • ltenvEnvelope xmlnsenv"http//www.w3.org/2001/06
    /soap-envelope" gt
  • . . .
  • lt/envEnvelopegt

48
  • ?RPC?,??HTTP??SOAP??????????,??RPC?????????????HTT
    P??,?RPC????????HTTP?????SOAP???RPC????HTTP?????

49
6. SOAP??????
  • SOAP With Attachment
  • ebXML Message Service
  • SOAP Security Extension

50
SOAP With Attachment
51
ebXML Message Service
  • ????
  • RPC???????,????(messaging)
  • EDI???????,??????(Document exchange)
  • ebXML??
  • EDI?????,????
  • ??????????????????

ebXML Message
CPA
CPA
52
XML ??
ltUser IdGuestgt ltNamegtMarklt/Namegt ltAgegt22lt/Ag
egt ltAddressgtBeiJinglt/Addressgt ltPasswordgthappylt/
Passwordgt lt/Usergt
??????
53
01ltUser IdGuestgt 02
ltNamegtMarklt/Namegt 03 ltAgegt22lt/Agegt 04
ltAddressgtBeiJinglt/Addressgt 05
ltxencEncryptedData TypeElementgt 06 ltxencEnc
ryptedMethod Algorithmgt 07 ltdsKeyInfogt 08
ltdsKeyNamegtlt/dsKeyNamegt 09 ltdsKeyInfogt 10
ltxencCipherTextgtlt/xencCipherTextgt 11
lt/xencEncryptedDatagt 12lt/Usergt
???????
54
(No Transcript)
55
01ltUser IdGuestgt 02
ltNamegtMarklt/Namegt 03 ltAgegt22lt/Agegt 04
ltAddressgtBeiJinglt/Addressgt 05
ltEncryptedDatagtlt/EncryptedDatagt lt!--????--gt 06
ltSignaturegt lt!--????--gt 07 ltSignedInfogt
lt!--????--gt 08
ltCanonicalizationMethod Algorithm/gt 09
ltSignatureMethod Algorithm/gt 10
ltReference URIEncryptedDatagt 11
ltTransform Algorithm /gt 12
ltDigitalMethod Algorithm /gt 13
ltDigitalValuegtltDigitalValuegt 14
lt/Referencegt 15 lt/SignedInfogt 16 ltSingatureVal
uegtltSignatureValuegt lt!--???--gt 17 ltKeyInfogt
lt!--????--gt 18 ltKeyValuegtltKeyValuegt 1
9 lt/KeyInfogt 20 lt/Signaturegt 21lt/Usergt
56
  • Signature ??
  • SingedInfo ????
  • CanonicalMethod ?????
  • SignatureMethod ????
  • Reference(URI)
  • Transforms? ??
  • DigestMethod ????
  • DigestValue ???
  • SignatureValue ???
  • KeyInfo? ????
  • Object ??????
  • Manifest
  • SignatureProperties
  • ??????

57
SOAP Security Extension
  • SOAP-DSIG (SOAP Security ExtensionsDigital
    Signature,SOAP ????????)?W3C????SOAP????????????,
    ????? SOAP ???????????????????????
  • ???????SOAP?ltSOAP-ENVHeadergt????,??????SOAP-SEC,
    ?????ltSOAP-SECSignaturegt???SOAP?ltSOAP-ENVBodygt??
    ??
  • ltSOAP-SECSignaturegt?XML ??????,???ltdsReferencegt?
    ???????SOAP???,ltdsSignatureValuegt?????????

58
(No Transcript)
59
7. SOAP????
Company/ Organization Reporting Implementation Name Implementation Version Spec Version/Comment
Apache Glen Daniels Axis Beta 1 and after Limited support for June SOAP 1.2 spec in Beta 1, and for the December SOAP 1.2 spec in the current CVS implementation. Don't yet fully support new encoding or all faults, but we plan to be fully compliant soon, tracking the spec into future releases.
BEA David Orchard WebLogic Server 8.0 and later BEA provides a soap 1.2 endpoint at http//webservice.bea.com9001/index.html. Endpoint contact is Manoj Cheenath.
Microsoft Henrik Frystyk Nielsen BizTalk In order to help meeting the W3C implementation requirements, Microsoft will provide a public endpoint that can accept incoming SOAP 1.2 messages and be able to generate SOAP 1.2 messages and send them to other SOAP 1.2 endpoints. Endpoint is at http//mssoapinterop.org/asmx/ (Contacts Alex DeJarnatt ltalexdej_at_microsoft.comgt and John Koropchak ltjohnko_at_microsoft.comgt).
SOAPLite Paul Kulchenko SOAPLite 0.55 and later Limited support for SOAP 1.2. Plan to support most of the spec before March 2003.
Systinet Jacek Kopecky WASP Server for Java 4.0 WASP 4.5 supports most features of the June 2002 Last Call draft of SOAP 1.2. Endpoint is available, see http//soap.systinet.net/interop/ for more information.
TIBCO Don Mullen Web Services SDK 2.0 TIBCO's SOAP 1.2 endpoint is available at http//webservice.tibco.com/interop
White Mesa Bob Cunnings White Mesa Server 3.0 Endpoint supports SOAP 1.2, see http//www.whitemesa.net/ for details.
60
SOAP????
Company/ Organization Implementation Name Implementation Version Spec Version/Comment
IBM Websphere 5.0 or later Apache SOAP has worked under every version of WebSphere from 1.1 to 3.02. It will work out of the box on WebSphere 3.5 with fixpak 2 applied. Wouter Cloetens has provided instructions on using Apache-SOAP with IBM Websphere v1, v2, and v3.0 on http//workspot.net/zombie/soap/. There are also instructions for WebSphere v3.5 in the Apache-SOAP distribution - see http//xml.apache.org/websrc/cvsweb.cgi/checkout/xml-soap/java/docs/install/websphere.html?rev1.1content-typetext/htmlonly_with_tagMAIN. Be sure to check the following items 1. Explicitly set the port number that you have exposed the rpcrouter servlet on. Even if it is default(80), just mention it in the URL as http//aaa.bbb.ccc.dddport/soap/servlet/rpcrouter. 2. Verify that xerces is at the start of your path not only by setting it in the App but also in the websphere configuration files (admin.config, setupclient.bat).
Oracle Oracle 8i According to the Oracle folks, SOAP should work under the latest production release of Oracle 8i, which is Oracle 8.1.7. Earlier releases of Oracle 8i (e.g 8.1.6) seem to be more awkward the JVM bundled with 8.1.6 has a bug that affects Xerces. See here for more information http//marc.theaimsgroup.com/?lsoap-userm98200304522497w2
61
SOAP Engine
ltsoapenvelopegt ltsoapbodygt
ltmyMethodgt ltx xsitype"xsdint"gt5lt/xgt
lt/myMethodgt lt/soapbodygt lt/soapenvel
opegt
public class myServices public void myMethod
(int x) return
SOAP Engine
Service Implement
SOAP Message
  • SOAP Engine
  • ????
  • ???
  • ????
  • ??????
  • ??????

62
  • Web Service Server
  • ?????????
  • ??????,????????
  • ???,??????
  • ??,Qos
  • ????,????

Web Service Server
SOAP??
?????
SOAP????
63
  • Web Service Server in Web Server

Web Server/ Web Service Server
SOAP??
HTTP
Servlet
64
8.SOAP??
  • ??
  • ???????
  • ???????
  • ???????
  • ???????
  • ???????
  • ??
  • ?
  • ??????????

65
End!
Write a Comment
User Comments (0)
About PowerShow.com