1. The client submits the request
Domain = "test.com"
SXml = "<? Xml version = "" 1.0 "" encoding = "" gb2312 ""?> "&_
"<Package> "&_
"<Domain>" & Domain & "</Domain> "&_
"</Package>"
Set oD = Server. CreateObject ("Microsoft. XMLHTTP ")
OD. Open "Post", "http: // Server/Domain_Check.jsp", False
OD. Send (sXml)
If oD. Status = 200 Then
Result = oD. responseText
Set o = Server. CreateObject ("Microsoft. XMLDOM ")
O. LoadXML (Result)
Domain = CInt (o. selectSingleNode ("// Result"). text)
Response. Write Domain
Set o = Nothing
Set oD = Nothing
End If
2. parsing data packets on the server side
<% @ Page import = "java. util. *" %>
<% @ Page import = "java. text. *" %>
<% @ Page import = "java. io. *" %>
<% @ Page import = "org. w3c. dom. *" %>
<% @ Page import = "javax. xml. parsers. *" %>
<% @ Page contentType = "text/html; charset = gbk" %>
<%
// Obtain the data packet
Request. setCharacterEncoding ("UTF-8 ");
BufferedReader in = request. getReader ();
String line;
String xmlRequest = "";
String domain_name = "";
While (line = in. readLine ())! = Null)
{
// Construct a data packet
XmlRequest = xmlRequest + line + "";
}
DocumentBuilderFactory factory = DocumentBuilderFactory. newInstance ();
DocumentBuilder db = factory. newDocumentBuilder ();
ByteArrayInputStream stream = new ByteArrayInputStream (xmlRequest. getBytes ("UTF-8 "));
Document doc = db. parse (stream );
Element root = doc. getDocumentElement ();
NodeList Domain = root. getElementsByTagName ("Domain ");
If (Domain. getLength () = 1 ){