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


这个是报错的地方,集中XMLHTTP形式都是报这个错误的,不要说服务器安装两个组件,已经试过了,是不行的。下面我提供下源码,寻大神帮我解决下。
<!--#include file="md5.asp"-->
<!--#include file="Base64.asp"-->
<!--#include file="../../../Template/conn.asp"-->

<%
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&"<GoodsName>"&proname(rs("proid"))&"</GoodsName><Qty>"&rs("quantity")&"</Qty><Price>"&formatnumber(rs("quantity")*saleprice(rs("proid")),2)&"</Price>"
rs.movenext
loop
end if
rs.close
set rs=nothing

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


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

baseStr="<?xml version='1.0' encoding='UTF-8' ?><Order>"
baseStr =baseStr&"<MerNo>"&MerNo&"</MerNo>" 
baseStr =baseStr&"<shopName>www.liusports.com</shopName>"
baseStr =baseStr&"<BillNo>"&BillNo&"</BillNo>"
baseStr =baseStr&"<GoodsList>"&GoodsList&"</GoodsList>"
baseStr =baseStr&"<Freight>"&Freight&"</Freight>"
baseStr =baseStr&"<CurrencyCode>"&CurrencyCode&"</CurrencyCode>"
baseStr =baseStr&"<BFirstName>"&BFirstName&"</BFirstName>"
baseStr =baseStr&"<BLastName>"&BLastName&"</BLastName>"
baseStr =baseStr&"<Phone>"&Phone&"</Phone>"
baseStr =baseStr&"<Email>"&Email&"</Email>"

baseStr =baseStr&"<BillCity>"&BillCity&"</BillCity>"
baseStr =baseStr&"<BillState>"&BillState&"</BillState>"
baseStr =baseStr&"<BillCountry>"&BillCountry&"</BillCountry>"

baseStr =baseStr&"<ShipState>"&BillState&"</ShipState>"
baseStr =baseStr&"<ShipCity>"&BillCity&"</ShipCity>"
baseStr =baseStr&"<ShipAddress>"&BillAddress&"</ShipAddress>"
baseStr =baseStr&"<ShipZip>"&BillZip&"</ShipZip>"

baseStr =baseStr&"<SFirstName>"&BFirstName&"</SFirstName>"
baseStr =baseStr&"<SLastName>"&BLastName&"</SLastName>"
baseStr =baseStr&"<MD5info>"&MD5info&"</MD5info>"
baseStr =baseStr&"<CardNo>"&CardNo&"</CardNo>"
baseStr =baseStr&"<IssuingBank>"&IssuingBank&"</IssuingBank>"
baseStr =baseStr&"<CVV>"&CVV&"</CVV>"
baseStr =baseStr&"<ExpireYear>"&ExpireYear&"</ExpireYear>"
baseStr =baseStr&"<ExpireMonth>"&ExpireMonth&"</ExpireMonth>"
baseStr =baseStr&"<Language>"&Language&"</Language>"
baseStr =baseStr&"<LangCode>"&LangCode&"</LangCode>"
baseStr =baseStr&"<Currency>"&Curr&"</Currency>"
baseStr =baseStr&"<ReturnURL>"&ReturnURL&"</ReturnURL>"
baseStr =baseStr&"<Remark></Remark>"
baseStr =baseStr&"<AcceptLanguage>"&AcceptLanguage&"</AcceptLanguage>"
baseStr =baseStr&"<UserAgent>"&UserAgent&"</UserAgent>"
baseStr =baseStr&"<Ipaddress>"&Ipaddress&"</Ipaddress>"
baseStr =baseStr&"</order>"

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)
%>

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页