Solved

reading correct node from SOAP

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

621 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