The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
I am getting below Error whem I am tryin to process below code :
Can not load XML: A string literal was expected, but no opening quote character was found
My XML is like :
Can not load XML: A string literal was expected, but no opening quote character was found
Code:
<%
Call consumeWebService
Sub consumeWebService
Dim webServiceUrl, httpReq, node, myXmlDoc
webServiceUrl = "http://www.clearmybaddebt.com/debt/reports/generateLeadID.asp?FirstName=TOM&LastName=SCOTT&City=MIAMI&State=FL&Phone=7863267522&LeadCreationDate=5/16/2008&TotalDebtAmount=13000&internalLeadID=19721&LeadCreationDate=5/16/2008"
Set httpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
httpReq.Open "GET", webServiceUrl, False
httpReq.Send
dpXML = httpReq.ResponseText
Set myXmlDoc =Server.CreateObject("MSXML2.DomDocument.3.0")
myXmlDoc.async = False
myXmlDoc.validateOnParse = False
myXmlDoc.resolveExternals = False
myXmlDoc.load(httpReq.responseBody)
Set httpReq = Nothing
If not myXmlDoc.LoadXml(dpXML) Then
ErrorMessage = "Can not load XML:" & vbCRLF & myXmlDoc.parseError.reason & vbCRLF & ErrorMessage
Response.write ErrorMessage
Response.write dpXML
End If
Set httpReq = Nothing ' clear HTTP object
Set RSSItems = myXmlDoc.getElementsByTagName("ErrorDescription")
RSSItemsCount = RSSItems.Length-1
Set myXmlDoc = Nothing ' clear XML
For i = 0 To RSSItemsCount
Set RSSItem = RSSItems.Item(i)
for each child in RSSItem.childNodes
Select case lcase(child.nodeName)
case "ErrorDescription"
Response.write child.text
Response.write ErrorMessage
End Select
next
next
End Sub
%>
My XML is like :
<?xml version="1.0" encoding="utf-8" ?><
- <returnMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=http://www.abcsite.com/>
<ErrorName>Lead Import Error.</ErrorName>
<ErrorDescription>Invalid Login Attempt. Your lead has not been imported. Please review system documentation for required fields and data types. For further help please call xxx-xxx-xxxx.</ErrorDescription>
<LeadID />
<ClientAvailable>true</ClientAvailable>
</returnMessage>