debugging.asp

来自「xml文件处理源代码。asp编写」· ASP 代码 · 共 101 行

ASP
101
字号
<html>
<head>
<title>David Carter-Tod: Debugging Client</title>
<meta name="description" content="Using XML within ASP pages">
<meta name="keywords" content="XML, XML-RPC, ASP, Active Server Pages, Internet Explorer, NT, Windows">
<meta name="generator" content="Frontier 6.0 Win95"></head>
<body bgcolor="#FFFFFF" alink="#008000" vlink="#800080" link="#0000FF">
<a href="http://www.chre.vt.edu/dtod/">David Carter-Tod</a> --> <a href="../default.asp">XML-RPC</a> --> Debugging Client
<HR noshade size=1>
<table border=0 width=100% cellpadding=10 cellspacing=5>
	<tr>
		<TD width=100 bgcolor="#EEEEEE" valign=top>
			<font size="-1">
			<h3>XML-RPC</H3>
-&nbsp;<a href="../default.asp">XML-RPC</a><P>
-&nbsp;<a href="../clientEg/aboutClient.asp">XML-RPC Client</a><P>
-&nbsp;<a href="../aboutServer.asp">XML-RPC Server</a><P>
-&nbsp;<a href="../download.asp">Download the Code</a><P>
<hr>
-&nbsp;<a href="../scriptingNews.asp">Scripting News via XML</a><P>

			</font>
			</td>
		<td valign=top>
			<h3>Debugging Client</h3>
			<hr noshade>
			

<!--#include virtual="/dtod/xmlrpcb2/code/xmlrpc.asp" -->
<%
on error resume next
if NOT Request.form("who") = "" then
	Dim paramList(1)
	paramList(0)=Request.form("who")
	Response.write("<pre>" & Replace(functionToXML("helloWorld", paramList), "<", "&lt;", 1, -1, 1) & "</pre>")
	myresp = xmlRPC ("http://www.wc.cc.va.us/dtod/xmlrpcb2/code/server.asp", "helloWorld", paramList)
	response.write(myresp & "<p>")
	Response.write("<pre>" & Replace(serverResponseText, "<", "&lt;", 1, -1, 1) & "</pre>")
end if
if err.number <>0 then
	response.write("Error number: " & err.number & "<P>")
	response.write("Error description: " & err.description & "<P>")
else
	response.write(myresp)
end if
%>

<form method=post action=debugging.asp>
Type your name and say hello -- this time you'll see the XML passed back and forth: <input type=text name=who><p>
<input type=submit value="Say Hello">
</form>

<hr>
<h3>The Code</H3>
Let's say that the code wasn't working.  There are obviously a number of places where you can look, but it's nice to be able to look at what you're passing to and getting from the server.  You can do that, and you should also put error handlers in:<P>

<font size=-1><pre>
&lt;!--#include virtual="/dtod/xmlrpcb2/code/xmlrpc.asp" -->
&lt;%
on error resume next
if NOT Request.form("who") = "" then
	Dim paramList(1)
	paramList(0)=Request.form("who")

	' WHAT AM I SENDING TO THE SERVER
	Response.write("&lt;pre>" & Replace(functionToXML("helloWorld", paramList), "<", "&amp;lt;", 1, -1, 1) & "&lt;/pre>")

	myresp = xmlRPC ("http://www.wc.cc.va.us/dtod/xmlrpcb2/code/server.asp", "helloWorld", paramList)
	response.write(myresp & "&lt;p>")

	' WHAT AM I GETTING FROM THE SERVER
	Response.write("&lt;pre>" & Replace(serverResponseText, "<", "&amp;lt;", 1, -1, 1) & "&lt;/pre>")

end if
if err.number <>0 then
	response.write("Error number: " & err.number & "&lt;P>")
	response.write("Error description: " & err.description & "&lt;P>")
else
	response.write(myresp)
end if
%>
</pre></font>
<ul>
<li><a href="../clientEg/helloWorld.asp">Hello World</a>
<li><a href="../clientEg/bettygetStateName.asp">Get State Name</a>
<li><a href="../clientEg/bettyGetStateStruct.asp">Get State Struct</a>
<li><a href="../clientEg/bettygetStateList.asp">Get State List</a>
<li><a href="../clientEg/superHello.asp">Hello World Again</a>
<li><a href="../clientEg/bettyerror.asp">Error Example</a>
<li><a href="../clientEg/debugging.asp">Debugging Client</a>
</ul>

			</td>
		</tr>
	</table>
<HR noshade size=1>
<p align=right>
	E-mail: <a href="mailto:dtod@vt.edu">dtod@vt.edu</a>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?