<% '---调用WebService 获取Exchange2007已知用户的邮件未读数 '---参数说明---- 'url:webservice 的路径 'params:方法参数 'method:方法名称 'dataType:返回的数据类型 function webServices(url,params,method,dataType) set objXML=Server.CreateObject("MSXML2.XMLHTTP") objXML.open "post",url&"/"&method,false objXML.setRequestHeader "Content-Type","application/x-www-form-urlencoded" objXML.send(params) if objXML.Status=200 then Set xmlDOC = server.CreateObject("MSXML.DOMDocument") xmlDOC.load(objXML.responseXML) webServices = xmlDOC.documentElement.selectSingleNode("//"& dataType &"").text end if end function '调用示例: response.Write webServices("http://localhost:1936/Service1.asmx","username=yaling","GetNewMailCount","int") %>