以協作意願與資訊來源管道探究大學生個人差異及其小組報告之協作資訊尋求 … · 關鍵字: 資訊行為、協作資訊尋求行為、大學生、個人差異、人格特質
.NET 資訊能源
description
Transcript of .NET 資訊能源
任何一種珍貴能源均必須經過長久的融合過程才能形成。而此數位資訊能源可以在短短的幾年內,便能從融合到釋放它的能量到世界上的每一個角落,它的威力足以帶領我們迎接更具挑戰性的二十一世紀。
主講者:陳松林主講者:陳松林課程服務 : www.cmt.com.tw (中美通 )
技術支援 : www.xteacher.net (Dr.X)
.NET 資訊能源
何謂 .NET 資訊能源
資訊能源的原力( XML,Web Service,…)
數位的資料,透過 XML 描述系統,可有效的轉換成資訊,這樣的資訊可利用Web 服務機置,湧入 e世代的世界中。
資訊能源的應用( HTML,DHTML,Element Behavior,..)
不論您使用何種前端資訊裝置 (PDA 、 WAP、瀏覽器 ),均可接收 .NET 資訊,目前最強力的展示機置,莫過於瀏覽器 (Internet Explorer 5.5),結合 HTML、 DHTML 及前端資訊交換器 (Element Behavior) ,以滿足任何在 .NET 世代的應用需求。
資訊能源的交換( SOAP,XMLHTTP,WebDAV,…)
由 XML精煉出的資訊,可輕易的在新一代的資訊交換通道,執行資訊傳遞及處理。
任何時間,任何地點,任何裝置任何時間,任何地點,任何裝置應用應用 .NET .NET 資訊能源資訊能源
任何時間,任何地點,任何裝置任何時間,任何地點,任何裝置應用應用 .NET .NET 資訊能源資訊能源
<html><head><title>留言板試範 </title><meta http-equiv="Content-Type" content="text/html; charset=big5"><style> form{behavior:url(formmail.htc)}</style></head><body><h3>大呆留言板 </h3><!--以下是表單 --><FORM drxmail="[email protected]" drxtype="text">留言日期 :<INPUT TYPE="text" name="txtdate" value=""><br>您的名字 :<INPUT TYPE="text" name="txtName" value=""><br>電子郵件 :<input type=text name="email" size=22 maxlength=50 value=""><br>
性 別 :<SELECT name="sex"> <OPTION VALUE="m">紳士 <OPTION VALUE="w">淑女 </SELECT><br><br><br>足跡內容 :<br><textarea name="comments" rows="6" COLS="49" WRAP=HARD></textarea><br><br><input type="submit" value="確定送出 " ><input type="reset" value="清除重來 " > </form></body></html>
標籤服務範例
.NET 資訊能源的核心元件
Visual Studio.NET,Visual Studio.NET,.NET Framework.NET Framework
.NET Enterprise .NET Enterprise ServersServers
.NET Building Block .NET Building Block ServicesServices
.NET Devices, .NET Devices, User ExperienceUser Experience
.NET 資訊能源的系統架構
Internet
ISA Server 2000
Windows .NET
.NET Enterprise Servers
Visual Studio .NET
.NET Framework
防火牆
.NE
T F
ram
ewo
rks
.NE
T F
ram
ewo
rks
Common Language RuntimeCommon Language Runtime
Base class librariesBase class libraries
Win
Fo
rms
Win
Fo
rms
Data, Web ConnectivityData, Web Connectivity
AS
P.N
ET
AS
P.N
ET
Ser
vice
sS
ervi
ces
.NET Frameworks 開發架構
AS
P.N
ET
AS
P.N
ET
Web
Fo
rms
Web
Fo
rms
ASP.NET 開發架構架構模式
網站應用系統 (Web Applications)Web Forms
網站服務 (Web Services)XMLHttp,SOAP
架構支援
Cache ServicesSecurityTracingLocalization
.NET 資訊工作站
程式架構
Scripting Engine
DocumentObjectModel
<html><head> 程式執行設定</head><style> 畫面特效</style><script> 程式執行</script><body> 程式畫面</body></html>
ActiveX Object
Cascading style sheets
Element Behavior
DHTML Behavior
程式畫面的設計<html><style>.line {border-bottom:2 ridge black}table {position:absolute}body {background-color:lime;margin-left:2;margin-top:2}#master button {border:2 groove blue;background-color:lightblue;color:brown;width:50;height:30;margin-left:2px}#pn {color:red;filter:glow(Color=blue,Strength=2);width:200;}</style><body><table border=0 width="600" height="400" cellspacing="0" cellpadding="0"> <tr align=left width="100%" height="8%" > <td class="line"> <label id="pn">千禧網頁應用系統 </label> <label style="position:relative;left:300;width:auto"> 版本 1.0</label> </td></tr> <tr width="100%" height="10%"> <td id="master"> <button title="Add Record">進貨單 </button> <button title="Delete Record">出貨單 </button> <button title="Query Record">報廢單 </button> </td></tr> <tr height="70%" > <td width="100%" > <iframe id=myiframe width=100% height=100% frameborder="no" allowtransparency="true" scrolling=no src="form.htm"></iframe> </td></tr></table></body></html>
.NET 資訊工作站
JScript 與應用物件<html><script>function dosave(){ var rec=""; rec=rec+"%"+uname.value+"%,%"+subject.value+"%,%"+email.value+"%,%"+data.value+"%"; var fs=new ActiveXObject("Scripting.FileSystemObject"); if (fs.FileExists("c:\\aa.txt")==false) { var b=fs.CreateTextFile("c:\\aa.txt",true); b.writeLine("%Name%,%Subject%,%Email%,%Data%"); b.close();} var a=fs.OpenTextFile("c:\\aa.txt",8,true); a.WriteLine(rec); a.close();}</script> <body> <div align="center"><center> <table border="2" width="65%" height="1" cellspacing="0" cellpadding="2"> <tr><td width="100%"><font color="#800000">您的名字 </font></td></tr> <tr><td width="100%"><input type="text" size="10" name="uname"></td></tr> <tr><td width="100%"><font color="#800000">留言主題 </font></td></tr> <tr><td width="100%"><input type="text" size="50" name="subject"></td></tr> <tr><td width="100%"><font color="#800000">E-Mail</font></td></tr> <tr><td width="100%"><input type="text" size="50" name="email"></td></tr> <tr><td width="100%"><font color="#800000"> 訊息 ( 最多 250 字元 )</font></td></tr> <tr> <td width="100%"><input type="textarea" size="50,5" maxlength="250" name="data"></td> </tr> </table></center></div> <div align="center"><button id=save onclick="dosave()">儲存 </button></div> </div></body></html>
.NET 資訊工作站
程式動態資訊處理<HTML><BODY onclick="wasClicked()"><H1>Welcome!</H1><P>This is a very <B>short</B> document.<SCRIPT LANGUAGE="JavaScript">function wasClicked() { alert("I was clicked " + window.event.srcElement.tagName);}</SCRIPT></BODY></HTML>
H1
B
P
Body
onClick
.NET 資訊工作站
程式動態資訊處理<style>label {writing-mode:tb-rl;vertical-align:top;}input {writing-mode:tb-rl;behavior:url("document.htc")}textarea {overflow:hidden;writing-mode:tb-rl;behavior:url("document.htc")}</style>
<body> <textarea rows=6 tabindex="2" onblur="a.focus()"></textarea><label>內文 </label> <input type=text id=a tabindex="1" ><label>收文者 </label></body>
.NET 資訊工作站
標籤元件製作 (展示與程式分離 )
<html xmlns:drx><head><?IMPORT namespace="drx" implementation="xdate.htc"></head><body><drx:xdate/></body></html>
<public:component tagname="xdate" lightweight=true><public:attach event="oncontentready" onevent="doit()"/><script>function doit(){ var oDate=new Date();
var sYear=oDate.getYear();var sMonth=oDate.getMonth() + "";var sDay=oDate.getDay() + "";element.innerText=sYear + ":" + sMonth + ":" + sDay;
}</script></public:component>
.NET 資訊工作站
.NET 資訊能源的原力 資料 (Data描述語言 )
XML的全名是 eXtensible Markup Language。主要的目的是要將資料( Data)根據 XML標準轉換成使用者與電腦皆能詮譯的資訊( Information),以下是利用 XML標準將資料( Data)轉換成資訊( Information)範例:
<H1>Alley gator</H1>
<H2>515-5551235</H2>
<H2>Main St</H2>
<Contact_information>
<name>Alley gator</name>
<Phone>5155551235</phone>
<Address>Main St</Address>
</Contact_information>
.NET 資訊能源的原力資訊與程式分離
<?xml version="1.0" encoding="big5"?>
< 企業資源管理 系統代號 ="xchen">
< 組織管理 功能代號 ="source" 部門 ="*" 職等 ="*">
< 組織作業 代號 ="s:console/ou.htm" 部門 ="*" 職等 ="*"/>
</組織管理 >
< 人員管理 功能代號 ="adsi" 部門 ="*" 職等 ="*">
< 人員新增 代號 ="s:console/first.htm" 部門 ="*" 職等 ="*"/>
< 人員刪除 代號 ="s:console/second.htm" 部門 ="*" 職等 ="*"/>
< 人員修改 代號 ="s:console/third.htm" 部門 ="*" 職等 ="*"/>
< 人員列示 代號 ="s:console/query.htm" 部門 ="*" 職等 ="*"/>
< 資料備份 代號 ="s:console/backup.htm" 部門 ="*" 職等 ="*"/>
</人員管理 >
< 登出 功能代號 ="q" 部門 ="*" 職等 ="*"/>
</企業資源管理 >
.NET 資訊能源的原力
專業知識標準化員工主檔
<?xml version="1.0" encoding="big5"?>
< 組織架構 日期 ="5/15/2000">
< 研發部 部門 ="1">
< 員工 代號 ="sino" 密碼 ="f\ab" 職等 ="1">
<姓名 >天行者 </姓名 >
</員工 >
</研發部 >
</組織架構 >
DTD( Document Type Definition)訂定 XML文件中所需的結構、內容、語意等標準。
XML 文件中的文件本體結構,主要是依文件定義(DTD)而來的,每項資料的出現都有順序與意義。文件一旦引用 DTD,就必須遵循 DTD中的規定。
XML Document
(Content)
XML DTD
(Rules)
XML Parser
(Processor)XML Application
Valid XML(DTD)
Document Type Declaration 的組成
Element type declarations
<!ELEMENT First_Name (PCDATA)>
Attribute list declarations <!ELEMENT dessert ((ice_cream | Apple_Pie),scoops+)>
Entity declarations <!ENTITY % entity_name “entity”
Notations declarations <!NOTATION resume_format SYSTEM “resume_whiz
notation”>
Valid XML (Schema)
Schema的功能與 DTD是一樣,但在使用上它是利用 XML特性來定義 XML 使用的語法。Schema中有提供資料型態檢查的功能。
Defining Elements and Attributes<ElementType><AttributeType><element type><attribute type>
Content ModelModel(open,closed)Content(textOnly,eltOnly,empty,mixed)Order(seq,one,many)minOccurs and maxOccurs
AttributesRequireddefault
Data TypesDatatypes namespace<Schema name="myschema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes"> <!-- ... --> </Schema>
Declaration
1. <ElementType name="pages" dt:type="int"/>
2. <ElementType name="pages"> <datatype dt:type= "int"/> </ElementType>
JScript 與 XML 執行架構
資訊中心 (資料庫、 XML檔案、 Jscript 程式 )
網路 (HTTP)
XML Parser
DOM
瀏覽器
(Jscript 程式 )
下載程式 讀取資訊
.NET 資訊能源的應用
JScript 與 XML 程式範例
<html><style>#t {border:3 ridge red;color:green;width:100;height:25}</style><script>function doit(){
xmldoc=new ActiveXObject("Microsoft.XMLDOM"); // Trun off Asynchronous downloading.
xmldoc.async=false; xmldoc.load("sinoorg.xml"); t.innerText=xmldoc.documentElement.nodeName;}</script><body><div id="t" onclick="doit()">Click here</div></body></html>
Cascading Style Sheet
JscriptXML
DHTML Object Model
.NET 資訊能源的應用
Document Object Model 結構<?xml version="1.0"?><itemlist> <!-- Result from a query --> <item id="1012"> <description> CD Player </description> <price>199.95</price> </item></itemlist>
DOM 與 JScript 對應
<?xml version=“1.0”?>
<contacts>
<contact>
<name>
<first>Faraz</first>
<Last>Hoodbhoy</Last>
</name>
</contact>
</contacts>
X.documentElement
Var X=new ActiveXObject(“Microsoft.XMLDOM”)X.load(“sino.xml”);
X.documentElement.childNodes.item(0)
XML 與 DOM Tree (取得 XML資訊)
XML01.htm
<script>
xmldoc=new ActiveXObject("Microsoft.XMLDOM");
// Trun off Asynchronous downloading.
xmldoc.async=false;
xmldoc.load("sinoorg.xml");
document.write(xmldoc.documentElement.nodeName);
document.write("#"+xmldoc.documentElement.nodeType+"<br>");
document.write(xmldoc.documentElement.attributes.item(0).nodeName);
document.write(xmldoc.documentElement.attributes.item(0).nodeValue);
document.write("#"+xmldoc.documentElement.attributes.item(0).nodeType);
</script>
XML03.HTM<script> xdoc1=new ActiveXObject("Microsoft.XMLDOM"); xdoc2=new ActiveXObject("Microsoft.XMLDOM"); // Trun off Asynchronous downloading. xdoc1.async=false; xdoc1.load("sinoorg.xml"); xdoc2.async=false; xdoc2.load("dns.xml"); xdoc1.documentElement.appendChild(xdoc2.documentElement); var cnode=xdoc1.documentElement.childNodes.item(0); for(;cnode;cnode=cnode.nextSibling){ document.write(cnode.nodeName+"#"+cnode.nodeType+"<br>"); } document.write(xdoc1.xml+"<br>");</script>
XML 與 DOM Tree( appendChild)
XML文件體裁: XSL
XML 文件除了可以用 Data Binding方式,將內容顯示外,還可藉由文件體裁的應用來顯示其內容。
目前能與 XML配合使用的文件體裁有 CSS與XSL ,以下就為各位介紹的內容有:
XML與 XSL的結合 介紹 XML 文件與 XSL 排版樣本,將XML文件透過 XSL的排版設定顯示在瀏覽器中。
XML與 CSS的結合 介紹 CSS排版樣本如何被 XML文件套用,並將 XML文件的內容顯示在瀏覽器中。
XSL Transformation
An XSL transformation results in the creation of a new XML tree.
Template-driven model適用於 regular 或 repetitive資料 .
Data-driven Model適用於 irregular或 recursive資料 .
Xsljs.htm
<HTML>
<XML id="source" src="data.xml"></XML>
<XML id="style" src="xsl01.xsl"></XML>
<SCRIPT event="onload" for="window">
showResult.innerHTML = source.transformNode(style.XMLDocument)
</SCRIPT>
<BODY>
<DIV id="showResult"></DIV>
</BODY>
</HTML>
XSL Transformation與Scripting
認識 HTML Component
程式設計者可以將 JScript包裝起來同時應用在網頁上,這個包裝動作不只是把 JScript儲存成獨立的檔案而已,它更能付予所連結的標籤更多應用能力。
這樣的系統開發方式,使不同的標籤可具有相同的應用能力(Behavior),這也就是說新一代應用程式庫 (HTC),一樣具有物件重覆使用的功能。
新一代應用程式庫 (HTC),在執行上可像物件一樣具有自己的性質 (Properties)及方法 (Method)。 HTC在執行上,是非常有效率,因它在前端瀏覽器系統中執行,並且不需要在前端作業系統註冊。
Persistence
<HTML><HEAD><META content=snapshot name=save><STYLE>.saveSnapshot {
BEHAVIOR: url(#default#savesnapshot)}</STYLE><SCRIPT class=saveSnapshot id=oPersistScript> var sPersistValue = "";</SCRIPT></HEAD>
<BODY aLink=#000000 bgColor=#ffffff bgProperties=fixed leftMargin=0 link=#000000 topMargin=0 vLink=#808080> Enter some Text: <INPUT id=oInput><BR> Click to save: <INPUT onclick="sPersistValue=oInput.value" type=button value=Save><BR> Click to load: <INPUT onclick="oInput.value=sPersistValue" type=button value=Load></BODY></HTML>
Web Folder
<style>.httpFolder {behavior:url(#default#httpFolder);}</style>
<script>function opfo(){odav.navigateFrame("http://you/public","_self");}</script><body><div id="odav" class="httpFolder"/>
<input type="button"value="open" onclick="opfo();"></body>
HTML + TIME<HTML><HEAD><STYLE> .time { behavior: url(#default#time);}</STYLE></HEAD><BODY><H1 CLASS="time" t:BEGIN="0" t:DUR="11" t:TIMEACTION="style"
STYLE="Color:Red;">timeAction</H1><P CLASS="time" t:BEGIN="2" t:DUR="5" t:TIMEACTION="display">This appears after 2
seconds.</P><P CLASS="time" t:BEGIN="4" t:DUR="5" t:TIMEACTION="display">This appears after 4
seconds.</P><P CLASS="time" t:BEGIN="6" t:DUR="5" t:TIMEACTION="display">This appears after 6
seconds.</P><P>This is the last line.</P></BODY></HTML
VML ( Vector Markup Language )
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head><style>v\:* { behavior: url(#default#VML); }</style></head>
<body><v:line from="20pt, 20pt" to="100pt, 20pt" strokecolor="red"
strokeweight="2pt"></body></html>
快速建立 HTML Component – 開始
HTC (HTML Component)是一個能夠擴展並強化 Inter Explorer的構件,且它能以多種語言建立,如: VBScript或 JScript。只要利用任何一種 Script語言所建立的構件,也就是在建立 HTML構件(HTC Component),而這些檔案以 .htc為附檔名,檔案裡包含該構件的 Script。
建立 HTC:第一部份HTC檔案就像 HTML檔案,只差在它的副檔名是 .htc,而不是 .html或 .htm,因此我們可以用任何 HTML編輯工具建立 HTC。 HTC的開頭:<PUBLIC:COMPONENT>
<SCRIPT>......
</SCRIPT></PUBLIC:COMPONENT>
快速建立 HTML Component –事件「 Behavior」的主要功能之一就是處理事件,動態網頁的基礎就是特定情況下被觸發的事件,所以當主文件裡的事件被觸發時,「 Behavior」必須能採取適當的動作以當作回應,而且必須有能力自行獨發事件,讓主文件裡的 Script來處理。為了讓「 Behavior」發揮功效,它必須結合其它既存的事件處理函式,然後一起處理特定的事件,這種作
法稱為連結某個事件 (attaching an event)。
用於 Behavior的事件元件 -ATTACH
它位於 HTC的標頭部份。我們可以利用這個元件選擇文件中的一個事件,並指定 HTC內的函式去處理它。
<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT=”onmouseover” ONEVENT=”doMouseOver” />
<PUBLIC:ATTACH EVENT=”onmouseout” ONEVENT=”doMouseOut” />
</PUBLIC:COMPONENT>
快速建立 HTML Component - 程式撰寫
接下來是將我們把所要處理的事件付與生命力,就是撰寫相關的 Script 程式碼,這 裡的 Script 寫法和 Dynamic HTML 網頁的寫法完全一樣。
<PUBLIC:COMPONENT><PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="onMouseOver()" /><PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="onMouseOut()" /><SCRIPT LANGUAGE="JScript"> var normalColor, function onMouseOver() { // save original values normalColor = runtimeStyle.color; runtimeStyle.color = "red";} function onMouseOut() { // restore original values runtimeStyle.color = normalColor;}</SCRIPT></PUBLIC:COMPONENT>
快速建立 HTML Component –應用套用到您所寫的 HTML程式 (htc01.htm)
<HEAD>
<STYLE>
LI {behavior:url(hilite.htc)}
</STYLE>
</HEAD>
<P>Mouse over the two list items below to see this effect.
<UL>
<LI>HTML Authoring</LI>
<LI>Dynamic HTML</LI>
</UL>
<PUBLIC:PROPERTY NAME="hiliteColor" /><PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="Hilite()"/><PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="Restore()"/><PUBLIC:ATTACH EVENT="onload" FOR="window" ONEVENT="Init()"/>
<SCRIPT LANGUAGE="JScript">var normalColor;
function Init(){ if (hiliteColor == null) hiliteColor = "red";}
function Hilite(){ normalColor = style.color; style.color = hiliteColor; style.cursor = "hand";}
function Restore(){ style.color = normalColor; style.cursor = "";}</SCRIPT>
產生 HTC Properties
產生 HTC Methods
<public:method Name :”start” />
<script Language:”JScript”>
Function start( )
{
//insert flying code here
}
</script>
產生 HTC Custom Events
<public:event name:onrc ID: rcID/>
<Script Language=“Jscript”>
Oevent = create EventObject( );
Oevent.result = sresult;
rcID.fire (Oevent)
</script>
Element Behavior 使用格式
Start.htm<html xmlns:myns><head><?import namespace="myns" implementation="start.htc"></head><body><myns:include/></body></html>
Start.htc<public:component tagname="include"><public:attach event="oncontentready" onevent="init()"/></public:component><script>function init(){ window.status="Include has been initialized";}</script>
Element Behavior 使用格式
介面設計Start1.htc<html><public:component tagname="include"><public:defaults viewLinkContent="true"/><public:attach event="oncontentready" onevent="init()"/></public:component><script>function init(){ window.status="Include has been initialized";}</script><body>Hi </body></html>
何謂 WebDAV(IETF RFC 2518) 這是新一代檔案管理通訊協定,有了這樣的通訊協定,可使在網際網路中的網站,搖身一變為檔案管理系統,並且還提供版本,分享檔案鎖定及安全控管能力。透過這樣的通訊協定在運作上,因
採用 XML 及 HTTP 標準來執行,使得利用 WebDAV 所開發的應用系統及服務,均具有相當好擴充性及應用範圍。
以下三個網站以 WebDAV 做為它們服務的平台:www.dirveway.com
www.sharemation.com
www.mydocsonline.com
WebDAV 技術相關網站
http://msdn.microsoft.com/xml/articles/xmlandwebDav.asp
WebDAV系統運作架構
XML / HTTP
XML / HTTP
Microsoft Web 資料夾
Standalone clients
Web Browser
(DHTML Behavior)
Internet Information Server 5.0
Application Server 2.0
( 內建 WebDAV 功能 )
WebDAV
<html xmlns:drx><head><?IMPORT namespace="drx" implementation="webdavput.htc"></head><body><drx:putitem/></body></html>
<public:component tagname="putitem"><public:defaults viewLinkContent="true"/></public:component><script>function put(){ var req=new ActiveXObject("Microsoft.XMLHTTP"); req.open("put","http://sith/xml/test.xml",false); req.setRequestHeader("Translate","f"); req.send(t.value);}</script><style>body {width:100;height:100;border:2 ridge red}</style><body><table><tr><td align=left> <span onclick="put();" style="cursor:hand;text-align:center;width:60;border: 4 ridge orangered; background-color:orange"> 送出 </span></td> </tr> <tr><td><textarea id=t></textarea></td></tr></table></body>
What Is SOAP?
Simple Object Access ProtocolLightweight XML-based messaging format
Works with:Any operating systemAny programming languageAny platform
What Is A SOAP Message?
SOAP Message
SOAP Envelope
SOAP Header
SOAP Body
Message Name & Data
Headers
Protocol Headers
XML 編碼的 SOAP訊息名稱與資料
<Body> 包含 SOAP訊息名稱與資料
單獨的標題
<Header> encloses headers
<Envelope> encloses payload
標準的 Protocol (HTTP, SMTP, etc.) 與 SOAP Headers
整個 SOAP Message
Simple SOAP Request (Using HTTP)
POST /StockQuote HTTP/1.1 POST /StockQuote HTTP/1.1 Host: www.kennylee.com.tw Host: www.kennylee.com.tw Content-Type: text/xml; charset="utf-8“ Content-Type: text/xml; charset="utf-8“ Content-Length: 323 Content-Length: 323 SOAPAction: Some-Namespace-URI#GetLastTradePrice SOAPAction: Some-Namespace-URI#GetLastTradePrice
<SQ:Envelope <SQ:Envelope xmlns:SQ="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SQ="http://schemas.xmlsoap.org/soap/envelope/" SQ:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"SQ:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> >
<SQ:Body><SQ:Body> <m:GetLastTradePrice xmlns:m="Some-Namespace-URI"> <m:GetLastTradePrice xmlns:m="Some-Namespace-URI"> <symbol>DIS</symbol> <symbol>DIS</symbol> </m:GetLastTradePrice> </m:GetLastTradePrice> </SQ:Body> </SQ:Body></SQ:Envelope> </SQ:Envelope>
Simple SOAP Response
HTTP/1.1 200 OKHTTP/1.1 200 OKContent-Type: text/xml; charset="utf-8“Content-Type: text/xml; charset="utf-8“Content-Length: nnnnContent-Length: nnnn
<SP:Envelope<SP:Envelopexmlns:SP="http://schemas.xmlsoap.org/soap/envelope/"xmlns:SP="http://schemas.xmlsoap.org/soap/envelope/"SP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"SP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">>
<SP:Body><SP:Body> <m:GetLastTradePriceResponse <m:GetLastTradePriceResponse
xmlns:m="Some-Namespace-URI">xmlns:m="Some-Namespace-URI"> <Price>34.5</Price> <Price>34.5</Price> </m:GetLastTradePriceResponse> </m:GetLastTradePriceResponse> </SP:Body> </SP:Body></SP:Envelope></SP:Envelope>
What Is An SCL?
A Service Contract Language (SCL) is:
An XML-based grammar 描述 Web Services的性能可擴展的
類似於 IDL 的觀念 , 但不是 IDL• IDL is platform dependent
• SCL is platform independent
Building A Web Service
Use Visual Studio.NETFile|New
• Visual Basic.NET Web Service
• C# Web Service
Or any text editorJust like any ASP.NET application
.ASMX file in any ASP.NET virtual directory
Web Service 示範<script>var iid,a=10,b=20;function init(){
service.use("http://192.168.99.123/webservice/a/math.asmx?SDL","Math"); window.status=service.Math.call("add",a,b);}</script><body onload="init()">
<div id="service" style="behavior:url(webservice.htc)"></div></body>
Math.asmx<%@ WebService Language=“c#” Class=“Math”%>Using System.Web.Service;Public class Math:Webservice{[WebMethod] Public int Add(int num1,int num2){ return num1+num2; }}
網頁服務一旦產品化後,除了利用現有的網路媒體行銷外, 您還可以將您的產品登錄到 UDDI 網站,以供他人查詢與使用。
UDDI (Universal Description, Discovery, and Integration) 網頁服務計畫主要的目的,是要使網頁服務用戶,能擁有一個有效的環境,能快速的搜尋到它所需的網頁服務。目前有提供 UDDI的服
務有以下三個網站,它們分別是由 Microsoft、 IBM、 Ariba 三家公司所建置。
http://uddi.microsoft.com.com/inquire
http://uddi.ariba.com/uddiprocessor.aw/ad/process
http://www-3.ibm.com/services/uddi/inquiryapi
網頁服務 -Yellow Page