调用医保直连接口9102时,下载的数据流没有结果,请各位指点,代码如下:
http = Create oleobject
//li_rtn = http.ConnectToNewObject("Msxml2.XMLHTTP")
//li_rtn = http.ConnectToNewObject("Microsoft.XMLHttp")
li_rtn = http.ConnectToNewObject("MSXML2.ServerXMLHTTP")//网页有跳转的用这个
if li_rtn <> 0 then
ls_errtext = '连接Msxml2.XMLHTTP出错!'
goto Err
end if
try
http.Open("POST",as_url,false)
http.setRequestHeader("Content-Type","application/json;charset=utf-8")
http.setRequestHeader("x-tif-paasid",as_header[1]) //应用编码
http.setRequestHeader("x-tif-signature",as_header[2]) //签名
http.setRequestHeader("x-tif-timestamp",as_header[3]) //时间
http.setRequestHeader("x-tif-nonce",as_header[4]) //校验码
http.send(as_injson)
catch (runtimeerror e_open)
messagebox('提示','打开Msxml2.XMLHTTP出错!~r~n' + e_open.getmessage())
return -1
end try
do While http.readyState <> 4 //查询状态,延时
yield()
Loop
//ral_recode = http.Status //状态码
//ras_retext = http.StatusText //请求错误信息
string ls_StatusText
ls_StatusText = http.StatusText
IF http.Status <>200 then
ls_errtext = "接口返回:~r~n"+string( http.Status)+":"+ls_StatusText
goto Err
end if
as_outjson=space(1048576)
//bb_files=space(1048576)
if as_jkbh='9102' then
//rab_zipstr= http.responseblob
if gs_blobbz='1' then
bb_files= blob(http.responseText) //返回信息
as_outjson = string(bb_files)
else
as_outjson= string(http.responseText) //返回信息
end if
messagebox('结果',as_outjson )
返回值是:PK