使用Msxml2.ServerXMLHTTP.6.0对象时,Web Service请求无法正常工作

时间:2014-10-06 07:21:00

标签: web-services asp-classic msxml

让我描述一下我所处的情况。目标是使用Web服务请求以获取所需的一些信息。当前实现使用Msxml2.XMLHTTP对象并按预期工作,但我们需要升级并使用Msxml2.ServerXMLHTTP.6.0对象。请查看提供的代码 - 测试asp页面。

Set myFile = CreateObject("Scripting.FileSystemObject")
Set myTextFile = myFile.OpenTextFile("C:\Inetpub\wwwroot\test\log.txt", 8, True, 0) 'for testing

Dim o_XmlhttpCaller
Dim soapMessage

dim WSSenderID
WSSenderID = "XXX"

dim WSPhone
WSPhone = "000"


On Error Resume Next

set o_XmlhttpCaller = server.CreateObject("Msxml2.ServerXMLHTTP.6.0")

o_XmlhttpCaller.setTimeouts 10000, 10000, 10000, 30000

o_XmlhttpCaller.setProxy 2, "<proxy>:<port>", "<ip of WebService's Server>"

o_XmlhttpCaller.setOption 2, 13056

o_XmlhttpCaller.open "POST", "https://<domain name of WebService's server>:7777/XXX?Wsdl", false

o_XmlhttpCaller.setRequestHeader "Content-Type", "text/xml; charset=utf-8"


o_XmlhttpCaller.setRequestHeader "SOAPAction", "https://<...>:7777/xxx..."


soapMessage = _
"<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" " & _
    "xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">" &_
    "<soapenv:Body>" &_
        "<getBasicInfosResponseElement xmlns=""http://XXX"">" &_
         "<accountNr></accountNr>" &_
         "<phoneNr>" & WSPhone & "</phoneNr>" &_
         "<requestorID>" & WSSenderID & "</requestorID>" &_
      "</getBasicInfosResponseElement>" &_
   "</soapenv:Body>" &_
"</soapenv:Envelope>"



o_XmlhttpCaller.send(soapMessage)

当我尝试解析响应时,我收到以下错误消息:

  

错误:无法解析WebService响应:   XmlHTTP就绪状态:4   XmlHTTP状态:502代理错误(不允许指定的安全套接字层(SSL)端口.Forefront TMG未配置为允许来自此端口的SSL请求。大多数Web浏览器使用端口443进行SSL请求。)

在搜索此错误消息时,找到的唯一解决方案与TMG端的ssl端口配置有关。

我认为这很奇怪,因为当使用以下代码时,当前的Web服务请求可以正常工作。

On Error Resume Next

Set o_XmlhttpCaller = Server.CreateObject("Msxml2.XMLHTTP")

o_XmlhttpCaller.open "POST", "https://<domain name of WebService's server>:7777/XXX?Wsdl", false

o_XmlhttpCaller.setRequestHeader "Content-Type", "text/xml; charset=utf-8"

o_XmlhttpCaller.setRequestHeader "SOAPAction", "https://<...>:7777/xxx..."

如果这是一个SSL端口问题,我认为问题应该出现在这种情况下,但事实并非如此。

您可以在此提供任何帮助吗?为了使用指定的对象设法正常工作应该怎么做?

0 个答案:

没有答案
相关问题