{ "id": "134461", "key": "AC-426", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-11-21T18:44:10.000+0000", "created": "2014-08-10T14:49:13.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "updated": "2015-11-21T18:44:10.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "I'm tryiing to use my binds for my services in ACS.\r\n\r\nIn Android is working well, but in iOS (emulator or device) any call I make to the bind, returns an xhr error \"Unable to start HTTP connection\".\r\n\r\nI tried to set my *acs-service-baseurl-* to *http://...*, to *https://...* and simply to my url without protocol, but with http the error changes to code 404 *HTTP error*, and with https is the same error as with nothing (current error).\r\n\r\nI debugged a bit the *InvokeService* but the error is simply that. This is the JSON error that appears when *InvokeService* calls xhr:\r\n\r\n{code}\r\nerror: {\"type\":\"error\",\"source\":{\"cache\":false},\"code\":6,\"error\":\"Unable to start HTTP connection\",\"success\":false} \r\n{code}\r\n\r\nAs I said, in Android works fine.\r\n\r\nAny workaround will be welcome.", "attachment": [], "flagged": false, "summary": "iOS: Network - HTTPClient call to ACS binding not working", "creator": { "name": "mcvendrell", "key": "mcvendrell", "displayName": "Manuel Conde Vendrell", "active": true, "timeZone": "Europe/Madrid" }, "subtasks": [], "reporter": { "name": "mcvendrell", "key": "mcvendrell", "displayName": "Manuel Conde Vendrell", "active": true, "timeZone": "Europe/Madrid" }, "environment": "OS X Maverics 10.9.4\r\nTi 3.3.0GA", "comment": { "comments": [ { "id": "317895", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi,\r\n\r\nCan you provide us a simple test case for your problem, that will be really helpful to address the it.\r\n\r\nRegards,\r\nShuo", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-08-11T03:35:59.000+0000", "updated": "2014-08-11T03:35:59.000+0000" }, { "id": "317909", "author": { "name": "mcvendrell", "key": "mcvendrell", "displayName": "Manuel Conde Vendrell", "active": true, "timeZone": "Europe/Madrid" }, "body": "Sorry Shuo, just right now traveling for a week. I can give an example in one week. \r\n\r\nAnyway, the example is very basic, just calling any of the bindings generated by Studio automatically will fail on iOS and not in android. It is strange but I read some jiras about similar behavior before. ", "updateAuthor": { "name": "mcvendrell", "key": "mcvendrell", "displayName": "Manuel Conde Vendrell", "active": true, "timeZone": "Europe/Madrid" }, "created": "2014-08-11T06:08:20.000+0000", "updated": "2014-08-11T06:08:20.000+0000" }, { "id": "320318", "author": { "name": "mcvendrell", "key": "mcvendrell", "displayName": "Manuel Conde Vendrell", "active": true, "timeZone": "Europe/Madrid" }, "body": "Sorry for the delay. Here is the code:\r\n\r\n{code}\r\n/**\r\n * This is generated code - it will be overwritten. Do not modify.\r\n * Copyright (c) 2012 by Appcelerator, Inc. All Rights Reserved.\r\n */\r\n\r\nfunction InvokeService(path, method, data, cb) {\r\n if (typeof(data) == \"function\") {\r\n cb = data; data = null;\r\n }\r\n if (typeof(cb) !== \"function\")\r\n throw new Error(\"callback must be provided!\");\r\n var xhr = Ti.Network.createHTTPClient();\r\n xhr.onerror = function(e) {\r\n cb(e.error);\r\n };\r\n xhr.onload = function(e) {\r\n var r = this.responseText;\r\n try {\r\n if (xhr.getResponseHeader(\"content-type\").indexOf(\"json\") != -1) {\r\n r = JSON.parse(r);\r\n }\r\n } catch (E) {}\r\n cb(null, r);\r\n };\r\n if(exports.URL.match('/$') == '/' && path.indexOf('/') == 0) {\r\n xhr.open(method, exports.URL + path.substring(1));\r\n } else {\r\n xhr.open(method, exports.URL + path);\r\n }\r\n xhr.send(data);\r\n};\r\n\r\nvar url = Ti.App.Properties.getString(\"acs-service-baseurl-mysite\");\r\n\r\nif(!url) throw new Error(\"Url not found by acs-service-baseurl-mysite.\");\r\nif(url.replace(/^\\s+|\\s+$/g, \"\")) {\r\n exports.URL = url.replace(/^\\s+|\\s+$/g, \"\");\r\n} else {\r\n exports.URL = \"http://localhost:8080\";\r\n}\r\n\r\nexports.api_getTopics = function(data, cb) {\r\n var path = [];\r\n path.push('/api/getTopics');\r\n InvokeService(path.join(''), \"GET\", data, cb);\r\n};\r\n\r\nexports.api_countSubscribers = function(data, cb) {\r\n var path = [];\r\n path.push('/api/countSubscribers');\r\n InvokeService(path.join(''), \"GET\", data, cb);\r\n};\r\n{code}\r\n\r\nAny of the above calls work on iOS, but works on Android.", "updateAuthor": { "name": "mcvendrell", "key": "mcvendrell", "displayName": "Manuel Conde Vendrell", "active": true, "timeZone": "Europe/Madrid" }, "created": "2014-08-26T10:27:19.000+0000", "updated": "2014-08-26T10:27:19.000+0000" }, { "id": "323959", "author": { "name": "mcvendrell", "key": "mcvendrell", "displayName": "Manuel Conde Vendrell", "active": true, "timeZone": "Europe/Madrid" }, "body": "There is no one with this problem? Only me?", "updateAuthor": { "name": "mcvendrell", "key": "mcvendrell", "displayName": "Manuel Conde Vendrell", "active": true, "timeZone": "Europe/Madrid" }, "created": "2014-09-16T14:32:53.000+0000", "updated": "2014-09-16T14:32:53.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }