Titanium JIRA Archive
Appcelerator Community (AC)

[AC-740] createHTTPClient Fails with SDK 3.3.0

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-12-20T01:04:44.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsTCSupportTriage
ReporterJames Childs
AssigneeMauro Parra-Miranda
Created2014-08-31T16:17:23.000+0000
Updated2016-03-08T07:37:00.000+0000

Description

When executing an https all in 3.3.0 the httpClient returns the following error "The network connection was lost." The exact same code works with Titanium SDK 3.2.2 and earlier. Here is the output from a simple code test. [INFO] : 2014-08-31 12:14:40.238 testimage[22981:3903] [ERROR] A SQLite database error occurred on database '/Users/me/Library/Application Support/iPhone Simulator/7.1/Applications/1DB9D52D-F780-4E99-9A35-3D3519BBA396/Library/Application Support/analytics/analytics.db': Error Domain=com.plausiblelabs.pldatabase Code=3 "An error occured parsing the provided SQL statement." UserInfo=0xcd38cd0 {com.plausiblelabs.pldatabase.error.vendor.code=1, NSLocalizedDescription=An error occured parsing the provided SQL statement., com.plausiblelabs.pldatabase.error.query.string=SELECT data FROM pending_events ORDER BY ID DESC, com.plausiblelabs.pldatabase.error.vendor.string=no such column: ID} (SQLite #1: no such column: ID) (query: 'SELECT data FROM pending_events ORDER BY ID DESC') [INFO] : There was an error [INFO] : {"type":"error","source":{"method":"GET","timeout":15000,"url":"https://www.mydomain.com/test.php"},"code":-1005,"error":"The network connection was lost.","success":false}

Comments

  1. Shuo Liang 2014-09-01

    Hi, Can you provide us your test case please, that will be helpful to address your problem. Regards, Shuo
  2. Motiur Rahman 2014-09-01

    Hello, We have tested this issue. But we can not reproduce this issue as a bug, createHttpCient request works as expected on a sample test case.

    Testing Environment:

    Titanium SDK: 3.3.0.GA Titanium CLI: 3.3.0, Android SDK: 4.2.2,4.4.2 iOS: 7.1, OS X Version: 10.9.4, Appcelerator Studio: 3.3.0

    Steps to Test:

    1. Create classic project. 3. Paste this file in app.js file. 3. Run this code with the testing environment.

    Test Case

       var url = "http://www.appcelerator.com";
       var client = Ti.Network.createHTTPClient({
       	// function called when the response data is available
       	onload : function(e) {
       		Ti.API.info("Received text: " + this.responseText);
       		alert('success');
       	},
       	// function called when an error occurs, including a timeout
       	onerror : function(e) {
       		Ti.API.debug(e.error);
       		alert('error');
       	},
       	timeout : 5000 // in milliseconds
       });
       // Prepare the connection.
       client.open("GET", url);
       // Send the request.
       client.send(); 
       
    Thanks.
  3. James Childs 2014-09-01

    Here is a sample ApplicationWindow program. function ApplicationWindow() { //create component instance var self = Ti.UI.createWindow({ backgroundColor:'#ffffff' }); callparams = { 'function': 'connection_test', type: 'json' }; var lbl = Titanium.UI.createLabel({ width:200, height:Titanium.UI.SIZE, color:'#ffffff',backgroundColor:'#000', text:'testing' }); self.add(lbl); var xhr = Titanium.Network.createHTTPClient({ timeout:15000, onerror: function(e){ Ti.API.info('There was an error'); Ti.API.info(JSON.stringify(e)); if (Titanium.Network.online) { lbl.text = this.text; } else { lbl.text = 'No network connectivity'; } }, onload:function(){ Ti.API.info('Results: '+this.responseText); lbl.text = this.responseText; } }); xhr.open("GET","https://www.leverageapplications.com/mu/services/estep_app.php"); xhr.send(callparams); return self; } //make constructor function the public component interface module.exports = ApplicationWindow;

JSON Source