Error reading xml document in Asp

Discussion in 'ASP General' started by Pim75, Mar 21, 2007.

  1. Pim75

    Pim75 Guest

    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.
     
    Pim75, Mar 21, 2007
    #1
    1. Advertising

  2. "Pim75" <> wrote in message
    news:...
    > 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.
     
    Anthony Jones, Mar 21, 2007
    #2
    1. Advertising

  3. Pim75

    Pim75 Guest

    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.
     
    Pim75, Mar 21, 2007
    #3
  4. "Pim75" <> wrote in message
    news:...
    > 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.
     
    Anthony Jones, Mar 21, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. NB
    Replies:
    5
    Views:
    4,179
  2. Tony Prichard
    Replies:
    0
    Views:
    742
    Tony Prichard
    Dec 12, 2003
  3. Manish Hatwalne
    Replies:
    1
    Views:
    401
    Martin Honnen
    Jul 13, 2004
  4. Replies:
    4
    Views:
    684
  5. icogs
    Replies:
    0
    Views:
    141
    icogs
    Jan 31, 2008
Loading...

Share This Page