如何在Exchange2000中使用XML
XML是在Exchange中存储数据格式的一种,一般应用在Exchange中的以下内容:
Web Storage System 中条目的某些属性合Exchange模式定义,还经常应用在WebDAV
请求中的返回信息、请求等。用户也使用Web Storage System存储XML文档、XSL文
档、HTML文档。
例如:Exchange2000中以XML格式存储联系人的属性信息如下:
1<d:prop xmlns:c="urn:schemas:contacts" xmlns:d="DAV">
2<d:href>http://server/exchange/zhang/Contacts/zhang.eml<d:href>
3<c:fileas>zhang.feng</c:fileas>
4<c:email>[email protected]</c:email>
5<c:title>super XML</c:title>
6<c:department>Deve</c:department>
7</d:href></d:href></d:prop>
为了学习XML的使用方法,现举个例子来说明,下面的例子阐明了如何针对直接的Exchange URL构造HTTP/WebDAV PROPFIND⑴方法请求的内容:
1<html>
2<head>
3<title>test<title>
4<script language="vbscript">
5
6> Dim xmlDoc
7>
8> Sub cmdGo_OnClick()
9>
10>> Dim strURL,strPropReg
11>>
12>> strURL = txtURL.value
13>>
14>> strPropReg="<?xml vesion='1.0'?>"
15>>
16>> strPropReg=strPropReg&"<d:propfind xmlns:d='DAV:'>"
17>>
18>> strPropReg=strPropReg&"<d:prop>"
19>>
20>> strPropReg=strPropReg&"<d:displayname>"
21>>
22>> strPropReg=strPropReg&"<d:creationdate>"
23>>
24>> strPropReg=strPropReg&"</d:prop>"
25>>
26>> strPropReg=strPropReg&"</d:propfind>"
27>>
28>> With CreateObject("microsoft.xmlhttp")
29>>
30>> .Open "PROPFIND",strURL,True
31>>
32>> .SetRequestHeader "Context-type:","text/xml"
33>>
34>> .SetRequestHeader "Depth","1,noroot"
35>>
36>> .Send(strPropReg)
37>>
38>> responsehere.innerText = .ResponseText
39>>
40>> End With
41>
42> End Sub
43
44</script>
45</title></title></head>
46<body>
47<h2>Get Contents of Folder Using XML/HTTP</h2>
48<br/>
49<p>Enter a URL,something like http://server/public/documents/</p>
50<p><input name="txtURL" type="text" width="100"/></p>
51<p><input name="cmdGo" type="button" value="Go"/></p>
52<div id="responsehere">
53</div>
54</body>
55</html>
⑴在Web Storage System中访问属性,使用PROPFIND方法