1 / 21

Web Service 實務

Web Service 實務. 淡江大學 IMNA 課程. Web Service 緣起. 人類→機器→代理人 主從式 架構→P2P→協同運作 語法→語意→相互作用 資料→服務 →程序. 定義 Web Service. 微軟 :「 a piece of business logic accessible via the Internet using open standards 」

keegan
Download Presentation

Web Service 實務

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. Web Service 實務 淡江大學 IMNA 課程

  2. Web Service 緣起 • 人類→機器→代理人 • 主從式架構→P2P→協同運作 • 語法→語意→相互作用 • 資料→服務→程序

  3. 定義 Web Service • 微軟:「 a piece of business logic accessible via the Internet using open standards」 • W3C:「 A set of interfaces, which provide a standard means of interoperating between different software applications, running on a variety of platforms and/or frameworks 」

  4. 架構理念

  5. 架構理念

  6. 架構理念

  7. 為什麼要使用Web Service • 比以往更能自動化地處理資料 • 企業系統中規範資訊的橋樑 • 新舊系統整合 • 上下游整合

  8. 談談XML • eXtensible Markup Language(可擴展標記語言) • 現代應用 • 安裝程式描述檔 • 系統設定檔 • Metadata • Rich Data(或稱 Rich Document) • Web Service

  9. XML範例 <RootNode> <Element Attribute=“TheAtt1”/> <Element Attribute=“TheAtt2”> <LeafNode>Hello</LeafNode> </Element> </RootNode>

  10. HTML範例 <html> <head> <title> Hello!</title> <body> <br/> </body> </html>

  11. XML V.S HTML

  12. XMLParser • XML的處理器 • 將XML文件更方便地讓我們使用 • 目前的Parser有分兩種 • DOMParser (Document Object Model) • SAX Parser(Simple API for XML)

  13. XML Parser - DOM • 將XML文件讀入記憶體中並建立“樹狀結構” • W3CXML文件處理標準 • 常用的 DOM-based parsers • Microsoft’s msxml • Sun Microsystem’s JAXP

  14. XMLParser - SAX • 以“讀取”為基礎的運作方式 • 由 XML-DEV mailing-list 成員開發 • 使用 event-basedmodel • 常用的 SAX-basedParser • Sun Microsystem’s JAXP • Xerces • MSXML 3.0-最新版本

  15. DOM vs. SAX

  16. 何時該用DOM? • 何時該用SAX?

  17. XML的文件限制 • DTD • 比XML年代還早 • XMLSchema • 限制的資料類型較DTD更多 • 使用XML語法 • 可以使用全域節點以及類型以達繼承效果

  18. DTD範例 <!DOCTYPE TVSCHEDULE [  <!ELEMENT TVSCHEDULE (CHANNEL+)><!ELEMENT CHANNEL (BANNER, DAY+)><!ELEMENT BANNER (#PCDATA)><!ELEMENT DAY ((DATE, HOLIDAY) | (DATE, PROGRAMSLOT+))+><!ELEMENT HOLIDAY (#PCDATA)><!ELEMENT DATE (#PCDATA)><!ELEMENT PROGRAMSLOT (TIME, TITLE, DESCRIPTION?)><!ELEMENT TIME (#PCDATA)><!ELEMENT TITLE (#PCDATA)> <!ELEMENT DESCRIPTION (#PCDATA)> <!ATTLIST TVSCHEDULE NAME CDATA #REQUIRED><!ATTLIST CHANNEL CHAN CDATA #REQUIRED><!ATTLIST PROGRAMSLOT VTR CDATA #IMPLIED><!ATTLIST TITLE RATING CDATA #IMPLIED><!ATTLIST TITLE LANGUAGE CDATA #IMPLIED> ]>

  19. XMLSchema範例 <?xml version="1.0"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.tec.idv.tw/name" xmlns:target="http://www.tec.idv.tw/name" elementFormDefault="qualified"> <element name="name"> <complexType> <sequence> <element name="first" type="string"/> <element name="middle" type="string"/> <element name="last" type="string"/> </sequence> <attribute name="title" type="string"/> </complexType> </element> </schema>

  20. 省思 • 是否真的要透過XML作為溝通橋梁? • 除了XML,還能用什麼? • 公司在不同環境下應使用不同決策。

  21. The End • 主講:曾彥 • 經歷: • 淡江大學IMNA22 • 國立台灣科技大學 • 信箱: • antony77@tec.idv.tw

More Related