经典ASP IIS 6.0下VBScript中的Server.CreateObject上的HTTP状态443

时间:2013-12-19 01:46:13

标签: vbscript asp-classic iis-6 com-interop

这是旧的遗留代码,已运行至少5年。该DLL恰好与Paypal的PayFlowPro商家处理服务有关,但我认为这是导致该问题的Windows方案。

突然,基于下面的代码,我在浏览器中看到了这个错误:

> Error with new credit card processing software, please call Neal at xxx-xxx-xxxx
> Error Ref102: client = Server.CreateObject returned Null
> (Detailed error: Object doesn't support this property or method)
> (Detailed error: 438)

IIS日志显示443:

2013-12-19 00:57:24 W3SVC4 173.45.87.10 POST /myapps/adm_settle.asp - 443 - 76.187.77.159 Mozilla/5.0+(Windows+NT+6.2;+WOW64;+rv:26.0)+Gecko/20100101+Firefox/26.0 200 0 0

自从我看到上面的433以来,我认为必定存在一些安全错误。就像测试一样,我尝试将app-pool用户放在Administrator组中,重新启动IIS,但仍然得到完全相同的错误。我还给了用户特定的访问权限来读取磁盘上的.DLL。

我确实运行了REGASM以尝试重新注册.DLL。我也尝试过REGSRV32,但我想在.NET DLL上失败了。自从我处理这个旧软件以来已经有几年了。

ASP / VBScript代码:

    Err.Clear 
    On Error Resume Next 
    set client = Server.CreateObject("PayPal.Payments.Communication.PayflowNETAPI")
    If Err.number > 0 Then 
       response.write "Error with new credit card processing software, please call Neal at xxx-xxx-xxxx" 
       response.write "</br>(Detailed error: " & Err.Description & ")" 
       response.write "</br>(Detailed error: " & Err.Number & ")" 
       response.End 
    End If 
    If client Is Nothing Then 
       Response.write "Error with new credit card processing software, please call Neal at xxx-xxx-xxxx" 
       Response.Write "</br>Error Ref101: client = Server.CreateObject returned 'nothing' "
       response.write "</br>(Detailed error: " & Err.Description & ")" 
       response.write "</br>(Detailed error: " & Err.Number & ")" 
       Response.End 
    End If 
    If client = null Then 
       Response.write "Error with new credit card processing software, please call Neal at xxx-xxx-xxxx" 
       Response.Write "</br>Error Ref102: client = Server.CreateObject returned Null "
       response.write "</br>(Detailed error: " & Err.Description & ")" 
       response.write "</br>(Detailed error: " & Err.Number & ")" 
       Response.End 
    End If 

另外,我不确定443 http状态如何变为438 Err.Number。

1 个答案:

答案 0 :(得分:0)

谢谢大家。我希望我保存了原来的错误。我一直在做C#这么久,我忘记了如何编写VBScript代码。我试图添加错误处理,这可能会给我错误的结果。

如果评论过的一些人会提出答案,我会接受他们的。

443是另一个虚假的错误,我认为这是一个错误,而不是一个端口#。

不幸的是,现在,我没有保存原始错误。我已经在我的原始代码中添加了代码以提供更好或更严格的错误处理,并且添加“= null”测试是一个坏主意。

这是对VBScript使用空vs vs no vs Null的一个非常好的解释:http://evolt.org/node/346/

我删除了,修正后的代码是:

    Err.Clear 
    On Error Resume Next 
    'set client = Server.CreateObject("PFProCOMControl.PFProCOMControl.1")
    set client = Server.CreateObject("PayPal.Payments.Communication.PayflowNETAPI")
    If Err.number > 0 Then 
       response.write "Error with new credit card processing software, please call Neal at 214-455-8060" 
       response.write "</br>(Detailed error: " & Err.Description & ")" 
       response.write "</br>(Detailed error: " & Err.Number & ")" 
       response.End 
    End If 
    If client Is Nothing Then 
       Response.write "Error with new credit card processing software, please call Neal at 214-455-8060" 
       Response.Write "</br>Error Ref101: client = Server.CreateObject returned 'nothing' "
       response.write "</br>(Detailed error: " & Err.Description & ")" 
       response.write "</br>(Detailed error: " & Err.Number & ")" 
       Response.End 
    End If