Solved

reading correct node from SOAP

Posted on 2013-05-28
3
251 Views
Last Modified: 2016-02-10
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

0
Comment
Question by:rivkamak
  • 2
3 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 39203410
Try:
Set currNode = xmlDoc.getElementsByTagName("TINNAME_CODE").item(0)
0
 

Author Comment

by:rivkamak
ID: 39203437
Error on line 4 is telling me
Brief Description: Object doesn't support this property or method: 'xmlDoc'
0
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 39203457
>>line 4??
If are referring to:
xmlDoc.load(objXMLHTTP.responseText)

Make sure objXMLHTTP.responseText is returning what you are expecting.

If the problem persists try:
xmlDoc = Server.CreateObject("Msxml2.DOMDocument.3.0")

OR just:
xmlDoc = Server.CreateObject("Msxml2.DOMDocument")
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Connection String to remote Server not working 3 92
Microsoft SQL ADO Conn Issue 6 50
is this a cms? 8 67
Hide cell in a table 2 27
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question