ASP经典XML SOAP

时间:2018-08-22 18:32:27

标签: xml soap asp-classic

当我使用下面的代码执行SOAP Web服务请求时,一切顺利,直到XML解析器,然后发生以下错误:

 Server.scripttimeout = 10000
 response.Charset = "utf-8" 
 response.ContentType = "text/html"

 UrlWS = "https://pje.tjmg.jus.br/pje/intercomunicacao"
 Login = "94134863104"
 Senha = "wd250882"
 incluirCabecalho = "true"
 movimentos = "true"
 incluirDocumentos = "false"
 Processo = "5145234-23.2017.8.13.0024"

 SOAPRequest = "<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:ser=""http://www.cnj.jus.br/servico-intercomunicacao-2.2.2/"" xmlns:tip=""http://www.cnj.jus.br/tipos-servico-intercomunicacao-2.2.2"">"
 SOAPRequest = SOAPRequest & "<soapenv:Header/>"
 SOAPRequest = SOAPRequest & "<soapenv:Body>"
 SOAPRequest = SOAPRequest & "<ser:consultarProcesso>"
 SOAPRequest = SOAPRequest & "<tip:idConsultante>" & Login & "</tip:idConsultante>"
 SOAPRequest = SOAPRequest & "<tip:senhaConsultante>" & Senha & "</tip:senhaConsultante>"
 SOAPRequest = SOAPRequest & "<tip:numeroProcesso>" & Processo & "</tip:numeroProcesso>"
 SOAPRequest = SOAPRequest & "<!--Optional:--><tip:dataReferencia>?</tip:dataReferencia>"
 SOAPRequest = SOAPRequest & "<!--Optional:--><tip:movimentos>" & movimentos & "</tip:movimentos>"
 SOAPRequest = SOAPRequest & "<!--Optional:--><tip:incluirCabecalho>" & incluirCabecalho & "</tip:incluirCabecalho>"
 SOAPRequest = SOAPRequest & "<!--Optional:--><tip:incluirDocumentos>" & incluirDocumentos & "</tip:incluirDocumentos>"
 SOAPRequest = SOAPRequest & "<!--Zero or more repetitions:--><tip:documento>?</tip:documento>"
 SOAPRequest = SOAPRequest & "</ser:consultarProcesso>"
 SOAPRequest = SOAPRequest & "</soapenv:Body>"
 SOAPRequest = SOAPRequest & "</soapenv:Envelope>"


 Set oXmlHTTP = CreateObject("MSXML2.XMLHTTP")
 oXmlHTTP.Open "POST", UrlWS, False 
 oXmlHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
 oXmlHTTP.setRequestHeader "SOAPAction", UrlWS
 oXmlHTTP.setRequestHeader "MessageType", "CALL"
 oXmlHTTP.setRequestHeader "Content-Length", Len(SOAPRequest)
 oXmlHTTP.send SOAPRequest 
 Response.write("Status: " & oXmlHTTP.Status & "<br>")

Resultado = oXmlHTTP.ResponseText

Set vxml = Server.CreateObject("MSXML2.DOMDocument.6.0") 
 vxml.LoadXml(Resultado)

 For Each node in vxml.selectSingleNode("/polo")
     sResult = sResult & node.NodeName
 Next

 Response.Write Server.HTMLEncode(sResult) 

 if err.number <> 0 then Response.write "Erro: " & err.description
  

错误:| 78 | 800a01a8 | Object_required:_'[object]'HTTP / 1.1

在这一行:

 For Each node in vxml.selectSingleNode("/polo")

我该如何解决?

0 个答案:

没有答案