Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

895 lines
26 KiB

  1. <HTML>
  2. <HEAD>
  3. <STYLE>
  4. BODY { font-family:Verdana; font-size:5pt; margin:0px; color:teal; }
  5. .instructions { font-style:italic; text-align:right; color:gray; margin-left:.5em; }
  6. .headline { background-color:teal; color:white; font-family:Arial Black; font-size:10pt;
  7. text-align:center; padding-top:1em; }
  8. .group { font-family:Arial Black; font-size:8pt; margin-top:.5em; margin-left:.5em;
  9. margin-bottom:.5em; }
  10. .button { font-family:Verdana; font-size:7pt; font-weight:bold; text-align:right;
  11. color:gray; }
  12. .arrow { font-family:Webdings; }
  13. </STYLE>
  14. </HEAD>
  15. <SCRIPT>
  16. var source;
  17. var style;
  18. var methodDataStyle;
  19. var theRequest;
  20. var sourceURL;
  21. var styleURL;
  22. var oldXSLitem;
  23. var theXMLResponse;
  24. var operationId;
  25. // Script to execute method
  26. function ExecuteMethods()
  27. {
  28. theMethodData = theXMLResponse.transformNode(methodDataStyle);
  29. // We have a list of methods now, and their arguments
  30. // Pop up a dialogu asking for the method to be executed.
  31. thePage = '<HTML><BODY><BUTTON onClick="parents.results.display(\"Hi\")">Hi</BUTTON></BODY></HTML>';
  32. parent.results.display(thePage);
  33. }
  34. function UpdateOperationId ()
  35. {
  36. operationId = operation.value;
  37. }
  38. function UpdateStylesheet ()
  39. {
  40. var theXSL = new String (stylesheetSelect.value);
  41. if (theXSL == "Raw")
  42. changeXSL("raw-xml.xsl");
  43. else if (theXSL == "MOF")
  44. changeXSL("wmimof20.xsl");
  45. else if (theXSL == "PropertyType")
  46. changeXSL("property-table.xsl");
  47. else if (theXSL == "PropertyValue")
  48. changeXSL("value-table.xsl");
  49. else if (theXSL == "ClassNames")
  50. changeXSL("classnames.xsl");
  51. else if (theXSL == "PropValue")
  52. changeXSL("propvalue.xsl");
  53. else if (theXSL == "DetailPage")
  54. changeXSL("detailpage20.xsl");
  55. else if (theXSL == "ClassPage")
  56. changeXSL("classpage20.xsl");
  57. else
  58. changeXSL(stylesheetSelect.value);
  59. }
  60. function DoOperation (bSend)
  61. {
  62. var theOp = new String (operationId);
  63. var theBody;
  64. if (theOp == "EnumerateInstances")
  65. theBody = EnumInstance ();
  66. else if (theOp == "GetClass")
  67. theBody = GetClass ();
  68. else if (theOp == "GetInstance")
  69. theBody = GetInstance ();
  70. else if (theOp == "EnumerateClasses")
  71. theBody = EnumClass ();
  72. else if (theOp == "EnumerateClassNames")
  73. theBody = EnumClassNames ();
  74. else if (theOp == "EnumerateInstanceNames")
  75. theBody = EnumInstanceNames ();
  76. else if (theOp == "ExecQuery")
  77. theBody = ExecQuery ();
  78. else if (theOp == "OPTIONS")
  79. theBody = GetOptions ();
  80. else if (theOp == "DeleteClass")
  81. theBody = DeleteClass ();
  82. else if (theOp == "DeleteInstance")
  83. theBody = DeleteInstance ();
  84. else if (theOp == "GetProperty")
  85. theBody = GetProperty ();
  86. else if (theOp == "SetProperty")
  87. theBody = SetProperty ();
  88. else if (theOp == "Associators")
  89. theBody = Associators ();
  90. else if (theOp == "AssociatorNames")
  91. theBody = AssociatorNames ();
  92. else if (theOp == "References")
  93. theBody = References ();
  94. else if (theOp == "ReferenceNames")
  95. theBody = ReferenceNames ();
  96. else if (theOp == "CUSTOM")
  97. theBody = DoCustomOperation ();
  98. else
  99. alert ("Unsupported operation: " + theOp);
  100. if (bSend)
  101. ShowResults(theRequest, theBody);
  102. else if (null != theBody)
  103. ShowRequest(theBody);
  104. }
  105. // ----- Scripts to control XSL Processing ------
  106. function update()
  107. {
  108. // See if there is a stylesheet qualifier on the instance
  109. var myStylenew = theXMLResponse.selectSingleNode("/CIM//QUALIFIER[@NAME='stylesheet']");
  110. if(myStylenew)
  111. {
  112. var theStyleSheet = myStylenew.text;
  113. if(theStyleSheet)
  114. {
  115. var tmp = document.all.item("SpecificStyleSheet");
  116. // Add a new selection
  117. var theNewOption = document.createElement("OPTION");
  118. theNewOption.text = theStyleSheet;
  119. theNewOption.value = theStyleSheet;
  120. theNewOption.id = "SpecificStyleSheet";
  121. if(tmp == null)
  122. {
  123. document.all("stylesheetSelect").options.add(theNewOption);
  124. }
  125. }
  126. }
  127. else
  128. document.all("stylesheetSelect").options.remove(8);
  129. parent.results.display(theXMLResponse.transformNode(style));
  130. }
  131. function changeXSL(xsldoc)
  132. {
  133. styleURL = xsldoc;
  134. style.load(styleURL);
  135. update();
  136. }
  137. // ----- Scripts to activate buttons ------
  138. function over(item)
  139. {
  140. item.style.color = "black";
  141. }
  142. function out(item) {
  143. item.style.color = "gray";
  144. }
  145. // called by parent frame when the whole frameset is ready
  146. function init()
  147. {
  148. style = new ActiveXObject("Microsoft.XMLDOM");
  149. style.async = false;
  150. style.load("raw-xml.xsl");
  151. methodDataStyle = new ActiveXObject("Microsoft.XMLDOM");
  152. methodDataStyle.async = false;
  153. methodDataStyle.load("methoddata.xsl");
  154. theRequest = new ActiveXObject("Microsoft.XMLHTTP");
  155. theXMLResponse = new ActiveXObject("Microsoft.XMLDOM");
  156. operationId = "EnumerateInstances";
  157. }
  158. function GetOptions()
  159. {
  160. document.all("ResponseStatus").innerText = "";
  161. theRequest.open("OPTIONS", document.all.urlbox.value, false);
  162. return null;
  163. }
  164. function InitOperation (method)
  165. {
  166. document.all("ResponseStatus").innerText = "";
  167. document.all("ResponseHeaders").innerText = "";
  168. if (mpost.checked)
  169. {
  170. theRequest.open("M-POST", document.all.urlbox.value, false);
  171. theRequest.setRequestHeader("Content-Type", "application/xml;charset=\"utf-8\"");
  172. theRequest.setRequestHeader("Man", "http://www.dmtf.org/cim/mapping/http/v1.0;ns=73");
  173. theRequest.setRequestHeader("73-CIMOperation", "MethodCall");
  174. theRequest.setRequestHeader("73-CIMMethod", method);
  175. theRequest.setRequestHeader("73-CIMObject", document.all.namespacebox.value);
  176. theRequest.setRequestHeader("73-CIMProtocolVersion", "1.0");
  177. theRequest.setRequestHeader("73-MicrosoftWMI", "Hi");
  178. }
  179. else
  180. {
  181. theRequest.open("POST", document.all.urlbox.value, false);
  182. theRequest.setRequestHeader("Content-Type", "application/xml;charset=\"utf-8\"");
  183. theRequest.setRequestHeader("CIMOperation", "MethodCall");
  184. theRequest.setRequestHeader("CIMMethod", method);
  185. theRequest.setRequestHeader("CIMObject", document.all.namespacebox.value);
  186. theRequest.setRequestHeader("CIMProtocolVersion", "1.0");
  187. theRequest.setRequestHeader("MicrosoftWMI", "Hi");
  188. }
  189. }
  190. function GetObjectNameParameter ()
  191. {
  192. var str = "<IPARAMVALUE NAME=\"ObjectName\">";
  193. var objectPath = new String (document.all.classbox.value);
  194. if (-1 == objectPath.indexOf (".", 0))
  195. {
  196. // a class name
  197. str = str + "<CLASSNAME NAME=\"" +
  198. objectPath + "\">";
  199. }
  200. else
  201. {
  202. // an instance name
  203. str = str + GetInstanceName (objectPath);
  204. }
  205. str = str + "</IPARAMVALUE>";
  206. return str;
  207. }
  208. function GetClassNameParameter ()
  209. {
  210. return ("<IPARAMVALUE NAME=\"ClassName\"><CLASSNAME NAME=\"" +
  211. document.all.classbox.value + "\"/></IPARAMVALUE>");
  212. }
  213. function GetInstanceNameParameter ()
  214. {
  215. var str = "<IPARAMVALUE NAME=\"InstanceName\">";
  216. str = str + GetInstanceName (document.all.classbox.value);
  217. str = str + "</IPARAMVALUE>";
  218. return str;
  219. }
  220. function GetReference (inStr)
  221. {
  222. // TODO - just handle INSTANCENAME case for now
  223. return GetInstanceName (inStr);
  224. }
  225. function GetInstanceName (inStr)
  226. {
  227. var pathValue = new String (inStr);
  228. var str = "<INSTANCENAME CLASSNAME=\"";
  229. // Step 1 - get the class name
  230. var startIndex = pathValue.indexOf (".");
  231. str = str + pathValue.substr (0, startIndex) + "\">";
  232. startIndex = startIndex + 1;
  233. // Step 2 - get the keybindings
  234. while (-1 != (index = pathValue.indexOf ("=", startIndex)))
  235. {
  236. str = str +
  237. '<KEYBINDING NAME="' + pathValue.substr (startIndex,
  238. index - startIndex) + '">';
  239. // Get the key value
  240. startIndex = index + 1;
  241. var valueStr;
  242. if (-1 != (index = pathValue.indexOf (",", startIndex)))
  243. {
  244. valueStr = new String (pathValue.substr (startIndex,
  245. index - startIndex));
  246. startIndex = index + 1;
  247. }
  248. else
  249. {
  250. valueStr = new String (pathValue.substr (startIndex));
  251. startIndex = pathValue.length;
  252. }
  253. str = str + '<KEYVALUE';
  254. // Work out VALUETYPE attribute
  255. if (valueStr.charAt (0) == '"')
  256. {
  257. // string
  258. str = str + '>' + valueStr.substr (1, valueStr.length-2);
  259. // TODO - this COULD be an object path - need to
  260. // trap that case and do a VALUE.REFERENCE instead
  261. }
  262. else if (!isNaN (parseInt (valueStr)))
  263. {
  264. // numeric
  265. str = str + ' VALUETYPE="numeric">' + valueStr;
  266. }
  267. else
  268. {
  269. // assume boolean
  270. str = str + ' VALUETYPE="boolean">' + valueStr;
  271. }
  272. str = str + "</KEYVALUE></KEYBINDING>";
  273. }
  274. str = str + "</INSTANCENAME>";
  275. return (str);
  276. }
  277. function GetIncludeQualifiersParameter ()
  278. {
  279. var IncludeQualifiers = "FALSE";
  280. if (includeQualifiers.checked)
  281. IncludeQualifiers = "TRUE";
  282. return ("<IPARAMVALUE NAME=\"IncludeQualifiers\"><VALUE>" +
  283. IncludeQualifiers + "</VALUE></IPARAMVALUE>");
  284. }
  285. function GetLocalOnlyParameter ()
  286. {
  287. var LocalOnly = "FALSE";
  288. if (localOnly.checked)
  289. LocalOnly = "TRUE";
  290. return ("<IPARAMVALUE NAME=\"LocalOnly\"><VALUE>" + LocalOnly +
  291. "</VALUE></IPARAMVALUE>");
  292. }
  293. function GetClassOriginParameter ()
  294. {
  295. var ClassOrigin = "FALSE";
  296. if (includeClassOrigin.checked)
  297. ClassOrigin = "TRUE";
  298. return ("<IPARAMVALUE NAME=\"IncludeClassOrigin\"><VALUE>" +
  299. ClassOrigin + "</VALUE></IPARAMVALUE>");
  300. }
  301. function GetPropertyNameParameter ()
  302. {
  303. return ("<IPARAMVALUE NAME=\"PropertyName\"><VALUE>" +
  304. propertyBox.value + "</VALUE></IPARAMVALUE>");
  305. }
  306. function GetAssocClassParameter ()
  307. {
  308. if (assocClass.value)
  309. {
  310. return ("<IPARAMVALUE NAME=\"AssocClass\"><VALUE>" +
  311. assocClass.value + "</VALUE></IPARAMVALUE>");
  312. }
  313. else
  314. return "";
  315. }
  316. function GetResultClassParameter ()
  317. {
  318. if (document.all.resultClass.value)
  319. {
  320. return ("<IPARAMVALUE NAME=\"ResultClass\"><VALUE>" +
  321. document.all.resultClass.value + "</VALUE></IPARAMVALUE>");
  322. }
  323. else
  324. return "";
  325. }
  326. function GetRoleParameter ()
  327. {
  328. if (role.value)
  329. return ("<IPARAMVALUE NAME=\"Role\"><VALUE>" +
  330. role.value + "</VALUE></IPARAMVALUE>");
  331. else
  332. return "";
  333. }
  334. function GetResultRoleParameter ()
  335. {
  336. if (resultRole.value)
  337. return ("<IPARAMVALUE NAME=\"ResultRole\"><VALUE>" +
  338. resultRole.value + "</VALUE></IPARAMVALUE>");
  339. else
  340. return "";
  341. }
  342. function GetPropertyListParameter ()
  343. {
  344. var strValue = new String (propertyBox.value);
  345. var value = "";
  346. if (0 < strValue.length)
  347. {
  348. value = "<IPARAMVALUE NAME=\"PropertyList\"><VALUE.ARRAY>";
  349. var startIndex = 0;
  350. while (-1 != (index = strValue.indexOf (",", startIndex)))
  351. {
  352. value = value +
  353. "<VALUE>" + strValue.substr (startIndex,
  354. index - startIndex) + "</VALUE>";
  355. startIndex = index + 1;
  356. }
  357. // Get the last element (TODO - empty arrays?)
  358. value = value + "<VALUE>"
  359. + strValue.substr (startIndex) + "</VALUE>";
  360. value = value + "</VALUE.ARRAY></IPARAMVALUE>"
  361. }
  362. return value;
  363. }
  364. function GetPropertyValueParameter ()
  365. {
  366. var strValue = new String (propertyValueBox.value);
  367. var value = "<IPARAMVALUE NAME=\"NewValue\"";
  368. // TODO - if first characters are "ref:" then treat
  369. // as reference value
  370. if (strValue.length == 0)
  371. {
  372. // NULL value
  373. value = value + "/>";
  374. }
  375. else if (strValue.substring (0,4) == new String("ref:"))
  376. {
  377. if (4 == strValue.length)
  378. value = value + "/>";
  379. else
  380. {
  381. value = value + "><VALUE.REFERENCE>" +
  382. GetReference (strValue.substr (4)) +
  383. "</VALUE.REFERENCE></IPARAMVALUE>";
  384. }
  385. }
  386. else if (strValue.charAt (0) == '{')
  387. {
  388. value = value + "><VALUE.ARRAY>";
  389. // Assume an array value
  390. var startIndex = 1;
  391. while (-1 != (index = strValue.indexOf (",", startIndex)))
  392. {
  393. // TODO - build up <VALUE.ARRAY> for this
  394. value = value +
  395. "<VALUE>" + strValue.substr (startIndex,
  396. index - startIndex) + "</VALUE>";
  397. startIndex = index + 1;
  398. }
  399. // Get the last element (TODO - empty arrays?)
  400. value = value + "<VALUE>"
  401. + strValue.substr (startIndex,
  402. strValue.indexOf("}",startIndex) - startIndex) + "</VALUE>";
  403. value = value + "</VALUE.ARRAY></IPARAMVALUE>";
  404. }
  405. else
  406. value = value + "><VALUE>" + strValue + "</VALUE></IPARAMVALUE>";
  407. return value;
  408. }
  409. function GetDeepInheritanceParameter ()
  410. {
  411. var DeepInheritance = "FALSE";
  412. if (deepInheritance.checked)
  413. DeepInheritance = "TRUE";
  414. return ("<IPARAMVALUE NAME=\"DeepInheritance\"><VALUE>" +
  415. DeepInheritance + "</VALUE></IPARAMVALUE>");
  416. }
  417. function GetQueryParameter ()
  418. {
  419. return ("<IPARAMVALUE NAME=\"Query\"><VALUE>" +
  420. document.all.querybox.value + "</VALUE></IPARAMVALUE>" );
  421. }
  422. function GetQueryLanguageParameter ()
  423. {
  424. return ("<IPARAMVALUE NAME=\"QueryLanguage\"><VALUE>" +
  425. "WQL" + "</VALUE></IPARAMVALUE>");
  426. }
  427. function DoCustomOperation()
  428. {
  429. var fso = new ActiveXObject("Scripting.FileSystemObject");
  430. var theFile = fso.OpenTextFile(".\multireq.xml");
  431. alert ("Hello");
  432. }
  433. function GetClass()
  434. {
  435. InitOperation ("GetClass");
  436. return RequestPreamble ("GetClass") +
  437. GetClassNameParameter () +
  438. GetIncludeQualifiersParameter () +
  439. GetLocalOnlyParameter () +
  440. GetClassOriginParameter () +
  441. GetPropertyListParameter () +
  442. RequestPostamble ();
  443. }
  444. function DeleteClass()
  445. {
  446. InitOperation ("DeleteClass");
  447. return RequestPreamble ("DeleteClass") +
  448. GetClassNameParameter () +
  449. RequestPostamble ();
  450. }
  451. function GetInstance ()
  452. {
  453. InitOperation ("GetInstance");
  454. return RequestPreamble ("GetInstance") +
  455. GetInstanceNameParameter () +
  456. GetIncludeQualifiersParameter () +
  457. GetLocalOnlyParameter () +
  458. GetClassOriginParameter () +
  459. GetPropertyListParameter () +
  460. RequestPostamble ();
  461. }
  462. function DeleteInstance ()
  463. {
  464. InitOperation ("DeleteInstance");
  465. return RequestPreamble ("DeleteInstance") +
  466. GetInstanceNameParameter () +
  467. RequestPostamble ();
  468. }
  469. function EnumInstance()
  470. {
  471. InitOperation ("EnumerateInstances");
  472. return RequestPreamble ("EnumerateInstances") +
  473. GetClassNameParameter () +
  474. GetIncludeQualifiersParameter () +
  475. GetLocalOnlyParameter () +
  476. GetClassOriginParameter () +
  477. GetDeepInheritanceParameter () +
  478. GetPropertyListParameter () +
  479. RequestPostamble ();
  480. }
  481. function EnumClass()
  482. {
  483. InitOperation ("EnumerateClasses");
  484. return RequestPreamble ("EnumerateClasses") +
  485. GetClassNameParameter () +
  486. GetIncludeQualifiersParameter () +
  487. GetLocalOnlyParameter () +
  488. GetClassOriginParameter () +
  489. GetDeepInheritanceParameter () +
  490. RequestPostamble ();
  491. }
  492. function EnumInstanceNames()
  493. {
  494. InitOperation ("EnumerateInstanceNames");
  495. return RequestPreamble ("EnumerateInstanceNames") +
  496. GetClassNameParameter () +
  497. RequestPostamble ();
  498. }
  499. function EnumClassNames()
  500. {
  501. InitOperation ("EnumerateClassNames");
  502. return RequestPreamble ("EnumerateClassNames") +
  503. GetClassNameParameter () +
  504. GetDeepInheritanceParameter () +
  505. RequestPostamble ();
  506. }
  507. function ExecQuery()
  508. {
  509. InitOperation ("ExecQuery");
  510. return RequestPreamble ("ExecQuery") +
  511. GetQueryParameter () +
  512. GetQueryLanguageParameter () +
  513. GetIncludeQualifiersParameter () +
  514. GetClassOriginParameter () +
  515. RequestPostamble ();
  516. }
  517. function GetProperty ()
  518. {
  519. InitOperation ("GetProperty");
  520. return RequestPreamble ("GetProperty") +
  521. GetInstanceNameParameter () +
  522. GetPropertyNameParameter () +
  523. RequestPostamble ();
  524. }
  525. function SetProperty ()
  526. {
  527. InitOperation ("SetProperty");
  528. return RequestPreamble ("SetProperty") +
  529. GetInstanceNameParameter () +
  530. GetPropertyNameParameter () +
  531. GetPropertyValueParameter () +
  532. RequestPostamble ();
  533. }
  534. function Associators()
  535. {
  536. InitOperation ("Associators");
  537. return RequestPreamble ("Associators") +
  538. GetObjectNameParameter () +
  539. GetIncludeQualifiersParameter () +
  540. GetClassOriginParameter () +
  541. GetAssocClassParameter () +
  542. GetResultClassParameter () +
  543. GetRoleParameter () +
  544. GetResultRoleParameter () +
  545. GetPropertyListParameter () +
  546. RequestPostamble ();
  547. }
  548. function AssociatorNames()
  549. {
  550. InitOperation ("AssociatorNames");
  551. return RequestPreamble ("AssociatorNames") +
  552. GetObjectNameParameter () +
  553. GetAssocClassParameter () +
  554. GetResultClassParameter () +
  555. GetRoleParameter () +
  556. GetResultRoleParameter () +
  557. RequestPostamble ();
  558. }
  559. function References()
  560. {
  561. InitOperation ("References");
  562. return RequestPreamble ("References") +
  563. GetObjectNameParameter () +
  564. GetIncludeQualifiersParameter () +
  565. GetClassOriginParameter () +
  566. GetResultClassParameter () +
  567. GetRoleParameter () +
  568. GetPropertyListParameter () +
  569. RequestPostamble ();
  570. }
  571. function ReferenceNames()
  572. {
  573. InitOperation ("ReferenceNames");
  574. return RequestPreamble ("ReferenceNames") +
  575. GetObjectNameParameter () +
  576. GetResultClassParameter () +
  577. GetRoleParameter () +
  578. RequestPostamble ();
  579. }
  580. function ShowResults(theXMLRequest, theXMLBody)
  581. {
  582. theXMLRequest.send (theXMLBody);
  583. theXMLResponse.async = false;
  584. theXMLResponse.validateOnParse = false;
  585. theXMLResponse.resolveExternals = false;
  586. document.all("ResponseStatus").innerText = theXMLRequest.status;
  587. document.all("ResponseHeaders").innerText = theXMLRequest.getAllResponseHeaders();
  588. theXMLResponse.loadXML(theXMLRequest.responseText);
  589. var parseError = theXMLResponse.parseError;
  590. if (parseError && (0 < parseError.errorCode))
  591. {
  592. alert (parseError.errorCode);
  593. alert (parseError.reason);
  594. }
  595. update(theXMLResponse);
  596. }
  597. function ShowRequest(theBody)
  598. {
  599. theXMLResponse.loadXML(theBody);
  600. update(theXMLResponse);
  601. }
  602. function ParseNamespace (nsPath)
  603. {
  604. var parsedPath = "";
  605. var inputPath = new String (nsPath);
  606. var startIndex = 0;
  607. while ((-1 != (index = inputPath.indexOf ("/", startIndex))) ||
  608. (-1 != (index = inputPath.indexOf ("\\", startIndex))))
  609. {
  610. parsedPath = parsedPath +
  611. '<NAMESPACE NAME="' + inputPath.substr (startIndex,
  612. index - startIndex) + '"/>';
  613. startIndex = index + 1;
  614. }
  615. parsedPath = parsedPath + '<NAMESPACE NAME="'
  616. + inputPath.substr (startIndex) + '"/>';
  617. return (parsedPath);
  618. }
  619. function RequestPreamble (method)
  620. {
  621. var str = "<?xml version=\"1.0\" ?>" +
  622. "<CIM CIMVERSION=\"2.0\" DTDVERSION=\"2.0\">" +
  623. "<MESSAGE ID=\"877\" PROTOCOLVERSION=\"1.0\">" +
  624. "<SIMPLEREQ>" +
  625. "<IMETHODCALL NAME=\"" + method + "\">" +
  626. "<LOCALNAMESPACEPATH>" +
  627. ParseNamespace (document.all.namespacebox.value) +
  628. "</LOCALNAMESPACEPATH>";
  629. return (str);
  630. }
  631. function RequestPostamble ()
  632. {
  633. return ("</IMETHODCALL></SIMPLEREQ></MESSAGE></CIM>");
  634. }
  635. </SCRIPT>
  636. <SCRIPT LANGUAGE="vbscript">
  637. Function ReadFromFile()
  638. Dim totalString
  639. Set fs = CreateObject("Scripting.FileSystemObject")
  640. Set f = fs.GetFile("d:\\try.xml")
  641. Set ts = f.OpenAsTextStream(1)
  642. Do While ts.AtEndOfStream <> True
  643. totalString = totalString + ts.ReadLine
  644. Loop
  645. ts.Close
  646. ReadFromFile = totalString
  647. MsgBox totalString
  648. End Function
  649. </SCRIPT>
  650. <BODY>
  651. <DIV CLASS="headline">XML Client</DIV>
  652. <DIV CLASS="instructions">
  653. Use this client to perform CIM Operations </DIV>
  654. <DIV class=group>
  655. <TABLE align=left border=0 cellPadding=1 cellSpacing=1 width="75%">
  656. <TR>
  657. <TD><FONT size=1><LABEL>CIM Server URL&nbsp;</LABEL></FONT></TD>
  658. <TD><INPUT id=urlbox size=35 value=http://localhost/cimom></TD></TR>
  659. <TR>
  660. <TD><FONT
  661. size=1><LABEL>Namespace&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</LABEL></FONT></TD>
  662. <TD><INPUT id=namespacebox value=root\cimv2
  663. style="HEIGHT: 22px; WIDTH: 243px"></TD></TR>
  664. <TR>
  665. <TD><FONT
  666. size=1><LABEL>Object&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</LABEL></FONT></TD>
  667. <TD><INPUT id=classbox style="HEIGHT: 22px; LEFT: 1px;
  668. TOP: 2px; WIDTH: 243px"
  669. value=Win32_LogicalDisk></TD></TR>
  670. <TR>
  671. <TD><FONT
  672. size=1><LABEL>Query</LABEL>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  673. </FONT></TD>
  674. <TD><TEXTAREA id=querybox rows=5 style="HEIGHT: 26px; WIDTH: 270px">select * from win32_processor</TEXTAREA></TD></TR>
  675. <TR>
  676. <TD><FONT size=1>Property
  677. Name</FONT></TD>
  678. <TD><INPUT id=propertyBox name=text1
  679. style="HEIGHT: 22px; WIDTH: 243px"></TD></TR>
  680. <TR>
  681. <TD><FONT size=1>Property Value</FONT></TD>
  682. <TD><INPUT id=propertyValueBox name=text2
  683. style="HEIGHT: 22px; WIDTH: 243px"></TD></TR>
  684. <TR>
  685. <TD><FONT size=1>Class Origin&nbsp;&nbsp;&nbsp;&nbsp;</FONT></TD>
  686. <TD><INPUT id=includeClassOrigin name=checkbox2 type=checkbox>&nbsp;&nbsp;
  687. <FONT size=1>Assoc Class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT
  688. id=assocClass name=text3
  689. style="HEIGHT: 22px; WIDTH: 123px"> &nbsp;</FONT></TD></TR>
  690. <TR>
  691. <TD><FONT size=1>Deep Inheritance</FONT></TD>
  692. <TD><INPUT CHECKED id=deepInheritance name=checkbox4 type=checkbox>&nbsp;&nbsp; <FONT
  693. size=1>Result Class&nbsp;&nbsp; <INPUT id=resultClass name=text3
  694. style="HEIGHT: 22px; WIDTH: 123px"></FONT></TD></TR>
  695. <TR>
  696. <TD><FONT size=1>Local Only</FONT></TD>
  697. <TD><INPUT CHECKED id=localOnly name=checkbox3 type=checkbox>&nbsp;&nbsp; <FONT
  698. size=1>Role&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  699. <INPUT id=role name=text3
  700. style="HEIGHT: 22px; WIDTH: 123px"></FONT></TD></TR>
  701. <TR>
  702. <TD><FONT
  703. size=1>Qualifiers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></TD>
  704. <TD><INPUT id=includeQualifiers name=checkbox1
  705. type=checkbox>&nbsp;&nbsp; <FONT size=1>Result
  706. Role&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT id=resultRole name=text3
  707. style="HEIGHT: 22px; WIDTH: 123px"></FONT></TD></TR></TABLE></DIV>
  708. <DIV class=group><BR>&nbsp;</DIV>
  709. <DIV class=group>&nbsp;</DIV>
  710. <DIV class=group>&nbsp;</DIV>
  711. <DIV class=group>&nbsp;</DIV>
  712. <DIV class=group>&nbsp;</DIV>
  713. <DIV class=group>&nbsp;</DIV>
  714. <DIV class=group>&nbsp;</DIV>
  715. <DIV class=group>&nbsp;</DIV>
  716. <DIV class=group>&nbsp;</DIV>
  717. <DIV class=group>&nbsp;</DIV>
  718. <DIV class=group>&nbsp;</DIV>
  719. <DIV class=group>&nbsp;</DIV>
  720. <DIV class=group><BR>&nbsp;</DIV>
  721. <DIV class=group>
  722. Operation &nbsp;
  723. <SELECT id=operation name=select1 onChange='UpdateOperationId()' style="HEIGHT: 22px; WIDTH: 190px">
  724. <OPTION value=Associators>Associators</OPTION>
  725. <OPTION value=AssociatorNames>AssociatorNames</OPTION>
  726. <OPTION value=CreateClass>CreateClass</OPTION>
  727. <OPTION value=CreateInstance>CreateInstance</OPTION>
  728. <OPTION value=CUSTOM>CUSTOM</OPTION>
  729. <OPTION value=DeleteClass>DeleteClass</OPTION>
  730. <OPTION value=DeleteInstance>DeleteInstance</OPTION>
  731. <OPTION value=DeleteQualifier>DeleteQualifier</OPTION>
  732. <OPTION value=EnumerateClasses>EnumerateClasses</OPTION>
  733. <OPTION value=EnumerateClassNames>EnumerateClassNames</OPTION>
  734. <OPTION selected value=EnumerateInstances>EnumerateInstances</OPTION>
  735. <OPTION value=EnumerateInstanceNames>EnumerateInstanceNames</OPTION>
  736. <OPTION value=EnumerateQualifiers>EnumerateQualifiers</OPTION>
  737. <OPTION value=ExecQuery>ExecQuery</OPTION>
  738. <OPTION value=GetClass>GetClass</OPTION>
  739. <OPTION value=GetInstance>GetInstance</OPTION>
  740. <OPTION value=GetProperty>GetProperty</OPTION>
  741. <OPTION value=GetQualifier>GetQualifier</OPTION>
  742. <OPTION value=ModifyClass>ModifyClass</OPTION>
  743. <OPTION value=ModifyInstance>ModifyInstance</OPTION>
  744. <OPTION value=OPTIONS>OPTIONS</OPTION>
  745. <OPTION value=References>References</OPTION>
  746. <OPTION value=ReferenceNames>ReferenceNames</OPTION>
  747. <OPTION value=SetQualifier>SetQualifier</OPTION>
  748. <OPTION value=SetProperty>SetProperty</OPTION>
  749. </SELECT>&nbsp;&nbsp;&nbsp;&nbsp;
  750. <BUTTON id=operationButton onclick=DoOperation(true) style="LEFT: 221px; TOP: 248px">Send</BUTTON>
  751. <BUTTON id=fileButton onclick=ReadFromFile("try.xml") style="LEFT: 221px; TOP: 248px">ReadFromFile</BUTTON>
  752. <TEXTAREA id=inputbox rows=5 style="HEIGHT: 26px; WIDTH: 270px">Method</TEXTAREA>
  753. &nbsp; <INPUT id=showButton name=button1 style="LEFT: 326px; TOP: 334px" type=button value=Show
  754. onclick=DoOperation(false)></DIV>
  755. <DIV class=group>M-POST&nbsp;&nbsp;&nbsp;&nbsp; <INPUT
  756. id=mpost name=checkbox5 type=checkbox></DIV>
  757. <DIV class=instructions>&nbsp;</DIV>
  758. <DIV class=instructions>&nbsp;The XML data displayed here is taken from live
  759. data captured from Microsoft's implementation of CIM. </DIV>
  760. <DIV class=instructions>
  761. <HR>
  762. &nbsp;</DIV>
  763. <DIV CLASS="group" id=stylesheet>XSL Stylesheet&nbsp;
  764. <SELECT id=stylesheetSelect name=select2 onChange='UpdateStylesheet()' style="HEIGHT: 22px; WIDTH: 165px">
  765. <OPTION selected id=Raw value=Raw>Raw XML</OPTION>
  766. <OPTION id=MOF value=MOF>Managed Object Format</OPTION>
  767. <OPTION id=ClassNames value=ClassNames>Class Names</OPTION>
  768. <OPTION id=PropertyType value=PropertyType>Property Type Table</OPTION>
  769. <OPTION id=PropertyValue value=PropertyValue>Property Value Table</OPTION>
  770. <OPTION id=PropValue value=PropValue>Single Property Value</OPTION>
  771. <OPTION id=ClassPage value=ClassPage>Class Page</OPTION>
  772. <OPTION id=DetailPage value=DetailPage>Details Page</OPTION>
  773. </SELECT> <BR><BR>
  774. <HR>
  775. <LABEL>HTTP Response Status</LABEL> <SPAN STYLE="COLOR: red" ID="ResponseStatus"></SPAN>
  776. <HR>
  777. <LABEL>HTTP Response Headers</LABEL>
  778. <BR>
  779. <SPAN STYLE="COLOR: red" ID="ResponseHeaders"></SPAN></DIV>
  780. </BODY>
  781. </HTML>