w3cschool의 자료를 참고해서 SOAP의 개념에 대해 학습을 진행했다.
웬만한 한글로 된 자료보다 깔끔하게 정리가 되어 있어 부족한 영어실력을 가지고도 그럭저럭 이해할 정도는 되었다.
XML Soap
Simple Object Access Protocol
application communication protocol
format for sending and receiving messages
based on XML and W3C recommendation
Why SOAP?
impotant for web app to be able to communicate over the Internet
SOAP provides a way to comm between app running on different OS, with different Tech and Programming languages
SOAP Building Blocks
SOAP 메시지는 XML로 되어있고 이는 아래 요소를 따른다
An Envelope element that identifies the XML document as a SOAP message
A Header element that contains header info
A Body element that contains call and response info
A Fault element containing errors and status info
SOAP 봉투의 티폴트 namespace는
http://www.w3.org/2003/05/soap-envelope
SOAP 인코딩, 데이터 타입을 위한 namespace는
http://www.w3.org/2003/05/soap-encoding
Syntax Rules(문법, 구문 오류)
Must be Encoded using XML
Must use the SOAP Envelope namespace
Must use the SOAP Encoding namespace
Must Not contain DTD reference (문서형식정의?)
Must not contain XML Processing Instructions???
Skeleton SOAP Message
1 2 3 4 5 6 | <?xml version=”1.0”?> <soap:Envelope xmlns:soap=http://www.w3.org/2003/05/soap-envelope soap:encodingStyle=”http://www.w3.org/2003/05/soap-encoding” > |
/* SOAP Header Element
soap defines three attributes in the default namespace(mustUnderstand, actor, encodingStyle)
*/
1 2 3 4 5 6 | <soap:Header> <m:Trans xmlns:m=http://www.w3schools.com/transaction/ Soap:mustUnderstand=”1”>234 or Soap:actor=”URL”>234 </m:Trans> </soap:Header> |
/* SOAP Body Element
The required SOAP Body element contains the actual SOAP message intended for the ultimate endpoint of the message.
*/
1 2 3 4 5 | <soap:Body> <m:GetPrice xmlns:m=http://www.w3schools.com/prices> <m:Item>Apples</m:Item> </m:GetPrice> </soap:Body> |
à A SOAP response could look something like this
1 2 3 4 5 | <soap:Body> <m:GetPriceResponse xmlns:m=http://www.w3schools.com/prices> <m:Price>1.90</m:Price> </m:GetPriceResponse> </soap-Body> |
/* The SOAP Fault Element
The optional SOAP Fault element is used to indicate error messages
(faultcode, faultstring, faultactor, detail)
SOAP Fault Codes : VersionMisMatch, MustUnderstand, Client, Server
*/
</soap-Envelope>
The HTTP Protocol
HTTP communicates over TCP/IP.
'문돌이의 IT > JSP&Servlet' 카테고리의 다른 글
XSD Schema(XML Schema Definition) (0) | 2017.01.14 |
---|---|
XSD란? XML Schema Definition (0) | 2017.01.10 |
서블릿(servlet)과 JSP(JavaServer Pages) (0) | 2016.11.13 |
웹에서 PrintWriter의 역할 (0) | 2016.05.11 |
Apache FileUpload, IO API 설치하기 (0) | 2016.04.26 |