Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Ti.XML.parseString is not working in android

$
0
0

Hi all,

i am using the below soap web service request , it is working in iPhone but it is not working in android, when it goes to Ti.XML.parseString in android, it shows error (error msg is not clear)

var message = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';
    message += '<soap:Body>';
    message += '<ns1:findEmirateLookupsView1 xmlns:ns1="/uaq/db/si/model/common/types/">';
    message += '<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">';
    message += '<ns2:fetchStart>0</ns2:fetchStart><ns2:fetchSize>-1</ns2:fetchSize>';
    message += '<ns2:filter><ns2:conjunction>And</ns2:conjunction><ns2:group>';
    message += '<ns2:conjunction>And</ns2:conjunction><ns2:upperCaseCompare>false</ns2:upperCaseCompare>';
    message += '<ns2:item><ns2:conjunction>And</ns2:conjunction><ns2:upperCaseCompare>false</ns2:upperCaseCompare>';
    message += '<ns2:attribute>IsActive</ns2:attribute><ns2:operator>=</ns2:operator><ns2:value>1</ns2:value></ns2:item>';
    message += '</ns2:group></ns2:filter>';
    message += '<ns2:findAttribute>EmiratenameEn</ns2:findAttribute>';
    message += '<ns2:findAttribute>EmiratenameAr</ns2:findAttribute>';
    message += '<ns2:findAttribute>EmirateId</ns2:findAttribute>';
    message += '<ns2:excludeAttribute>false</ns2:excludeAttribute>';
    message += '</ns1:findCriteria>';
    message += '<ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">';
    message += '<ns2:retrieveAllTranslations>true</ns2:retrieveAllTranslations>';
    message += '</ns1:findControl></ns1:findEmirateLookupsView1>';
    message += '</soap:Body></soap:Envelope>';
 
var request = Ti.Network.createHTTPClient();
    request.timeout = 15000;
    request.onload = function(e) {
        var response = this.responseText;
        Ti.API.info('nation list response data==>> ' + this.responseText);
        var result;
        try {
            result = Ti.XML.parseString(response);
            Ti.API.info(result + 'nation list data  after parsing==>> ' + JSON.stringify(result));
        } catch(e) {
            alert('Error');
        }
 
        var rootNode = result.getElementsByTagName("EmiratenameEn");
        Ti.API.info('emirates list length==>> ' + rootNode.length);
        var arrEmiratesList = [];
        if (rootNode.length > 0) {
 
            for (var i = 0; i < rootNode.length; i++) {
                Ti.API.info('emirates list data ==>> ' + result.getElementsByTagName("EmiratenameEn").item(i).textContent);
                arrEmiratesList.push({
                    title : result.getElementsByTagName("EmiratenameEn").item(i).textContent,
                    titleAr : result.getElementsByTagName("EmiratenameAr").item(i).textContent,
                    id : result.getElementsByTagName("EmirateId").item(i).textContent,
                });
            }
 
            callBackFunction(arrEmiratesList);
        }
        Alloy.Globals.hideLoading();
    };
any help regarding this will be great......

thanks in advance....


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>