XML client response error

XML client response error

am 18.06.2005 06:09:03 von westernnord

I am using IIS on Windows XP and getting the following error:

Microsoft VBScript runtime (0x800A01A8)
Object required: 'getElementsByTagName(...).item(...)'
/sds-test/courierXML3.asp, line 161


Here is the code I'm using:

Set xml = Server.CreateObject("Microsoft.XMLHTTP")

xml.open "post", "http://localhost/xmlListener3.asp", False

xml.setRequestHeader "Content-Type", "text/xml; charset=utf-8"

xml.send Reg

set xmlObj = Server.CreateObject("Microsoft.XMLDOM")

xmlObj.async = false

xmlObj.Load Request

OrderID = xmlObj.getElementsByTagName("OrderID").item(0).text

Set xml = nothing

Set xmlObj = nothing

On the server I have no problems, but I don't understand why I get the above
error on the client. Hope someone here can give me a clue.

Re: XML client response error

am 19.06.2005 10:41:43 von Jon

I know very little about XML ... but from what I can tell is that the error
is relating to this line.

OrderID = xmlObj.getElementsByTagName("OrderID").item(0).text

Sorry if I have stated the obvious but you said you did not have any idea.
It may be your use of .text at the end?? Should it be .value?
Also do the array items start at 0 or 1?

Just a couple of ideas to try and help solve the problem.

Hope these help


--
Jon
warpedpixel@gmail.com
Look at that dead pixel on your screen! *SLAP* Gotcha!
wrote in message
news:%23tKjEu7cFHA.2180@TK2MSFTNGP12.phx.gbl...
>I am using IIS on Windows XP and getting the following error:
>
> Microsoft VBScript runtime (0x800A01A8)
> Object required: 'getElementsByTagName(...).item(...)'
> /sds-test/courierXML3.asp, line 161
>
>
> Here is the code I'm using:
>
> Set xml = Server.CreateObject("Microsoft.XMLHTTP")
>
> xml.open "post", "http://localhost/xmlListener3.asp", False
>
> xml.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
>
> xml.send Reg
>
> set xmlObj = Server.CreateObject("Microsoft.XMLDOM")
>
> xmlObj.async = false
>
> xmlObj.Load Request
>
> OrderID = xmlObj.getElementsByTagName("OrderID").item(0).text
>
> Set xml = nothing
>
> Set xmlObj = nothing
>
> On the server I have no problems, but I don't understand why I get the
> above error on the client. Hope someone here can give me a clue.
>
>

Re: XML client response error

am 20.06.2005 03:20:59 von westernnord

Thanks Jon for taking the time to look at my problem. The syntax of the
error code line is the same as I am using on the server and it works fine.
Item arrays do start at 0 not 1. item(0) refers to the first occurance of
the tag.

Richard
"Jon" wrote in message
news:e8Cp4qKdFHA.892@tk2msftngp13.phx.gbl...
>I know very little about XML ... but from what I can tell is that the error
>is relating to this line.
>
> OrderID = xmlObj.getElementsByTagName("OrderID").item(0).text
>
> Sorry if I have stated the obvious but you said you did not have any idea.
> It may be your use of .text at the end?? Should it be .value?
> Also do the array items start at 0 or 1?
>
> Just a couple of ideas to try and help solve the problem.
>
> Hope these help
>
>
> --
> Jon
> warpedpixel@gmail.com
> Look at that dead pixel on your screen! *SLAP* Gotcha!
> wrote in message
> news:%23tKjEu7cFHA.2180@TK2MSFTNGP12.phx.gbl...
>>I am using IIS on Windows XP and getting the following error:
>>
>> Microsoft VBScript runtime (0x800A01A8)
>> Object required: 'getElementsByTagName(...).item(...)'
>> /sds-test/courierXML3.asp, line 161
>>
>>
>> Here is the code I'm using:
>>
>> Set xml = Server.CreateObject("Microsoft.XMLHTTP")
>>
>> xml.open "post", "http://localhost/xmlListener3.asp", False
>>
>> xml.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
>>
>> xml.send Reg
>>
>> set xmlObj = Server.CreateObject("Microsoft.XMLDOM")
>>
>> xmlObj.async = false
>>
>> xmlObj.Load Request
>>
>> OrderID = xmlObj.getElementsByTagName("OrderID").item(0).text
>>
>> Set xml = nothing
>>
>> Set xmlObj = nothing
>>
>> On the server I have no problems, but I don't understand why I get the
>> above error on the client. Hope someone here can give me a clue.
>>
>>
>
>

Re: XML client response error

am 20.06.2005 11:22:29 von reb01501

westernnord@webtv.net wrote:
> I am using IIS on Windows XP and getting the following error:
>
> Microsoft VBScript runtime (0x800A01A8)
> Object required: 'getElementsByTagName(...).item(...)'
> /sds-test/courierXML3.asp, line 161
>
>
> Here is the code I'm using:
>
> Set xml = Server.CreateObject("Microsoft.XMLHTTP")
>
> xml.open "post", "http://localhost/xmlListener3.asp", False
>
> xml.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
>
> xml.send Reg
>
> set xmlObj = Server.CreateObject("Microsoft.XMLDOM")
>
> xmlObj.async = false
>
> xmlObj.Load Request
>
> OrderID = xmlObj.getElementsByTagName("OrderID").item(0).text
>
> Set xml = nothing
>
> Set xmlObj = nothing
>
> On the server I have no problems, but I don't understand why I get
> the above error on the client. Hope someone here can give me a clue.

You'll probably get a better response on a client-side scripting newsgroup
such as .scripting.vbscript (you do realize that by using vbscript on the
client you are restricting yourself to IE-users here).

You should realize, in the client, there is no such thing as a Server
object. That is only available in server-side code. "Server" is an object
provided by the ASP environment, which simply does not exist on the client.
So your first task is to change

Set xml = Server.CreateObject("Microsoft.XMLHTTP")

to

Set xml = CreateObject("Microsoft.XMLHTTP")


and

set xmlObj = Server.CreateObject("Microsoft.XMLDOM")

to

set xmlObj = CreateObject("Microsoft.XMLDOM")

Next, you need to do some debugging to verify that you are receiving the
expected xml from the xmlhttp object:

msgbox xmlObj.xml

I have a demo (dynamic listbox) that illustrates the use of the
xmlhttprequest object on the client. It is available here:
http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links .asp&c=&a=clear

Please follow up in a client-side scripting newsgroup.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"