mercredi 25 novembre 2015

XML node cannot traced

A web-service returns a XML over SOAP and I am trying to parse it. However I cannot reach nodes. I trace XML at all but nodes are untraceable.

<soap:Envelope xmlns:soap="http://ift.tt/18hkEkn" xmlns:xsi="http://ift.tt/ra1lAU" xmlns:xsd="http://ift.tt/tphNwY">
    <soap:Body>
        <SbDrsRprRspnse xmlns="http://tempuri.org/">
            <SbDrsRprRslt>
                <SODSRprDt>
                    <Aktiv>false</Aktiv>
                    <Silindi>false</Silindi>
                    <Sira>0</Sira>
                    <Numara>IL1</Numara>
                    <AdSoyad>Maksim Tsygalha</AdSoyad>
                    <ToplamEtk>30</ToplamEtk>
                    <TamamEtk>6</TamamEtk>
                    <Durum>20</Durum>
                    <Units>
                        <SbOgrtDSUnitRDt>
                            <Aktif>false</Aktif>
                            <Silindi>false</Silindi>
                            <UnitsAdi>Ünite 3</UnitsAdi>
                            <EtkTop>30</EtkTop>
                            <TamamEtk>6</TamamEtk>
                            <Durum>20</Durum>
                        </SbOgrtDSUnitRDt>
                    </Units>
                </SODSRprDt>
            </SbDrsRprRslt>
        </SbDrsRprRspnse >
    </soap:Body>
</soap:Envelope>

I can trace(returnXML) and see all things above. But when I try trace(returnXML.children().children().children()) it shows nothing. Also ==null, ==undefined, ==" ", and =="" returns false. What am I doing wrong?


edit

here is what I did after the comment;

private function ProcessXML(ref:XML):void
{
    var returnXML:XML = new XML(ref);
    var soap:Namespace = new Namespace("http://ift.tt/18hkEkn");
    trace(returnXML.soap::Body.SbDrsRprRspnse.SbDrsRprRslt.SODSRprDt.Aktif); //it returns nothing!
}


edit #2 I am using Flash Builder and it keeps throwing error for second namespace childrenNs - TypeError: Error 1080 - Illegal value for namespace. I have searched a little bit about the error but couldn't find something worthwhile. So maybe using a one namespace-soap just for testing that there is nothing else problematic. So is it possible to use only one namespace with this XML?

Aucun commentaire:

Enregistrer un commentaire