Solved

reading correct node from SOAP

Posted on 2013-05-28
3
253 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
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 …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

710 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