Parsing XML web service in flash

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 4dplane
    New Member
    • Mar 2008
    • 2

    Parsing XML web service in flash

    Hi,

    I am using a web service in AS3 found here - http://labs.alducente.com/index.php?...13#comment-118

    Everthing is set up and working, if you look at the the link you will see this line of code:
    trace(serviceRe sposne)
    It spits out this xml from my own data base in ASP.net 2.0:

    <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/" xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <getTitlesRespo nse xmlns="http://tempuri.org/">
    <getTitlesResul t>
    <xsd:schema id="NewDataSet " xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata">
    <xsd:element name="NewDataSe t" msdata:IsDataSe t="true" msdata:UseCurre ntLocale="true" >
    <xsd:complexTyp e>
    <xsd:choice minOccurs="0" maxOccurs="unbo unded">
    <xsd:element name="Table">
    <xsd:complexTyp e>
    <xsd:sequence >
    <xsd:element name="title" type="xs:string " minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType >
    </xsd:element>
    </xsd:choice>
    </xsd:complexType >
    </xsd:element>
    </xsd:schema>
    <diffgr:diffgra m xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="u rn:schemas-microsoft-com:xml-diffgram-v1">
    <NewDataSet>
    <Table diffgr:id="Tabl e1" msdata:rowOrder ="0">
    <title>Biolog y ch1</title>
    </Table>
    <Table diffgr:id="Tabl e2" msdata:rowOrder ="1">
    <title>Vocabula ry</title>
    </Table>
    <Table diffgr:id="Tabl e3" msdata:rowOrder ="2">
    <title>WWII</title>
    </Table>
    <Table diffgr:id="Tabl e4" msdata:rowOrder ="3">
    <title>Chemistr y</title>
    </Table>
    <Table diffgr:id="Tabl e5" msdata:rowOrder ="4">
    <title>Measurme nt</title>
    </Table>
    <Table diffgr:id="Tabl e6" msdata:rowOrder ="5">
    <title>Biolog y ch2</title>
    </Table>
    </NewDataSet>
    </diffgr:diffgram >
    </getTitlesResult >
    </getTitlesRespon se>
    </soap:Body>
    </soap:Envelope>

    How can I print the titles?

    I have tried many combination of:
    trace(serviceRe sponse.NewDataS et.Table);
    trace(serviceRe sponse.soap::En velope);

    from other examples but nothing works.

    Thanks,
    4dplane
  • pronerd
    Recognized Expert Contributor
    • Nov 2006
    • 392

    #2
    Since your question relates to using ASP not XML this should be posted in an ASP forum.

    Comment

    • jkmyoung
      Recognized Expert Top Contributor
      • Mar 2006
      • 2057

      #3
      If the serviceResponse is some sort of xml object, you'd need to run a quick search on the xml, eg using xpath "//title" getting back a node list.

      Then recurse through the node list, outputting the text values of each of the lements.

      Comment

      • 4dplane
        New Member
        • Mar 2008
        • 2

        #4
        Here is a link to EE that explains this scenario.
        http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XML/Q_23280332.html

        Comment

        Working...