Oi galera, Sou iniciante no ASP e de cara já tenho que trabalhar com webservide :wacko: Mas vale o desafio... Bem, o webservice está funcionando. O problema é fazer a consumir ele no ASP. Até agora, cheguei no código abaixo: <%
Response.ContentType = "text/xml"
'requisita_dados.asp
'Página que faz a requisição passando um XML
strXml = ""
strXml = strXml & "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:wss='http://www.meusite.com.br/WSCliente/'>"
strXml = strXml & " <soapenv:Header>"
strXml = strXml & "<wss:AutenticacaoWebService>"
strXml = strXml & " <wss:Usuario>user</wss:Usuario>"
strXml = strXml & " <wss:Senha>1234</wss:Senha>"
strXml = strXml & " </wss:AutenticacaoWebService>"
strXml = strXml & " </soapenv:Header>"
strXml = strXml & " <soapenv:Body>"
strXml = strXml & " <wss:ConsultarPessoa>"
strXml = strXml & " <wss:cpf>12312312387</wss:cpf>"
strXml = strXml & " </wss:ConsultarPessoa>"
strXml = strXml & " </soapenv:Body>"
strXml = strXml & " </soapenv:Envelope>"
sUrl = "http://homologacao.meusite.com.br:8044/WSCliente/cadastro.asmx"
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
Set xmlResult = Server.CreateObject("MSXML2.DomDocument.3.0")
xmlResult.async = False
xmlhttp.Open "POST", sUrl, False
xmlhttp.Send strXml 'Envia o XML
xmlhttp.waitForResponse 200
xmlResult.loadXML(xmlhttp.ResponseText)
xmlResult.save(Server.MapPath("Teste.xml"))
response.write "Retorno XML inicio <BR><hr>"
if xmlResult.parseError.errorCode <> 0 then
response.write "Cod ERRO: " & xmlResult.parseError.errorCode
response.write "<br>"
response.write "Desc. ERRO: " & xmlResult.parseError.reason
else
Response.write xmlhttp.ResponseText
End if
response.write "<BR><hr>Retorno XML FIM<br>"
%>
XML recebido com sucesso. Isto está me retornando um XML vazio e o seguinte erro: Cod ERRO: -1072896680 Desc. ERRO: O documento XML deve ter um elemento de nível superior. valeu !!!