Error reading xml document in Asp

P

Pim75

Hello,

I've written a simple asp code that has to read an xml file from an
Asp.net webservice.
The code looks like:

set soapclient = Server.CreateObject("MSSOAP.SoapClient30")
soapclient.ClientProperty("ServerHTTPRequest") = True
soapclient.mssoapinit("http://webservice/Webservice.asmx?WSDL")
soapclient.ConnectorProperty("Timeout") = 120000
strXML = soapclient.GetModellen("4", "2001", "3")

set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async=false
xmlDoc.loadXML(strXML)

When executing the code I get an error on the last instruction:
Type mismatch: 'xmlDoc.loadXML'

This is the XML returned by the webservice:
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfTAutoModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://
tempuri.org/">
<TAutoModel>
<ModelId>33</ModelId>
<Omschrijving>200</Omschrijving>
<Beginjaar>1984</Beginjaar>
</TAutoModel>
</ArrayOfTAutoModel>

Can anyone tell me why I get this strange message Type mismatch:
'xmlDoc.loadXML' ?

When I try to load the xml from a string into the xmlDoc, there's no
problem. Only when the Xml is returned from the webservice I get the
error.

I hope someone can help me.
 
A

Anthony Jones

Pim75 said:
Hello,

I've written a simple asp code that has to read an xml file from an
Asp.net webservice.
The code looks like:

set soapclient = Server.CreateObject("MSSOAP.SoapClient30")
soapclient.ClientProperty("ServerHTTPRequest") = True
soapclient.mssoapinit("http://webservice/Webservice.asmx?WSDL")
soapclient.ConnectorProperty("Timeout") = 120000
strXML = soapclient.GetModellen("4", "2001", "3")

set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async=false
xmlDoc.loadXML(strXML)

When executing the code I get an error on the last instruction:
Type mismatch: 'xmlDoc.loadXML'

This is the XML returned by the webservice:
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfTAutoModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://
tempuri.org/">
<TAutoModel>
<ModelId>33</ModelId>
<Omschrijving>200</Omschrijving>
<Beginjaar>1984</Beginjaar>
</TAutoModel>
</ArrayOfTAutoModel>

Can anyone tell me why I get this strange message Type mismatch:
'xmlDoc.loadXML' ?

When I try to load the xml from a string into the xmlDoc, there's no
problem. Only when the Xml is returned from the webservice I get the
error.

I hope someone can help me.

replace:-

xmlDoc.loadXML(strXML)

with:-

Response.Write VarType(strXML)

What do you get back?

Also try:-

xmlDoc.loadXML strXML

Probably won't make a difference but the parentheses were superflous.
 
P

Pim75

Hello Anthony,

Thanks for your reply.
Changing xmlDoc.loadXML(strXML) in xmlDoc.loadXML strXML makes no
difference, I get the same error message.

When I try Response.Write VarType(strXML) , the value 8201 is
returned.
Does this mean anything to you?

Thanks in advance.
 
A

Anthony Jones

Pim75 said:
Hello Anthony,

Thanks for your reply.
Changing xmlDoc.loadXML(strXML) in xmlDoc.loadXML strXML makes no
difference, I get the same error message.

When I try Response.Write VarType(strXML) , the value 8201 is
returned.
Does this mean anything to you?

Yes it means the return type is an array of objects.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top