{ "id": "134388", "key": "AC-1049", "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-09-15T03:58:32.000+0000", "created": "2014-08-08T14:53:40.000+0000", "labels": [ "TCSupportTriage" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:23.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": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "In this docs about ACS bindings, the example is:\r\n\r\nhttp://docs.appcelerator.com/cloud/latest/#!/guide/node_studio_integrated\r\n\r\n{code}\r\nvar cloud_service = require('ti.cloud.FooBar');)\r\n// The default generated bindings file allows you to send payload data and a success callback.\r\ncloud_service.application_createFoo({'foo':'foobar'}, function(r, e){\r\n Ti.API.info(JSON.stringify(r));\r\n});\r\n{code}\r\n\r\nIt's supposed that the *r* parameter is the awaited response.\r\n\r\nIn my experience today, I only receive the data in the *second e* parameter, having *r* only null.\r\n\r\nViewing the code generated by Studio, maybe is there something wrong:\r\n\r\n{code}\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{code}\r\n\r\nThe line in the returned function *xhr.onload* is *cb(null, r);*, i.e., will return null for first parameter and r for second (as I'm viewing by my self in my test).\r\n\r\nIt is an error in the Invoke function code, in the docs, or what?", "attachment": [], "flagged": false, "summary": "Mobile to ACS Bindings not working as in docs?", "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": "Windows 7 64Bit\r\nTi 3.3.0GA", "comment": { "comments": [ { "id": "362484", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nWe are unable to reproduce the reported error. Please Migrate your Node.ACS Application to Arrow Cloud. Migration link: https://web.appcelerator.com/product/migrate-app#node_acs_instructions\r\n\r\nAdditionally, I recommend you to upgrade your studio and SDK to the latest build and test that code then let us know if you get the error again.\r\n\r\nThanks.", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-09-08T07:10:35.000+0000", "updated": "2015-09-15T03:58:15.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }