Your SlideShare is downloading. ×
Soap
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Soap

6,601
views

Published on

SOAP (Simple Object Access Protocol) Overview

SOAP (Simple Object Access Protocol) Overview


0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
6,601
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
393
Comments
0
Likes
5
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. SOAP Simple Object Access Protocol
  • 2. Apakah SOAP?
    • Saat ini web adalah komunikasi antara manusia dan aplikasi.
    • SOAP adalah komunikasi aplikasi ke aplikasi
    • SOAP adalah lightweight protocol untuk pertukaran informasi yg terstruktur dalam lingkungan desentralisasi dan terdistribusi.
    • SOAP menggunakan XML technologies dalam mendefinisikan framework messagingnya
    • framework ini dirancang independen terhadap berbagai model programming
  • 3.
    • SOAP adalah communication protocol
    • SOAP adalah a format untuk sending messages
    • SOAP dirancang untuk komunikasi via Internet
    • SOAP adalah platform independent
    • SOAP adalah language independent
    • SOAP adalah simple and extensible
    • SOAP bisa melewati firewalls
    • SOAP adalah W3C standard
  • 4. SOAP Architecture
    • Spesifikasi SOAP terdiri dari 4 bagian:
      • SOAP envelope: menjelaskan format dari SOAP message.
      • SOAP encoding: menggambarkan dari representasi data yang dikirim dalam sebuah pesan .
      • SOAP RPC: mendefinisikan bagaimana SOAP message dapat mengeksekusi remote procedure calls (RPCs).
      • SOAP binding framework: mendefinisikan protocol yang digunakan SOAP messages yang dikirim oleh aplikasi .
  • 5. One way message
  • 6. Request response
  • 7. SOAP format
    • SOAP message terdiri dari tiga bagian :
      • SOAP Envelope
      • SOAP Header (optional)
      • SOAP Body
  • 8. Contoh apache Apache SOAP service: HelloService.java Apache SOAP rpcrouter servlet Apache SOAP client: HelloClient.java Jakarta Tomcat server SOAP request: Service name: urn:Hello World Method name: sayHello Parameter: firstName=“Yuhong” lastName=“Yan SOAP response: Return value: “Yuhong Yan, welcome to SOAP” “ Yuhong Yan, Welcome to SOAP…” sayHello(“Yuhong”,”Yan) 1 2 3 4 5 Http POST Http GET
  • 9. SOAP Envelope
    • SOAP Envelope mendefinisikan keseluruhan framework untuk menjawab
      • apa yang didalam message dan
      • siapa yang terlibat
    • Envelope adalah top element dari XML document yang perepresentasikan message.
      • Envelope element selalu menjadi root element dari SOAP message.
      • Envelope element terdiri dari
        • optional Header element
        • Dan mandatory Body element.
  • 10. SOAP Envelope Code
    • <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;>
    • <soap:Header> <!-- optional -->
    • <!-- header blocks go here... -->
    • </soap:Header>
    • <soap:Body>
    • <!-- payload or Fault element goes here... -->
    • </soap:Body>
    • </soap:Envelope>
  • 11. Envelope element
    • penggunaan xmlns:soap namespace selalu menggunakan http://www.w3.org/2001/12/soap-envelope
  • 12. EncodingStyle
    • SOAP encodingStyle attribute digunakan untuk mendefinisikan type data yang digunakan dalam dokumen .
    • attribute ini bisa muncul pada setiap SOAP element, dan berpengaruh hanya pada elemen tersebut dan childnya
    • SOAP message tidak mempunyai default encoding.
  • 13. SOAP Header
    • Header element adalah generic container untuk inform asi kontrol
    • Bisa berupa beberapa elements dari beberapa namespace
    • Header berisi informa si proses dari message
    • Header adalah optional
  • 14. SOAP Header
    • <soap:Header>
    • <!-- security credentials -->
    • <s:credentials xmlns:s=&quot;urn:examples-org:security&quot;> <username>dave</username> <password>evad</password>
    • </s:credentials>
    • </soap:Header>
  • 15. Body
    • Elemen body menjelaskan messagenya
    <soap:Body> <x:TransferFunds xmlns:x=&quot;urn:examples-org:banking&quot;> <from>22-342439</from> <to>98-283843</to> <amount>100.00</amount> </x:TransferFunds> </soap:Body>
  • 16. Contoh request
    • SOAP Message Embedded in HTTP Request:
    • <SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;   SOAPENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;> <SOAP-ENV:Body>        <m:GetLastTradePrice xmlns:m=&quot;Some-URI&quot;>            <symbol>DIS</symbol>        </m:GetLastTradePrice>    </SOAP-ENV:Body>
    • </SOAP-ENV:Envelope>
  • 17. Contoh response
    • SOAP Message Embedded in HTTP Response:
    • <SOAP-ENV:Envelope   xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;   SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;/>    <SOAP-ENV:Body>        <m:GetLastTradePriceResponse xmlns:m=&quot;Some-URI&quot;>            <Price>34.5</Price>        </m:GetLastTradePriceResponse>    </SOAP-ENV:Body>
    • </SOAP-ENV:Envelope>
  • 18. SOAP Security
    • SOAP specification tidak mendefinisikan encryption untukk XML Web Services.
    • Diserahkan kepada implementer dari SOAP protocol.
    • Encryption tergantung dari transport protocol
    • apakah transport protocol tersebut support secure communication?
    • cost dari enkripsi semua data dibandingan dengan sebagian data?
  • 19. Contoh
    • <%@ WebService Language=&quot;C#&quot; Class=&quot;CreditCardService&quot; %>
    • using System.Web.Services;
    • public class CreditCardService {
    • [WebMethod]
    • [EncryptionExtension(Encrypt=EncryptMode.Response)]
    • public string GetCreditCardNumber() {
    • return &quot;MC: 4111-1111-1111-1111&quot;;
    • }
    • }
  • 20. Request yg dienkripsi
    • <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?>
    • <soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;>
    • <soap:Body>
    • <GetCreditCardNumber xmlns=&quot;http://tempuri.org/&quot; />
    • </soap:Body>
    • </soap:Envelope>
  • 21. Response yg dienkripsi
    • <soap:Body>
    • <GetCreditCardNumber xmlns=&quot;http://tempuri.org/&quot;>
    • <GetCreditCardNumberResult>83 151 243 32 53 95 86 13 190 134 188 241 198 209 72 114 122 38 180 34 194 138 16 97 221 195 239 86 26 152 94 27
    • </GetCreditCardNumberResult>
    • </GetCreditCardNumber>
    • </soap:Body>
  • 22. SOAP Fault Element
    • Error mesage dari SOAP mesage dimasukkan kedalam Fault element.
    • (option al ) jika Fault element ada , maka harus muncul sebagai elemen child pada Body element.
    • Fault element hanya muncul sekali dalam SOAP message.
  • 23. SOAP Fault Element
    • SOAP Fault element mempunyai sub elements:
    • <faultcode >
      • A code for identifying the fault
    • <faultstring >
      • A human readable explanation of the fault
    • <faultactor >
      • information about who caused the fault to happen
      • URI value identifying the source
    • <detail>
      • error information related only to the Body element.
      • if not present then indicates that the fault is not related to the Body
      • element.
  • 24. faultcode
  • 25. Contoh
  • 26. HTTP
    • HTTP communicates over TCP/IP.
    • An HTTP client connects to an HTTP server using TCP.
    • After establishing a connection, the client can send an HTTP request message to the server:
    POST /item HTTP/1.1 Host: 189.123.345.239 Content-Type: text/plain Content-Length: 200
  • 27. HTTP
    • The server then processes the request and sends an HTTP response back to the client.
    • The response contains a status code that indicates the status of the request:
  • 28. SOAP HTTP Binding
    • A SOAP method is an HTTP request/response that complies with the SOAP encoding rules.
        • HTTP + XML = SOAP
    • A SOAP request could be an HTTP POST or an HTTP GET request.
    • POST -- Send
    • GET -- Retrieve
  • 29. SOAP request and response
    • The Content-Type header for a SOAP request and response defines
      • the MIME type for the message and
      • the character encoding (optional)
    • used for the XML body of the request or response.
  • 30. SOAP request and response
    • The Content-Length header for a SOAP request and response specifies the number of bytes in the body of the request or response.
  • 31. Contoh
    • GetStockPrice request is sent to a server. The request has a StockName parameter, and a Price parameter will be returned in the response. The namespace for the function is defined in http://www.example.org/stock address.
    • The SOAP request:
  • 32.