【问题标题】:MSXML2.ServerXMLHTTP - The parameter is incorrectMSXML2.ServerXMLHTTP - 参数不正确
【发布时间】:2014-10-21 19:35:56
【问题描述】:

我正在尝试使用以下代码下载网页:

dim xmlhttp : set xmlhttp = createobject("MSXML2.ServerXMLHTTP")
dim fso : set fso = createobject ("scripting.filesystemobject")
dim newfile : set newfile = fso.createtextfile("getVersion.htm", true)

xmlhttp.SetOption SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, true
xmlhttp.open "GET", "https://mysite:8443/remote/epo.GetVersion", "username", "password"
xmlhttp.send

newfile.write (xmlhttp.responseText)
newfile.close

但是,它失败并显示“mxm13.dll:参数不正确”。在第 6 行。我做错了什么?

【问题讨论】:

    标签: xml vbscript


    【解决方案1】:

    open 的第三个rd 参数应该是一个布尔值,指定请求是否应该是异步的。

    oServerXMLHTTPRequest.open bstrMethod, bstrUrl, bAsync, bstrUser, bstrPassword
    

    bstrMethod
    用于打开连接的 HTTP 方法,例如 PUT 或 建议。对于 ServerXMLHTTP,此参数区分大小写,并且 方法名必须全部大写。
    bstrUrl
    请求的 URL。这可以是绝对 URL,例如 “http://example.com/Mypath/Myfile.asp”或相对 URL,例如 “../MyPath/MyFile.asp”。
    bAsync(可选)
    布尔值。指标 调用是否是异步的。默认值为 False(调用 不立即返回)。
    bstrUser(可选)
    用户名 身份验证。
    bstrPassword(可选)
    的密码 验证。如果用户参数为 为空或缺失。

    another question 的一些实验和帮助下,我认为你只需要改变

    xmlhttp.SetOption SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, true
    

    xmlhttp.SetOption 2, xmlhttp.GetOption(2) - SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS
    

    【讨论】:

    • 我试过加了真假,但还是一样。
    【解决方案2】:

    如果您使用的是 Windows 8、Windows 8.1 或 Windows Server 2012/2012R2,您可能需要应用以下 HotFix,它在类似情况下为我解决了这个问题:

    https://support.microsoft.com/en-us/help/2968741/error-0x80070057-when-sql-server-communicates-to-a-web-server-using-st

    更多信息,您也可以在我的博客上read this post 或查看this other SO thread

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-22
      • 2014-12-11
      • 2017-01-01
      • 2020-01-15
      • 1970-01-01
      • 1970-01-01
      • 2010-11-12
      相关资源
      最近更新 更多