Link to home
Start Free TrialLog in
Avatar of rivkamak
rivkamakFlag for United States of America

asked on

reading correct node from SOAP

I have a returned SOAP I am trying to pull out the text out of the nodes using classic ASP.
I am hitting an error. How can I get the Tin_code out of the xml?
 xmlDoc = Server.CreateObject("Msxml2.DOMDocument.6.0")

xmlDoc.async = false
xmlDoc.load(objXMLHTTP.responseText)
if xmlDoc.parseError.errorCode <> 0 then
   myErr = xmlDoc.parseError
   Response.write("You have error " + myErr.reason)
else
   xmlDoc.setProperty "SelectionLanguage", "XPath"
   currNode = xmlDoc.selectSingleNode("//ValidateTinNameResponse/ValidateTinNameResult/TINNAME_CODE")
   Response.write(currNode.text)
end if 

Open in new window


The soap looks like this.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ValidateTinNameResponse xmlns="http://www.TinCheck.com/WebServices/PVSService/">
      <ValidateTinNameResult>
        <TINNAME_CODE>byte</TINNAME_CODE>
        <TINNAME_DETAILS>string</TINNAME_DETAILS>
        <DMF_CODE>byte</DMF_CODE>
        <DMF_DETAILS>string</DMF_DETAILS>
        <DMF_DATA>string</DMF_DATA>
      </ValidateTinNameResult>
    </ValidateTinNameResponse>
  </soap:Body>
</soap:Envelope>

Open in new window

Avatar of hielo
hielo
Flag of Wallis and Futuna image

Try:
Set currNode = xmlDoc.getElementsByTagName("TINNAME_CODE").item(0)
Avatar of rivkamak

ASKER

Error on line 4 is telling me
Brief Description: Object doesn't support this property or method: 'xmlDoc'
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial