Using SOAP from inside ASP,maybe helpful for you-xml教程
转载自:互联网 作者:cd3c.com
您正在看的xml教程是:Using SOAP from inside ASP,maybe helpful for you。 default.asp
------------------------------------------------------------------------
<%@ Language=VBScript %>
<%Option Explicit%>
<%
Dim ASPNETResources
If len( Application("ASPNETResourceList") )>0 then 'we have our latest resources
REM -- check to see if they expired
If DateDiff("h",Now(),Application("ASPNETResourcesUpdated")) > Application("ASPNETExpires") Then
REM -- we need to update the latest resurces
ASPNETResources = GetASPNetResources()
Application.Lock
Application("ASPNETResourcesUpdated")=Now()
Application("ASPNETResourceList")=ASPNETResources
Application.UnLock
End if 'datediff...
Else 'for some reason the application level variable is empty, fill it.
ASPNETResources = GetASPNetResources()
Application.Lock
Application("ASPNETResourcesUpdated")=Now()
Application("ASPNETResourceList")=ASPNETResources
Application.UnLock
End if 'len(..
Response.Write Application("ASPNETResourceList")
%>
global.asa
------------------------------------------------------------------------
Sub Application_OnStart
Dim ASPNETResources
ASPNETResources = GetASPNetResources()
Application("ASPNETExpires") = 12 'set the content to expire in 12 hours.
If Len(ASPNETResources) >0 then 'populate the application level variables
Application.Lock
Application("ASPNETResourcesUpdated")=Now()
Application("ASPNETResourceList")=ASPNETResources
Application.UnLock
End if
End Sub
i_soapcall.asp
-----------------------------------------------------------------------
Function GetASPNetResources()
Dim returnString
Dim myXML
Dim SoapRequest
Dim SoapURL
Set SoapRequest = Server.CreateObject("MSXML2.XMLHTTP")
Set myXML =Server.CreateObject("MSXML.DOMDocument")
myXML.Async=False
SoapURL = "http://64.85.12.73/WebSvc/whatsnew123apx_ds.asmx/GetNew123aspXResources?"
SoapRequest.Open "GET",SoapURL , False
SoapRequest.Send()
if Not myXML.load(SoapRequest.responseXML) then 'an Error loading XML
returnString = ""
[1] [2] 下一篇
