1 / 23

18 장 Data Transmission

18 장 Data Transmission. 2001.11.19 인공지능 연구실 홍 정 연. Contents. Executing a Data Transmission How can XML help? SOAP Transmission Over HTTP. Executing a Data Transmission. Agree on a Format Transport Routing Request-Response Processing. How can XML help?.

Download Presentation

18 장 Data Transmission

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. 18장 Data Transmission 2001.11.19 인공지능 연구실 홍 정 연

  2. Contents • Executing a Data Transmission • How can XML help? • SOAP • Transmission Over HTTP

  3. Executing a Data Transmission • Agree on a Format • Transport • Routing • Request-Response Processing

  4. How can XML help? • XML Documents are Self-Documenting • Element나 attribute의 이름이 contents를 표현 • 다른 document의 supporting없이 명확하게 문서를 표현

  5. <OrderData> <Invoice orderDate="10/17/2000" shipDate="10/20/2000"> <Customer name="Homer J. Simpson" address="742 Evergreen Terrace" city="Springfield" state="KY" postalCode="12345" /> <Part description="2 inch blue grommets" quantity="17" price="0.10" /> <Part description="3 inch red sprockets" quantity="11" price="0.15" /> </Invoice> <Invoice orderDate="10/21/2000" shipDate="10/25/2000"> <Customer name="Kevin B. Williams" address="744 Evergreen Terrace" city="Springfield" state="KY" postalCode="12345" /> <Part description="1.5 inch silver sprockets" quantity="9" price="0.25" /> <Part description="0.5 inch gold widgets" quantity="3" price="0.35" /> </Invoice> </OrderData> <?xml version="1.0"?> <!DOCTYPE OrderData [ <!ELEMENT OrderData (Invoice+)> <!ELEMENT Invoice (Customer, Part+)> <!ATTLIST Invoice orderDate CDATA #REQUIRED shipDate CDATA #REQUIRED> <!ELEMENT Customer EMPTY> <!ATTLIST Customer name CDATA #REQUIRED address CDATA #REQUIRED city CDATA #REQUIRED state CDATA #REQUIRED postalCode CDATA #REQUIRED> <!ELEMENT Part EMPTY> <!ATTLIST Part description CDATA #REQUIRED quantity CDATA #REQUIRED price CDATA #REQUIRED> ] >

  6. How can XML help? • XML Documents are Flexible • 현재 코드의 변형 없이 information을 추가 하는 것이 쉬움 <?xml version="1.0"?> <!DOCTYPE OrderData [ <!ELEMENT OrderData (Invoice+)> <!ELEMENT Invoice (Customer, Part+)> <!ATTLIST Invoice orderDate CDATA #REQUIRED shipDate CDATA #REQUIRED> shiplMethod (USPS | UPS | FedEx) #IMPLIED> <!ELEMENT Customer EMPTY>

  7. How can XML help? • XML Documents are Normalized • XML Documents can Utilize Off-The-Shelf XML Tools • Off-the-shelf XML tools ; XML document의 creation, manipulation, processing에 적합

  8. How can XML help? • Routing and Requesting • 기존의 문서를 추가적인 parent element로 wrapping하여 문서가 어떻게 process되고 route되는지를 describe 할 수 있음  envelope <!ELEMENT OrderData (Invoice+)> <!ELEMENT Invoice (Customer, Part+)> <!ATTLIST Invoice orderDate CDATA #REQUIRED shipDate CDATA #REQUIRED> <!ELEMENT Customer EMPTY> <!ATTLIST Customer name CDATA #REQUIRED address CDATA #REQUIRED …..

  9. add some routing information <!ELEMENT OrderData (Invoice+)> <!ATTLIST OrderData userName CDATA #IMPLIED status (PleaseCall | FYI | PleaseFulfill | Fulfilled) #IMPLIED> <!ELEMENT Invoice (Customer, Part+)> <!ATTLIST Invoice orderDate CDATA #REQUIRED shipDate CDATA #REQUIRED> <!ELEMENT Customer EMPTY> <!ATTLIST Customer name CDATA #REQUIRED ….. <OrderData> userName=“Ned Flanders” status=”FYI”> <Invoice orderDate="10/17/2000" shipDate="10/20/2000"> <Customer name="Homer J. Simpson" address="742 Evergreen Terrace“ …..

  10. request-response pairs * request <!ELEMENT OrderData (Invoice+)> <!ATTLIST OrderData userName CDATA #IMPLIED status (PleaseCall | FYI | PleaseFulfill | Fulfilled) #IMPLIED transactionID CDATA #IMPLIED> <!ELEMENT Invoice (Customer, Part+)> <!ATTLIST Invoice orderDate CDATA #REQUIRED <OrderData> userName=“Ned Flanders” status=”FYI” transactionID=“101700A1B12”> <Invoice orderDate="10/17/2000" shipDate="10/20/2000"> <Customer name="Homer J. Simpson" address="742 Evergreen Terrace“ …..

  11. * Response <!ELEMENT OrderDataResponse EMPTY> <!ATTLIST OrderDataResponse status (Accepted | Errors | TooBusy ) #REQUIRED stateDetail CDATA #IMPLIED transactionID CDATA #REQUIRED> <OrderDataResponse statys=“Accepted” transactionID=“101700A1B12” /> <OrderDataResponse statys=“Errors” statusDetail=“Unknown customer.” transactionID=“101700A1B12” />

  12. SOAP • 웹상의 객체들을 액세스하기 위한 마이크로소프트의 프로토콜 • 이 프로토콜은 HTTP를 사용하여 인터넷에 텍스트 명령어를 보내기 위해 XML 구문을 씀 • SOAP은 COM, DCOM, 인터넷 익스플로러, 마이크로 소프트의 자바 이행등에서 지원됨 • Platform-independent component instantiation and remote procedure calls • Providing meta-information about a document in the form of an envelope. • Delivering XML documents over existing HTTP channels

  13. SOAP Envelope • HTTP를 이용하여 XML document를 전송하기 위해서는 SOAP envelope structure로 document를 encapsulate해야 함 <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelop/”> <SOAP-ENV:Header> </SOAP-ENV:Header> <SOAP-ENV:Body> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

  14. SOAP Header <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelop/”> <SOAP-ENV:Header> <invoice:MessageStatus xmlns:invoice=“http://www.invoicesystem.com/soap”> <invoice:status>Resend</invoice:status> </invoic:MessageStatus> </SOAP-ENV:Header> <SOAP-ENV:Body> </SOAP-ENV:Body> </SOAP-ENV:Envelope> • client가 message를 handle하는데 additional processing information을 제공 <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelop/”> <SOAP-ENV:Header> <invoice:MessageStatus xmlns:invoice=“http://www.invoicesystem.com/soap”> SOAP-ENV:mustUnderstand=“1”> <invoice:status>Resend</invoice:status> </invoic:MessageStatus> </SOAP-ENV:Header> <SOAP-ENV:Body> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

  15. <Customer CustomerID="c1" name="Homer J. Simpson" address="742 Evergreen Terrace" city="Springfield" state="KY" postalCode="12345" /> <Part PartID="p1" name="grommets" size="3 in." color="blue" /> <Part PartID="p2" name="sprockets" size="2 in." color="red" /> <SOAP-ENV:Fault> <SOAP-ENV:faultcode>SOAP-ENV: Client.BusinessRule.NotFound </SOAP-ENV:faultcode> <SOAP-ENV:faultstring>The resent record was not found. </SOAP-ENV:faultstring> <SOAP-ENV:detail> <error:BusinessRule xmlns:error= "http://www.invoicesystem.com/soap"> <BusinessRule>ResendNotMatched</BusinessRule> <ErrorCode>1007</ErrorCode> </error:BusinessRule> </SOAP-ENV:detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> SOAP Body • contains the actual message <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <invoice:MessageStatus xmlns:invoice="http://www.invoicesystem.com/soap" SOAP-ENV:mustUnderstand="1"> <invoice:status>Resend</invoice:status> </invoice:MessageStatus> </SOAP-ENV:Header> <SOAP-ENV:Body> <Invoice customerIDREF="c1" orderDate="10/17/2000" shipDate="10/20/2000"> <LineItem partIDREF="p1" quantity="17" price="0.15" /> <LineItem partIDREF="p2" quantity="13" price="0.25" /> </Invoice>

  16. SOAP Fault Element • Faultcode Element(1/2) • SOAP message를 parse할 때 일어나는 error를 가리킴 • versionMismatch : SOAP Envelop element에 맞는 namespace가 있는지 체크 • MustUnderstand :processor가 Messagestatus element를 어떻게 handle 해야 할 지 모르면 sender에게 error message를 return

  17. SOAP Fault Element • Faultcode Element(2/2) • Client : 잘못된 형태의 message나 적당하지 않은 information을 contain하고 있을 경우 • Server : message의 content에 접근할 수 없을 경우 <SOAP-ENV:Fault> <SOAP-ENV:faultcode>SOAP-ENV:Server.OutOfMemory</SOAP-ENV:faultcode> </SOAP-ENV:Fault>

  18. SOAP Fault Element • Faultstring Element • Error가 발생했을 때 human-readable description을 제공 <SOAP-ENV:Fault> <SOAP-ENV:faultcode>SOAP-ENV:Server.OutOfMemory</SOAP-ENV:faultcode> <SOAP-ENV:faultstring>Out of memory.</SOAP-ENV:faultstrng> </SOAP-ENV:Fault>

  19. SOAP Fault Element • Detail element • XML payload과정에서 발생하는 error를 describe <SOAP-ENV:Fault> <SOAP-ENV:faultcode>SOAP-ENV:Client.BusinessRule.NotFound </SOAP-ENV:faulcode> <SOAP-ENV:faultstring>The resent record was not found. </SOAP-ENV:faultstring> <SOAP-ENV:detail> <error:BusinessRule xmlns:error=“http://www/invoicesystem.com/soap”> <BusinessRule>ResendNotMatched</BusinessRule> <ErrorCode>1007</ErrorCode> </error:BusinessRule> <SOAP-ENV:detail> </SOAP-ENV:Fault>

  20. Transmission Over HTTP • HTTP SOAP Request • SOAPAction • SOAP request를 위해 정의된 additional header field SOAPAction: “http://www.invoiceserver.com/soap/handler.exe#Invoice” SOAPAction: “ ” SOAPAction:

  21. Transmission Over HTTP POST / soap /Handler HTTP/1.1 Content-Type: text/xml; charset=“utf-8” Content-Length: nnnn SOAPAction: “ ” <SOAP-ENV: Envelope xmlns : SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”> <SOAP-ENV: Header> <invoice:MessageStatus xmlns:invoice=http://www.invoicesystem.com/soap SOAP-ENV:mustUnderstand=“1”> <invoice:status>Resend</invoice:status> <invoice:MessageStatus> …..

  22. Transmission Over HTTP • HTTP SOAP Response HTTP/1.1 200 OK Content-Type: text/xml; charset=“utf-8” Content-Length: nnnn <SOAP-ENV:Envelope <SOAP-ENV:Body/> </SOAP-ENV:Envelope>

  23. Transmission Over HTTP • If the Handler resource doesn’t know how to handle the MessageStatus HTTP/1.1 500 Internal Server Error Content-Type: text/xml; charset=“utf-8” Content-Length: nnnn <SOAP-ENV: Envelope xmlns : SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”> <SOAP-ENV: Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:MustUnderstand</faultcode> <faultstring>MessageStatus header not recognized</faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

More Related