关于MSXML2.XMLHTTP组件报错的问题,寻大神解决


这个是报错的地方,集中XMLHTTP形式都是报这个错误的,不要说服务器安装两个组件,已经试过了,是不行的。下面我提供下源码,寻大神帮我解决下。




<%
CardNo        =    request.Form("CardNo")
CVV           =    request.Form("CVV")
ExpireMonth   =    request.Form("ExpireMonth")
ExpireYear    =    request.Form("ExpireYear")
IssuingBank   =    request.Form("IssuingBank")

BFirstName    =    request.Form("BFirstName")
BLastName     =    request.Form("BLastName")
BillAddress   =    request.Form("BillAddress")
BillCity      =    request.Form("BillCity")
BillState     =    request.Form("BillState")
BillZip       =    request.Form("BillZip")

Country       =    request.Form("Country")
Email         =    request.Form("Email")
Phone         =    request.Form("Phone")

MerNo         =    request.Form("MerNo")
BillNo        =    Request.Form("BillNo")
Freight       =    "0.00"
Amount        =    Request.Form("Amount")
CurrencyCode  =    "USD"
Language      =    2
Curr          =    15
ReturnURL     =    "http://"&weburl&"/paymentway/hooppay/Change_Order_Status.asp"
MD5key        =    Request.Form("MD5info")
Fee           =    "0.00"
LangCode      =     "EN"
AcceptLanguage=     request.servervariables("HTTP_ACCEPT_LANGUAGE")
UserAgent     =     request.servervariables("HTTP_USER_AGENT")
Ipaddress     =     request.servervariables("REMOTE_ADDR")

'根据编号获取产品名称
function proname(Pid)
set rsp=server.CreateObject("adodb.recordset")
rsp.open "select * from ph_products where id="&Pid,conn,1,1
if not rsp.eof and not rsp.bof then
proname=rsp("proname")
end if
rsp.close
set rsp=nothing
end function

'根据编号获取产品价格
function saleprice(Pid)
set rsp=server.CreateObject("adodb.recordset")
rsp.open "select * from ph_products where id="&Pid,conn,1,1
if not rsp.eof and not rsp.bof then
saleprice=rsp("saleprice")
end if
rsp.close
set rsp=nothing
end function

Function getHTTPPage(url) 
dim http 
set http=Server.createobject("MSXML2.XMLHTTP") 
Http.open "post",url,false 
Http.send()
if Http.readystate<>4 then
    exit function 
end if 
getHTTPPage=bytesToBSTR(Http.responseBody,"UTF-8")
set http=nothing
if err.number<>0 then err.Clear 
End function

Function BytesToBstr(body,Cset) 
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream=nothing
End Function

'封装产品信息
set rs=server.CreateObject("adodb.recordset")
rs.open "Select * From ph_myorder Where orderid in(Select id From ph_order Where orderno='"&BillNo&"')",conn,1,1
if not rs.eof and not rs.bof then
do while not rs.eof
GoodsItem=GoodsItem&""&proname(rs("proid"))&""&rs("quantity")&""&formatnumber(rs("quantity")*saleprice(rs("proid")),2)&""
rs.movenext
loop
end if
rs.close
set rs=nothing

GoodsList= ""&GoodsItem&""
md5src  = MerNo&BillNo&Freight&Amount&Fee&CurrencyCode&ReturnURL&Email&MD5key
'调用md5.asp中的MD5方法进行加密
MD5info=Ucase(MD5(md5src))


'将所有参数和值封装成为一个xml格式的字符串
Dim baseStr

baseStr=""
baseStr =baseStr&""&MerNo&"
baseStr =baseStr&"www.liusports.com"
baseStr =baseStr&""&BillNo&""
baseStr =baseStr&""&GoodsList&""
baseStr =baseStr&""&Freight&""
baseStr =baseStr&""&CurrencyCode&""
baseStr =baseStr&""&BFirstName&""
baseStr =baseStr&""&BLastName&""
baseStr =baseStr&""&Phone&""
baseStr =baseStr&""&Email&""

baseStr =baseStr&""&BillCity&""
baseStr =baseStr&""&BillState&""
baseStr =baseStr&""&BillCountry&""

baseStr =baseStr&""&BillState&""
baseStr =baseStr&""&BillCity&""
baseStr =baseStr&""&BillAddress&""
baseStr =baseStr&""&BillZip&""

baseStr =baseStr&""&BFirstName&""
baseStr =baseStr&""&BLastName&""
baseStr =baseStr&""&MD5info&""
baseStr =baseStr&""&CardNo&""
baseStr =baseStr&""&IssuingBank&""
baseStr =baseStr&""&CVV&""
baseStr =baseStr&""&ExpireYear&""
baseStr =baseStr&""&ExpireMonth&""
baseStr =baseStr&""&Language&""
baseStr =baseStr&""&LangCode&""
baseStr =baseStr&""&Curr&""
baseStr =baseStr&""&ReturnURL&""
baseStr =baseStr&""
baseStr =baseStr&""&AcceptLanguage&""
baseStr =baseStr&""&UserAgent&""
baseStr =baseStr&""&Ipaddress&""
baseStr =baseStr&"
"

Dim TradeInfo 
'Server.UrlEncode函数将字符串以URL编码
TradeInfo=Server.UrlEncode(baseStr)
'调用base64.asp中的base64Encode方法进行加码
TradeInfo=base64Encode(TradeInfo)
Crpurl="https://bill.virtuousbill.com/payment/DirPaymentProcess?TradeInfo="&TradeInfo
'response.Write Crpurl
'response.end
rpread=getHTTPPage(Crpurl)
response.Write(rpread)
%>

你可能感兴趣的:(关于MSXML2.XMLHTTP组件报错的问题,寻大神解决)