Class SOAPClient
dim ResultCode
Public Function SOAPCall(SOAPURL,SOAPBody,Action)
on error resume next
Set XMLHTTP = CreateObject("Microsoft.XMLHTTP")
strMethodPkg = ""
strMethodPkg = strMethodPkg & ""
strMethodPkg = strMethodPkg & ""
strMethodPkg = strMethodPkg & SOAPBody
strMethodPkg = strMethodPkg & ""
XMLHTTP.Open "POST", SOAPURL, False
XMLHTTP.setrequestheader "Content-Type", "text/xml"
XMLHTTP.setrequestheader "SOAPAction", Action
XMLHTTP.Send strMethodPkg
if err then ResultCode = -1
SOAPCall = XMLHTTP.responseXML.xml
Set xmlhttp = Nothing
End Function
Public Function SOAPLogin(URL,Username,Password)
on error resume next
Set xmldom = CreateObject("Microsoft.XMLDOM")
xmldom.async = False
XMLStr="" & Username & "" & Password & ""
Action="/DoLogin"
xmldom.LoadXML(SOAPCall(URL,XMLStr,Action))
SOAPLogin = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/m:DoLoginResponse/LoginResult").Text
if SOAPLogin then ResultCode = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/m:DoLoginResponse/LoginURL").Text
Set xmldom = Nothing
End Function
Public Function SOAPRegUser(URL,Username,Password,BandMac,Email)
on error resume next
Set xmldom = CreateObject("Microsoft.XMLDOM")
xmldom.async = False
XMLStr="" & Username & "" & Password & "" & BandMac & "" & Email & ""
Action="/DoRegUser"
xmldom.LoadXML(SOAPCall(URL,XMLStr,Action))
SOAPRegUser = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/m:DoRegUserResponse/RegUserResult").Text
if SOAPRegUser<>"" then ResultCode = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/m:DoRegUserResponse/ErrorCode").Text
Set xmldom = Nothing
End Function
Public Function SOAPActiveUser(URL,Username,Password,BandMac,RegCode)
on error resume next
Set xmldom = CreateObject("Microsoft.XMLDOM")
xmldom.async = False
XMLStr="" & Username & "" & Password & "" & BandMac & "" & RegCode & ""
Action="/DoActiveUser"
xmldom.LoadXML(SOAPCall(URL,XMLStr,Action))
SOAPActiveUser = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/m:DoActiveUserResponse/ActiveUserResult").Text
if SOAPActiveUser<>"" then ResultCode = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/m:DoActiveUserResponse/ErrorCode").Text
Set xmldom = Nothing
End Function
Public Function SOAPModifyUser(URL,Password,NewPassword,BandMac,Email)
on error resume next
Set xmldom = CreateObject("Microsoft.XMLDOM")
xmldom.async = False
XMLStr="" & Password & "" & NewPassword & "" & BandMac & "" & Email & ""
Action="/DoModifyUser"
xmldom.LoadXML(SOAPCall(URL,XMLStr,Action))
SOAPModifyUser = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/m:DoModifyUserResponse/ModifyUserResult").Text
if SOAPModifyUser<>"" then ResultCode = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/m:DoModifyUserResponse/ErrorCode").Text
Set xmldom = Nothing
End Function
End Class