简体   繁体   English

使用MSXML2.ServerXMLHTTP.6.0对基于https的Web服务进行SOAP发布时出现错误2147012858

[英]Error 2147012858 when doing a SOAP post to an https-based webservice using MSXML2.ServerXMLHTTP.6.0

Im trying to make a post to an https-based webservice using classic ASP, and it works, but most strange is that sometimes (randomly) it returns an error: 我试图使用经典ASP向基于https的web服务发帖,但它有效,但最奇怪的是有时(随机)它会返回错误:

"The host name in the certificate is invalid or does not match" “证书中的主机名无效或不匹配”

When the page returns this error, after some time (minutes), it starts working fine again without doing anything. 当页面返回此错误时,在一段时间(分钟)之后,它再次开始正常工作而不做任何事情。

Dim Result
Dim SoapRequest
Set SoapRequest = CreateObject("MSXML2.ServerXMLHTTP.6.0")

Dim myXML 
Set myXML = CreateObject("MSXML.DOMDocument")
myXML.Async=False
SoapRequest.Open "POST", sUrl, False
SoapRequest.setRequestHeader "Content-Type","text/xml; charset=utf-8"
SoapRequest.setRequestHeader "SOAPAction", """http://tempuri.org/" & sMethod & """"
SoapRequest.setRequestHeader "Authorization", "BASIC " & Base64Encode(Request.ServerVariables("AUTH_USER")&":"&Request.ServerVariables("AUTH_PASSWORD"))   

Dim DataToSend
DataToSend = GetEnvelop(sMethod, params)

SoapRequest.Send DataToSend

If myXML.load(SoapRequest.responseXML) Then
    Dim Node
    Set Node = myXML.documentElement.selectSingleNode("//" & sMethod & "Result")
    Result =  Node.Text

    Set Node = Nothing
Else
    Result =  getXML("Response", "1", "Error calling WebService: " & sUrl & ", WebMethod: " & sMethod & " xml response: " & SoapRequest.responseXML, "0")   
End If
Set SoapRequest = Nothing
Set myXML = Nothing

Well, the problem was the bindings, two sites pointing to the same domain, so the balancer made the thing work sometimes. 好吧,问题是绑定,两个站点指向同一个域,所以平衡器有时会使事情发生。 Hopefully now its working fine! 希望现在它的工作正常! :)))) :))))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM