Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用MSXML2.ServerXMLHTTP.6.0 VB6的XML-RPC HTTPS POST_Vb6_Https_Xml Rpc_Serverxmlhttp - Fatal编程技术网

使用MSXML2.ServerXMLHTTP.6.0 VB6的XML-RPC HTTPS POST

使用MSXML2.ServerXMLHTTP.6.0 VB6的XML-RPC HTTPS POST,vb6,https,xml-rpc,serverxmlhttp,Vb6,Https,Xml Rpc,Serverxmlhttp,在VB6中使用MSXML2.ServerXMLHTTP.6.0的RPC 我正在与之通信的服务器通过端口40052和 自我签名CA,我希望在发布之前,我已经试着让它工作了大约2天 有人可以帮忙 我的问题是当我调用Send方法时 如果未忽略ssl错误,则表示证书颁发机构无效 如果忽略ssl错误,则表示服务器返回了无效或未聚合的响应 Dim strXml As String Dim xmlLength As Integer strXml = "<?xml version=""1.0""?>

在VB6中使用MSXML2.ServerXMLHTTP.6.0的RPC

我正在与之通信的服务器通过端口40052和 自我签名CA,我希望在发布之前,我已经试着让它工作了大约2天 有人可以帮忙

我的问题是当我调用Send方法时

如果未忽略ssl错误,则表示证书颁发机构无效

如果忽略ssl错误,则表示服务器返回了无效或未聚合的响应

Dim strXml As String
Dim xmlLength As Integer

strXml = "<?xml version=""1.0""?><methodCall> " & _
                 "<methodName>somemethod</methodName> " & _
                 "<params> " & _
                 "<param><value><string>en</string></value></param>" & _
                 "<param><value><string>something</string></value></param>" & _
                 "<param><value><string>00000</string></value></param>" & _
                 "<param><value><string>000000000000000000000</string></value></param>" & _
                 "</params>" & _
                 "</methodCall>"
xmlLength = Len(strXml)

' object to communicate with
Set xmlHttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")

'since the server i am communicating with is using a self signed certificate authority
' I have to ignore all ssl errors.
xmlHttp.setOption 2, 13056 


' I set the friendlyname of my certificate just in case i have tried with and without
xmlHttp.setOption 3, "myrealfriendlynameofcrt"

' I open the connection with the server.
' the server is NOT USING 443 for ssl it's using 50042
xmlHttp.Open "POST", "https://hostname.com:50042", False

' I specify my content type
xmlHttp.SetRequestHeader "Content-Type", "text/xml"

' I specify my content length (I did try with this line and without)
xmlHttp.SetRequestHeader "Content-Length", xmlLength

' I send my request ( MY ERROR OCCURS HERE )
' IF SSL ERRORS NOT IGNORE IT SAYS INVALID CERTIFICATE AUTHORITY
' IF SSL ERRORS IGNORED IT SAYS THE SERVER RETURNED AN INVALID OR UNRECOGNIZED RESPONSE
xmlHttp.send strXml

If xmlHttp.Status >= 400 And xmlHttp.Status <= 599 Then
    Debug.Print "Error occured : " & xmlHttp.Status & " - " & xmlHttp.StatusText
Else
    Debug.Print xmlHttp.ResponseText
End If

Set xmlHttp = Nothing
Dim strXml作为字符串
Dim xmlLength作为整数
strXml=”“&_
“somemethod”和_
" " & _
"恩"及_
“某物”&_
"00000" & _
"000000000000000000000" & _
"" & _
""
xmlength=Len(strXml)
'要与之通信的对象
设置xmlHttp=CreateObject(“MSXML2.ServerXMLHTTP.6.0”)
'因为与我通信的服务器正在使用自签名证书颁发机构
'我必须忽略所有ssl错误。
xmlHttp.setOption 213056
“我设置了证书的friendlyname,以防我尝试使用或不使用
xmlHttp.setOption 3,“myrealfriendlynameofcrt”
'我打开了与服务器的连接。
'服务器没有使用443进行ssl,而是使用50042
xmlHttp.Open“POST”https://hostname.com:50042”“错
'我指定我的内容类型
xmlHttp.SetRequestHeader“内容类型”、“文本/xml”
'我指定了我的内容长度(我尝试了使用这一行和不使用这一行)
xmlHttp.SetRequestHeader“内容长度”,xmlLength
'我发送我的请求(我的错误发生在此处)
'如果SSL错误未被忽略,则表示证书颁发机构无效
'如果忽略SSL错误,则表示服务器返回了无效或无法识别的响应
xmlHttp.send strXml

如果XMLHTTP.STATE > 400和XMLHTTP.STATE在XP/WIN23.3中指定SSL连接的端口号时,存在“<代码> ServxMLHTTP</代码>”的问题。即使在较新的窗口中,问题似乎也发生了,但是我们必须用C++接口来生成C++的DLL,该接口声明C++中的VB6 BLASH,以便进行通信。