Web Services The Next Generation of Web...
description
Transcript of Web Services The Next Generation of Web...
Web Services: The Next Generation of Web sk 1
Web ServicesThe Next Generation of Web
ขยายโอกาสและสร้�างพั�นธมิ�ตร้ทางธ�ร้ก�จด้�วยเว�บเซอร้�ว�ส
โดย นายชิ�ษณุ� ประทิ�พย�เนตร
สน�บสน�น Power Point โดยผศ . ดร . สมน�ก คี�ร�โต
ผ��ประสานงานโคีรงการ นวั�ตกรรมไอทิ� เกษตร-เนคีเทิคีผ��ชิ%วัยศาสตราจารย� ภาคีวั�ชิาวั�ศวักรรมคีอมพ�วัเตอร� ม . เกษตรศาสตร�
ผ��อ(านวัยการ ศ�นย�พ�ฒนาพาณุ�ชิย�อ�เล็+กทิรอน�กส� เนคีเทิคี
30 April 2002, Computer Center
Web Services: The Next Generation of Web sk 2
เน� อหา ความิเป็$นมิาของ Web Services การ้ท&างานของ Web Services โด้ยส�งเขป็ ส�'งท('จ&าเป็$นในการ้ใช้�งาน Web Services ป็ร้ะโยช้น�ของ Web Services ต+อการ้สร้�าง
พั�นธมิ�ตร้ ท� ง B2B, G2G และ G2B Application-to-Application (A2A)
Integration
ท�ศทางของเทคโนโลย( Web Services ในป็-จจ�บ�นและอนาคต
Web Services: The Next Generation of Web sk 3
ป็-ญหาการ้ป็ร้ะสานการ้ท&างานร้ะหว+างร้ะบบ
Interoperability ค�อข(ด้ความิสามิาร้ถในการ้ท&างานร้ะหว+างร้ะบบ
ความิแตกต+างของโป็ร้โตคอลท('ใช้�ในการ้ส�'อสาร้ ความิแตกต+างของแพัลตฟอร้�มิ
Operating Systems ความิแตกต+างของภาษาโป็ร้แกร้มิท('ใช้�
ในการ้พั�ฒนาร้ะบบ การ้ป็ร้ะสานงานไมิ+สามิาร้ถเก�ด้ข5 นได้�แบบอ�ตโนมิ�ต�
Web Services: The Next Generation of Web sk 4
ก+อนจะมิาเป็$น Web Services แร้งผล�กด้�นจากเทคโนโลย( Distributed
Processing อย+างเช้+น RPC (Remote Procedure Call) RMI (Remote Method Invocation) DCOM (Distributed Component Object
Model) CORBA (Common Object Request Broker
Architecture) J2EE (Java 2 Platform, Enterprise Edition) ความิยากในการ้ใช้�งานและความิแตกต+างในแต+ละ
โป็ร้โตคอล แร้งผล�กด้�นจากความิน�ยมิของ Internet/WWW แร้งผล�กด้�นจากการ้ยอมิร้�บในมิาตร้ฐาน XML
Web Services: The Next Generation of Web sk 5
ความิง+าย และ ว�ว�ฒนาการ้ของ Web
ย�คท(' 1 Static Web: HTML publish, request & response HTML files
ย�คท(' 2 Dynamic Web: HTML + Database
ย�คท(' 3 Web Services: A2Apublish, request & responseservices (sw components)
Web Services: The Next Generation of Web sk 6
Web Services ค�อ อะไร้ ว�ว�ฒนาการ้ก�าวถ�ด้ไป็ของ “เว�ป็แอพัพัล�เคช้�'น” มิาตร้ฐานเป็8ด้ท('ท&าให�เร้าสามิาร้ถ “ป็ร้ะกาศ”
(Publish) ว+ามิ( “บร้�การ้” (Services หร้�อ ก�อนโป็ร้แกร้มิท('ท&างานบร้�การ้บางอย+าง - Software Components) และ“เว�ป็แอพัพัล�เคช้�'น” อ�'นสามิาร้ถเข�าไป็ส�บค�น และ เร้(ยกใช้�บร้�การ้จากก�อนโป็ร้แกร้มิน� นได้� SW Components can discover other SW
components and conduct business transactions.
Application-to-Application Interoperability (through the webs)
Web Services: The Next Generation of Web sk 7
A2A Interoperability*
ต�วอย+างเหต�การ้ณ์� ท('มิ( Interoperability เต�มิร้;ป็แบบ(ย�งไมิ+เป็$นความิจร้�งในป็-จจ�บ�น)
“นาย ก” น�ด้หมิอผ+านเว�ป็ ร้ะบบท&าการ้ตร้วจตาร้างเวลาว+างของหมิอ และ ของคนไข� แล�วจองเวลาลงในร้ะบบป็ฏิ�ท�นท� งของคนไข� และ ของหมิอ
เมิ�'อถ5งว�นน�ด้หมิอขอเล�'อนเวลา ข�อมิ;ลการ้เล�'อนเวลา และเวลาน�ด้ใหมิ+ถ;กส+งไป็ท('โทร้ศ�พัท�มิ�อถ�อของคนไข�โด้ยอ�ตโนมิ�ต�
ก+อนพับหมิอ ร้ะบบท&าการ้เช้�'อมิโยงไป็หาร้ะบบป็ร้ะก�นส�ขภาพัเพั�'อขอด้;เง�'อนไขการ้ป็ร้ะก�น
เมิ�'อหมิอส�'งยา ข�อมิ;ลยา ถ;กส+งไป็ด้&าเน�นการ้ส�'งยาท('ร้�านยาและ ต�ด้บ�ญช้(ท('ธนาคาร้โด้ยอ�ตโนมิ�ต�
* คีวัามสามารถในการเร�ยกใชิ�งานโปรแกรมระหวั%างระบบทิ�0ม�คีวัามแตกต%างก�น
Web Services: The Next Generation of Web sk 8
C2WA2W2W2A Integration
Web ServerSingle Point of Services
Web Server
Web Server
Legacy Systems
Application Server
Database Server
อ�นเทิอร�เน+ต
ผ��ใชิ� ใชิ�บราวัเซอร�แล็ะเข้�าส�%บร�การจากเวั+ปไซต�เด�ยวั หร3อOne Stop Service
แต%ได�ร�บบร�การมาจากหล็ายทิ�0
Application Server
Database Server
Web Services: The Next Generation of Web sk 9
แร้งจ;งใจ Applications-to-Applications Integration
การ้เช้�'อมิโยงร้ะบบสาร้สนเทศภายในองค�กร้Enterprise Application Integration (EAI) การ้เช้�'อมิโยงร้ะบบสาร้สนเทศท('มิ(ความิหลากหลายภายในองค�กร้
ร้ะบบร้�ฐบาลอ�เล�กทร้อน�กส� e-Government ร้ะบบการ้ให�บร้�การ้ป็ร้ะช้าช้นจากจ�ด้เด้(ยว e-Citizen (G2G2C) ร้ะบบการ้จ�ด้ซ� อจ�ด้จ�างทางอ�เล�กทร้อน�กส� (G2B e-Procurement)
ร้ะบบธ�ร้ก�จผ+านส�'ออ�เล�กทร้อน�กส� e-Business การ้เช้�'อมิโยงร้ะบบสาร้สนเทศของบร้�ษ�ทผ;�ซ� อ ก�บ บร้�ษ�ทผ;�ขาย B2B e-Marketplace e-Supply Chain Management
Web Services: The Next Generation of Web sk 10
Interoperability
Data Interoperability + Process Interoperability
ข(ด้ความิสามิาร้ถในการ้ท&างานข�ามิร้ะบบได้� โด้ยใช้�มิาตร้ฐานกลางทางเทคน�คท('ท&าให�เก�ด้การ้แลกเป็ล('ยน ข�อมิ;ล และ เร้(ยกใช้�งาน โป็ร้แกร้มิ ข�ามิร้ะบบท('มิ(ความิแตกต+างก�นท� ง ฮาร้�ด้แวร้� และ ซอฟต�แวร้�
Web Services: The Next Generation of Web sk 11
แนวทางของ Web Services
For data interoperability: XML For process interoperability:
SOAP For services publication & discovery: UDDI Web services description language: WSDL Web Services Flow Language: WSFL
e-Business XML/Next Generation EDI: ebXML
Web Services: The Next Generation of Web sk 12
Service-Oriented Architecture (SOA)
Web Services: The Next Generation of Web sk 13
XML – eXtensible Markup Language
Markup Language ท('ผ;�ใช้�สามิาร้ถก&าหนด้ tags ท('ใช้+ส�'อความิหมิายของเน� อหา และ ก&าหนด้โคร้งสร้�างของเอกสาร้
ข�อมิ;ลท('มิ(โคร้งสร้�างน( จะถ;กน&าไป็ป็ร้ะมิวลผลต+ออย+างอ�ตโนมิ�ต�ได้�ง+าย
Web Services: The Next Generation of Web sk 14
ต�วอย+าง XML Purchase Order
ระบบสารสนเทิศข้อง บร�ษ�ทิผ��ซ34อ
ต�องการเชิ30อมโยงก�บระบบสารสนเทิศข้อง บร�ษ�ทิผ��ข้ายเชิ%น ระบบข้�อม�ล็สต+อก
Web Services: The Next Generation of Web sk 15
ก&าเน�ด้มิาตร้ฐาน SOAP
Simple Object Access Protocol เป็$นมิาตร้ฐานของเทคโนโลย( Distributed
Objects แบบหน5'ง ส+งข�อมิ;ลผ+าน Internet/Web ในร้;ป็แบบของ
XML ง+ายในการ้ใช้�งานด้�วย Request/Response
HTTP Protocol
Web Services: The Next Generation of Web sk 16
SOAP Services
SOAP – an XML-based protocol ท('ท&าให�เร้(ยกโป็ร้แกร้มิผ+านทาง HTTP/Web Server ได้�Remote Procedure Call ผ+านทาง Web
ท&าให�เก�ด้เร้(ยกใช้�โป็ร้แกร้มิ (Software Components) ข�ามิร้ะบบได้�Web Consortium (W3C) Support
Web Services: The Next Generation of Web sk 17
SOAP Architecture
Web Services: The Next Generation of Web sk 18
ต�วอย+าง SOAP Request ส�'งซ� อส�นค�าPOST /Order HTTP/1.1 Host: www.northwindtraders.com Content-Type: text/xml Content-Length: nnnnSOAPAction: "urn:northwindtraders.com:PO#UpdatePO"
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema/instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope" xsi:schemaLocation= "http://www.northwindtraders.com/schemas/NPOSchema.xsd"> <SOAP-ENV:Header xsi:type="Transaction"> <transactionID mustUnderstand="1"> 10000000 </transactionID> </SOAP-ENV:Header> <SOAP-ENV:Body xsi:type="NorthwindBody"> <UpdatePO> <orderID>0</orderID> <customerNumber>999</customerNumber> <item>89</item> <quantity>3000</quantity> <return>0</return> </UpdatePO> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Web Services: The Next Generation of Web sk 19
Web Services ข� นพั� นฐาน = XML + SOAP
Application
Web browser
SOAP
GatewayCenter Server
GDI Data
Servlet
SOAP
SOAP
Gateway
Legacy Data
Application
HTTP /HTTPS
HTML
HTTP /HTTPS
SOAP
HTTP /HTTPS
GovernmGovernmentent
DataDataExchangExchang
ee(GDX)(GDX)
ต�วอย+างโคร้งการ้ e-Government Data Exchange
Web Services: The Next Generation of Web sk 20
Government Data Infrastructure
Web Services: The Next Generation of Web sk 21
Business-to-Business
Oracle
PeopleSoft
DB2
Website
Loans
Credit
Auto
Mortgage
CRM
PhoneBanking
Branches
B2B Integration
Inventory
Suppliers
OnlineExchange
B2B Spending: At least $26 Billion in 2000
B2B allows interoperability beyond the firewall, between a smallnumber of internal enterprise applications and a small number ofexternal applications and companies (e.g. online exchanges).
Web Services: The Next Generation of Web sk 22
Web Services
Web Services Spending: $25 Million in 2000$250 Million in 2001$5 billion in 2004
Industry State: Young
CreditCard Co.
(CheckFree)
Oracle
PeopleSoft
DB2
Website
Loans
Credit
Auto
Mortgage
CRM
PhoneBanking
Branches
Any-thing-to-AnythingWeb Services Integration
Inventory
AffiliateBanks
Government
Partners
Web services allows anything-to-anything interoperability between both internal and external systems.
Self-ServiceApplications
On-PremiseLocations
OnlineExchange
MortgageBrokers
Suppliers
CreditAgencies
Web Services: The Next Generation of Web sk 23
ต�วอย+างการ้ป็ร้ะย�กต� Web Services
Web Services: The Next Generation of Web sk 24
The Standards
Web Services: The Next Generation of Web sk 25
The Big Picture
Web Services: The Next Generation of Web sk 26
UDDI ค�อ อะไร้ UDDI ย+อมิาจาก Universal
Description, Discovery and Integration
น&าเสนอโด้ยหลายบร้�ษ�ทเช้+น Ariba, Microsoft, IBM, etc.
บอกให�ทร้าบว+าบร้�ษ�ทมิ(ผล�ตภ�ณ์ฑ์�และบร้�การ้อะไร้บ�าง
สามิาร้ถต�ด้ต+อขอด้&าเน�นธ�ร้ก�จการ้ค�าก�บบร้�ษ�ทได้�โด้ยอ�ตโนมิ�ต�โด้ยผ+านทาง Web Services
Web Services: The Next Generation of Web sk 27
WSDL ค�อ อะไร้ WSDL ย+อมิาจาก Web Services
Description Language WSDL ค�อค;+มิ�อให�ก�บร้ะบบ เพั�'อเร้(ยนร้;�ว�ธ(การ้
เร้(ยกใช้�งาน Web Services ท('ต�องการ้ WSDL เข(ยนข5 นตามิแบบมิาตร้ฐาน XML
Web Services: The Next Generation of Web sk 28
ความิป็ลอด้ภ�ยในการ้ใช้�งาน Web Services
เน�'องจากท&างานอย;+บน Internet ซ5'งป็-จจ�บ�นมิ(เทคโนโลย(ในการ้ร้�กษาความิป็ลอด้ภ�ยมิากมิายร้องร้�บอย;+แล�ว
Web Services สามิาร้ถว�'งผ+าน Firewall ได้�เน�'องจาก SOAP ถ;กส+งโด้ยผ+านโป็ร้โตคอล HTTP
ร้ะบบร้�กษาความิป็ลอด้ภ�ยตามิมิาตร้ฐานของ PKI (Public Key Infrastructure) เช้+น MD5 (Message Digest), SSL (Secure Socket Layer) และ PGP (Pretty Good Privacy)
Web Services: The Next Generation of Web sk 29
ป็ร้ะโยช้น�ของ Web Services ต+อการ้ด้&าเน�นธ�ร้ก�จการ้ค�า
พั�นธมิ�ตร้ทางการ้ค�าสามิาร้ถเก�ด้ข5 นได้�ตลอด้เวลา โด้ยการ้ค�นหาจาก UDDI
การ้ด้&าเน�นธ�ร้ก�จการ้ค�าและบร้�การ้สามิาร้ถเป็$นไป็ได้�แบบอ�ตโนมิ�ต�ในร้ะด้�บของ Application to Application (A2A) โด้ยการ้แลกเป็ล('ยนข�อมิ;ลผ+านทาง Web Services
Web Services สามิาร้ถใช้�เป็$นส+วนหน5'งในการ้ด้&าเน�นธ�ร้ก�จตามิเฟร้มิเว�ร้�คของ ebXML
ง+ายต+อการ้น&าไป็ใช้�งานเน�'องจากในป็-จจ�บ�นมิ(เคร้�'องมิ�อมิากมิายท('ใช้�ช้+วยเหล�อในการ้พั�ฒนา Web Services
ลด้ต�นท�นในการ้พั�ฒนาร้ะบบบางอย+างท('ไมิ+จ&าเป็$นโด้ยขอบร้�การ้จาก Web Services ของพั�นธมิ�ตร้ทางการ้ค�า
Web Services: The Next Generation of Web sk 30
เคร้�'องมิ�อท('ใช้�ในการ้พั�ฒนา Web Services
Web Services เป็$นมิาตร้ฐานท('ง+ายต+อการ้พั�ฒนาเน�'องจากอย;+ในร้;ป็แบบของข�อมิ;ลต�วอ�กษร้
มิ(ช้�ด้เคร้�'องมิ�อท('สน�บสน�นโด้ย Microsoft ตามิแพัลตฟอร้�มิของ Microsoft .NET Framework
มิ(ช้�ด้เคร้�'องมิ�อท('สน�บสน�นโด้ย Sun Microsystem ตามิแพัลตฟอร้�มิของ Sun ONE (Sun Open Net Environment)
มิ(ช้�ด้เคร้�'องมิ�อท('สน�บสน�นโด้ย IBM เช้+น Web Services Toolkit
เคร้�'องมิ�ออ�'นๆท('สน�บสน�น SOAP, XML ท� งท('เป็$น Commercial Product และ Open Source
Web Services: The Next Generation of Web sk 31
Web Services ในป็-จจ�บ�นและอนาคต เป็$นท('ยอมิร้�บในร้ะด้�บโลก จากหลายๆหน+วยงานและองค�กร้ มิ(การ้ใช้�งานก�นอย+างกว�างขวางและถ;กใช้�เป็$นโคร้งสร้�าง
พั� นฐานส&าหร้�บการ้ป็ร้ะสานงานข�ามิร้ะบบ มิ(บร้�การ้หลากหลายให�เล�อกใช้� (สนใจด้;ต�วอย+างได้�จาก
xmethods.net และ salcentral.com) เป็$นเคร้�'องมิ�อส&าหร้�บการ้ด้&าเน�นธ�ร้ก�จออนไลน� อ(กหลายอย+าง
เช้+น E-Commerce, E-Business, E-Learning, E-Government, etc.
แนวทางการ้ใช้�งานในป็ร้ะเทศไทยเช้+น โคร้งการ้โคร้งสร้�างพั� นฐานสาร้สนเทศภาคร้�ฐ (Government Data Infrastructure)
Web Services: The Next Generation of Web sk 32
สร้�ป็สาร้ะส&าค�ญท('เก('ยวก�บ Web Services
การ้ใช้� Web Services เพั�'อท&าให�เก�ด้ Interoperability
การ้ใช้� Web Services และ UDDI เพั�'อด้&าเน�นธ�ร้ก�จการ้ค�า
การ้ร้�กษาความิป็ลอด้ภ�ยของข�อมิ;ลส&าหร้�บ Web Services
ข�อด้(และข�อเส(ยของ Web Services ป็ร้ะโยช้น�ของ Web Services ต+อการ้พั�ฒนา
ป็ร้ะเทศ ความิเป็$นไป็ของ Web Services ในป็-จจ�บ�นและ
อนาคต
Web Services: The Next Generation of Web sk 33
Web Services Alliance
Web Services Interoperability Organization (WS-I)
IBM, Microsoft, Intel, HP, SAP, BEA Systems, Accenture, etc.
Mission Ensuring interoperability among different
vendorsAction Plans To develop Tools for testing software
conformance to WS standards: SOAP, WSDL, UDDI
To publish an architectural road map
Web Services: The Next Generation of Web sk 34
สร้�ป็ 2002 ป็@แห+ง “Web Services”
บร้�ษ�ทช้� นน&าด้�านไอท( ผล�กด้�นโซล;ช้�'นด้�าน Web Services, เช้+น IBM – Software Infrastructure Sun – Services on Demand, Sun One Microsoft – Web Services, Microsoft .NET
คล�'นล;กถ�ด้ไป็ของเว�ป็ จากการ้แลกไฟล� HTML ร้ะหว+าง เว�ป็เซ�ร้�ฟเวอร้� มิาเป็$นการ้แลก “บร้�การ้” (ก�อนโป็ร้แกร้มิ Software
Components ) ร้ะหว+างร้ะบบสาร้สนเทศ โด้ยว�'งผ+านเว�ป็เซ�ร้�ฟเวอร้� ป็ร้ะโยช้น�
เช้�'อมิร้ะบบสาร้สนเทศภายในองค�กร้ การ้ป็ฏิ�บ�ต�การ้อย+างมิ(ป็ร้ะส�ทธ�ภาพั การ้กร้ะจายโป็ร้แกร้มิบร้�การ้ การ้น&าโป็ร้แกร้มิท('พั�ฒนาแล�วมิาใช้�งานใหมิ+
Web Services: The Next Generation of Web sk 35
ResourcesWeb Services IBM’s Web Services: http://www.alphaworkers.ibm.com/
webservices Microsoft’s Web Services: http://msdn.microsoft.com/
webservices IBM’s Web Services tool kit:
http://www.alphaworks.ibm.com/tech/webservicestoolkitSOAP SOAP specification: http://www.w3.org/TR/SOAP Apache’s SOAP toolkit: http://xml.apache.org/soap/index.html Microsoft;s SOAP resources, http://msdn.mircosoft.com//soapUDDI UDDI Specification: http://www.uddi.org Microsoft’s UDDI resources: http://msdn.microsoft.com/uddi IBM’s UDDI resource:
http://www.alphaworks.ibm.com/tech/UDDIregWSDL WSDL Specification: http://www.w3.org/TR/wsdl
Web Services: The Next Generation of Web sk 36
Resources & References XML Industry: http://xml.coverpages.org XML Namespaces: http://jclark.com/xml/xmlns.htm W3C’s Web Distributed Data Exchange:
http://www.wddx.org Microsoft’s .NET: http://www.microsoft.com/net Cobol Resources: (integrating Cobol into Web-based
applications) http://www.cobolreport.com ebXML: (United Nations Center for Trade Facilitation
and e-Business & OASIS) http://www.ebxml.org News: “High Tech Leader form Web Services Alliance”
http://www.commweb.com/article/IWK20020205S0010