Solved

reading correct node from SOAP

Posted on 2013-05-28
3
244 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now