在Classic ASP中使用安全的Web服务

时间:2017-12-13 08:41:03

标签: web-services iis https asp-classic

我是ASP经典和IIS的新手。我被赋予了从Classic ASP调用Web服务的任务。我已经实现了这一点。我写的代码如下:

<%
On Error Resume Next
Dim oRequest
Set oRequest = Server.CreateObject("Microsoft.XMLHTTP")

' HTTP URL
msURL = "http://10.6.10.65:8080/myweb/hello"

'HTTPS URL
'msURL = "https://10.6.10.65:8443/myweb/hello" 


msSOAP = "<?xml version=""1.0"" ?>"
msSOAP = msSOAP & "<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:ws=""http://ws.mkyong.com/"">"
msSOAP = msSOAP & "   <soapenv:Header/>"
msSOAP = msSOAP & "   <soapenv:Body>"
msSOAP = msSOAP & "      <ws:getHelloWorldAsString/>"
msSOAP = msSOAP & "   </soapenv:Body>"
msSOAP = msSOAP & "</soapenv:Envelope>"


oRequest.Open "POST", msURL, False
oRequest.setRequestHeader "Content-Type", "text/xml"
oRequest.send msSOAP

Response.Clear
Response.BinaryWrite oRequest.responseBody

if err.number <> 0 then
    response.write "Error detected: " & err.number & ": " & err.Description & ""
    Response.end
end if

on error goto 0
%>

这是一个简单的Hello World Web服务。

代码适用于http协议到网络服务(“http://10.6.10.65:8080/myweb/hello”)但是当我将我的网络服务的网址更改为https(“https://10.6.10.65:8443/myweb/hello”)时,我得到了以下内容:

检测到错误:-2147352571:007~ASP 0106~类型不匹配〜遇到未处理的数据类型。

这是非常模糊的错误..但我觉得我需要做点什么来完成这项工作。 Web服务位于网络中不同PC上的tomcat上。我在Windows Server 2008上安装了IIS 7.5。 请协助完成这项工作......我有点乱了

谢谢

1 个答案:

答案 0 :(得分:1)

尝试 oRequest.setOption 2,13056 创建对象后