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

how to call soap web service

$
0
0

Application type:mobile,titanium sdk:3.5.1,platform:android and iOS,device:simulator,OS:Mac OSX 10.9.5,titanium studio:3.4.1

I am trying to send the data using soap request.I tried with suds.js and also example in the documentation.But facing the issue saying

android:HTTPResponseException

iOS:

Opening and ending tag mismatch: HR line 1 and html
[INFO] :   </u></p><HR size="1" noshade="noshade"><h3>JBoss Web/2.1.3.GA</h3></body></html>
[INFO] :                                                                                  ^
[INFO] :   Entity: line 1: parser error : Premature end of data in tag body line 1
[INFO] :   </u></p><HR size="1" noshade="noshade"><h3>JBoss Web/2.1.3.GA</h3></body></html>
How can I solve the issue:
exports.soap=function() {
    Ti.include('suds.js');
    var url = "url";
    var callparams = {
        UserName: 'Abc',
        Password: 'Xyz'
    };
 
    var suds = new SudsClient({
        endpoint: url,
        targetNamespace: 'namespace'
    });
 
    try {
        suds.invoke('authenticateUser', callparams, function(xmlDoc) {
            var results = xmlDoc.documentElement.getElementsByTagName('ResultString');
            if (results && results.length>0) {
                var result = results.item(0);
                Ti.API.info(results.item(0).textContent);
            }
        });
    } catch(e) {
        Ti.API.error('Error: ' + e);
    }
};

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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