2007/10/30 최석훈. 목차 I. Distributed System II. SOAP 의 장점 III. SOAP 메시지 구조 I. Envelope II. Header III. Body IV. SOAP 예제 – 달력 얻기 I. SOAP server II. SOAP client.

Slides:



Advertisements
Similar presentations
Introduction to Web Services
Advertisements

Web Services Using SOAP, WSDL, and UDDI
Siebel Web Services Siebel Web Services March, From
Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
Web Services Core Technologies
Presentation 7 part 2: SOAP & WSDL.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
Simple Object Access Protocol (SOAP) v1.1 CS-328 Dick Steflik.
Introduction to Computing Using Python CSC Winter 2013 Week 8: WWW and Search  World Wide Web  Python Modules for WWW  Web Crawling  Thursday:
PHP syntax basics. Personal Home Page This is a Hypertext processor It works on the server side It demands a Web-server to be installed.
SOAP & Security IEEE Computer Society Utah Chapter Hilarie Orman - Purple Streak Development Tolga Acar - Novell, Inc. October 24, 2002.
Apache Axis2 SOAP Primer. Agenda What is SOAP? Characteristics SOAP message structure Header blocks Fault notification Exercises.
SOAP : Simple Object Access Protocol
SOAP Overview Simple Object Access Protocol CSCI Topics in Software Engineering Web Infrastructure, Services, and Applications
CIS 375—Web App Dev II SOAP.
Lecture 10: Web Services. Outline Overview of Web Services SOAP (messaging) WSDL (service description) UDDI (registry)
XML in the real world (2) SOAP. What is SOAP? ► SOAP stands for Simple Object Access Protocol ► SOAP is a communication protocol ► SOAP is for communication.
SOAP SOAP is a protocol for accessing a Web Service. SOAP stands for Simple Object Access Protocol * SOAP is a communication protocol * SOAP is for communication.
Topics Acronyms in Action SOAP 6 November 2008 CIS 340.
Information Management NTU Web Services. Information Management NTU What Are Web Services? Semantically encapsulate discrete functionality Loosely coupled,
Service-Oriented Architecture INF 123 – Software architecture 1.
SE 370: Programming Web Services Week 4: SOAP & NetBeans Copyright © Steven W. Johnson February 1, 2013.
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
SOAP Lee Jong-uk. Introduction What is SOAP? The features of SOAP The structure of SOAP SOAP exchange message model & message Examples of SOAP.
SOAP Quang Vinh Pham Simon De Baets Université Libre de Bruxelles1.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
SOAP Chandra Dutt Yarlagadda Introduction  Why ?  What ?  How ?  Security Issues in SOAP  Advantages  Uses  Conclusion.
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
TP2653 Adv Web Programming SOAP and WSDL. SOAP Simple Object Access Protocol – Lightweight XML-based messaging protocol – A protocol for accessing a Web.
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
HANNAM UNIVERSITY 1 Chapter 24 Hypertext Transfer Protocol (HTTP)
SOAP Tutorial Ching-Long Yeh 葉慶隆 Department of Computer Science and Engineering Tatung University
Web Services (SOAP, WSDL, and UDDI)
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
Copyright © 2013 Curt Hill SOAP Protocol for exchanging data and Enabling Web Services.
1 Web Services Web and Database Management System.
Simple Object Access Protocol. Web Services: SOAP2 Why Simple Object Access Protocol Light weight replacement for complicated distributed object technology.
Kemal Baykal Rasim Ismayilov
Web Services, SOAP and Java Derek Munneke AJUG / ACS Java SIG November 2001.
SOAP Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,
Introduction to Web Services Presented by Sarath Chandra Dorbala.
Lecture VI: SOAP-based Web Service CS 4593 Cloud-Oriented Big Data and Software Engineering.
SOAP, Web Service, WSDL Week 14 Web site:
Content from Python Docs.
The Hypertext Transfer Protocol
Sabri Kızanlık Ural Emekçi
Hypertext Transfer Protocol
HTTP Protocol.
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
Uniform Resource Locators
WEB API.
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
HTTP Hypertext Transfer Protocol
Hypertext Transfer Protocol
HTTP Request Method URL Protocol Version GET /index.html HTTP/1.1
Hypertext Transfer Protocol
Uniform Resource Locators (URLs)
HyperText Transfer Protocol
William Stallings Data and Computer Communications
Hypertext Transfer Protocol
Uniform Resource Locators
HTTP Hypertext Transfer Protocol
Uniform Resource Locators (URLs)
Hypertext Transfer Protocol
SOAP Routing and Processing Concepts
Presentation transcript:

2007/10/30 최석훈

목차 I. Distributed System II. SOAP 의 장점 III. SOAP 메시지 구조 I. Envelope II. Header III. Body IV. SOAP 예제 – 달력 얻기 I. SOAP server II. SOAP client III. Fault element

Distributed System JAVA RMI CORBA DCOM 특정 포트 사용으로 방화벽에서 차단될 수 있음 일반적으로 위 기술 간 호출 불가능 특정 포트 사용으로 방화벽에서 차단될 수 있음 일반적으로 위 기술 간 호출 불가능 여러 서버에 분산된 컴포넌트간 상호 호출 가능

SOAP 의 장점 플랫폼 독립적 인간 친화적 플랫폼 및 언어에 종속되지 않고 쉽게 구현 및 사용 가능 방화벽 등의 방해 없이 거의 모든 시스템과 통신 가능 비동기식 처리로 한 방향 액션 ( 퍼블리싱 등 ) 처리 유용 XML 기반 SMTP 사용 HTTP 사용

SOAP 메시지 구조 … …

Envelope

Envelope element 루트 엘리먼트 SOAP 메시지의 네임스페이스를 지정 encodingStyle attribute 어떤 식으로 메시지를 구성할 것인지 명시

Header

Header element Header 의 사용은 선택 사항 SOAP 메시지를 받는 쪽에서 이를 어떻게 처리할 것 인지를 기술 여러 개의 자식 엘리먼트를 포함할 수 있음 받는 쪽에서는 해석 가능한 Header 의 자식 엘리먼트만 해석해 수행 mustUnderstand 속성이 1 로 설정되어 있으면 반드시 해석해야 하고, 못하면 에러를 발생해야 함

Header element actor attribute (role attribute in SOAP 1.2) 해당 헤더를 어떤 수신자가 처리할 것인지 기술 <au:Authentication xmlns:au=" en:actor=" en:mustUnderstand="1"> foo 1q2w3e … Gildong, Hong. …

Body

Body element 메시지 수신자에게 전달되어야 할 목적 정보 프로시저 요청 / 실행 결과 / 에러 등을 포함 최종 수신자가 정의한 네임스페이스를 써서 기술 WSDL SOAP:Body …

SOAP 예제 – 달력 얻기

SOAP 서버 1. #!/usr/bin/env python import sys, calendar #Import the SOAP.py machinery 6. from SOAPpy import SOAP CAL_NS = " class Calendar: 11. def getMonth(self, year, month): 12. return calendar.month(year, month) def getYear(self, year): 15. return calendar.calendar(year) server = SOAP.SOAPServer(("localhost", 8080)) 18. cal = Calendar() 19. server.registerObject(cal, CAL_NS) print "Starting server..." 22. server.serve_forever()

SOAP 클라이언트 1. import sys, httplib SERVER_ADDR = ' ' 4. SERVER_PORT = CAL_NS = " BODY_TEMPLATE = """<SOAP-ENV:Envelope 8. xmlns:SOAP-ENV=" 9. xmlns:s=" 10. xmlns:xsi=" 11. xmlns:xsd=" 12. SOAP-ENV:encodingStyle=" %s 16. %s """

SOAP 클라이언트 ( 계속 ) 20. def GetMonth(): 21. year = month = body = BODY_TEMPLATE % (year, month) blen = len(body) 26. requestor = httplib.HTTP(SERVER_ADDR, SERVER_PORT) 27. requestor.putrequest("POST", "cal-server") 28. requestor.putheader("Host", SERVER_ADDR) 29. requestor.putheader("Content-Type", "text/plain; charset=\"utf-8\"") 30. requestor.putheader("Content-Length", str(blen)) 31. requestor.putheader("SOAPAction", " 32. requestor.endheaders() print 'SENDED MESSAGE---' 35. print body 36. print ' \n' requestor.send(body)

SOAP 클라이언트 ( 계속 )

HTTP headers Accept Specifies which Internet media types are acceptable Content-Length Indicates the size (in octets) of the entity-body Content-Type Specifies the Internet media type of the entity-body Host Specifies the Internet host and port number User-Agent Contains information about the user agent (client) SOAPAction URI or empty string("") or NULL

SOAP 클라이언트 ( 계속 ) 20. def GetMonth(): 21. year = month = body = BODY_TEMPLATE % (year, month) blen = len(body) 26. requestor = httplib.HTTP(SERVER_ADDR, SERVER_PORT) 27. requestor.putrequest("POST", "cal-server") 28. requestor.putheader("Host", SERVER_ADDR) 29. requestor.putheader("Content-Type", "text/xml; charset=\"utf-8\"") 30. requestor.putheader("Content-Length", str(blen)) 31. requestor.putheader("SOAPAction", " 32. requestor.endheaders() print 'SENDED MESSAGE---' 35. print body 36. print ' \n' requestor.send(body)

SOAP 클라이언트 ( 계속 ) 39. (status_code, message, reply_headers) = requestor.getreply() reply_body = requestor.getfile().read() print 'RECEIVED MESSAGE---' 44. print "status code:", status_code 45. print "status message:", message 46. print "HTTP reply header:" 47. for header in reply_headers.headers: 48. print header, 49. print "HTTP reply body:\n", reply_body 50. print ' ' if __name__ == "__main__": 53. GetMonth()

HTTP status code Successful 2xx 200 – OK / 204 – No Content Redirection 3xx 301 – Moved Permanently / 302 – Found Client Error 4xx 400 – Bad Request / 403 – Forbidden / 404 – Not Found Server Error 5xx 500 – Internal Server Error / 503 – Service Unavailable

SOAP 클라이언트 ( 계속 )

Fault

Fault element SOAP 메시지 처리 때 생기는 에러 정보를 처리 엘리먼트 안에 하나만 나타날 수 있음 다음 엘리먼트를 가질 수 있음 - 오류 코드 - 오류 설명 - 누가 오류를 발생시켰는지에 대한 정보 - 오류에 대한 자세한 설명

SOAP fault

Reference / Q&A 석광진 외 역, 자바를 이용한 웹 서비스 구축. 안진만 역,.NET XML 웹 서비스. 김종민 외 저, POWER XML. 송은지 외 저, 웹 서비스 컴퓨팅. Quick reference to HTTP headers The Python Web services developer: Python SOAP l ibraries The Python Web services developer: Python SOAP l ibraries SOAP Version 1.2 Part 1: Messaging Framework (S econd Edition) SOAP Version 1.2 Part 1: Messaging Framework (S econd Edition) images from gettyimages RF sectiongettyimages