Recommended: 6 practical codes for asp to control the XML database NO.1--Create an XML database data.xm ?xml version=1.0? records record namecaca/name qq154222225/qq [email protected]/email /record records NO.2-Create object CreateObject CreateObject Create the object of data.xml first set xmldoc=server.createobjcet(microsoft.xmldom) xmld
ASP calls web services
<%
Function CallWebServices(sUrl, sMethodName, soapMessage, XmlString)
CallWebServices = false
Set xmlhttp = CreateObject(MSXML2.XMLHTTP)
xmlhttp.Open POST,sUrl, False
xmlhttp.SetRequestHeader Content-Type,text/xml; charset=utf-8
xmlhttp.SetRequestHeader SOAPAction,sUrl & / & sMethodName
xmlhttp.send(soapMessage)
'response.Write(xmlhttp.Status : & xmlhttp.Status & <br>)
'response.Write(xmlhttp.statusText : & xmlhttp.statusText & <br>)
'response.Write(xmlhttp.responseText : & xmlhttp.responseText & <br>)
'response.Write(xmlhttp.responseXML.xml : & xmlhttp.responseXML.xml & <br>)
if xmlhttp.Status = 200 then
CallWebServices = true
XmlString = xmlhttp.responseXML.xml
end if
Set xmlhttp = Nothing
End Function
%>
This method requires constructing a SOAP request string.
And calling web services in C# is much easier. Just add a WEB reference and you can use it like using your own class.
Share: The main methods and implementations of ASP operating XML files ASP uses XMLDom to operate XML files on the server side. For small data volumes, XML files have many advantages in retrieval and updates in ACCESS. I have tested that without using a database, I store all the member information of the website, product data information, transaction information, and website customization information in three xml files. The operation result is very normal, and it feels more than data