{ "id": "116613", "key": "TIMOB-16241", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2013-06-28T13:17:19.000+0000", "priority": null, "labels": [ "httpclient", "request", "response", "soap", "xml", "xmlparsing" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:14.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "https://developer.appcelerator.com/question/152474/createhttpclient-soap-response-null-when-attachment-returned\r\n\r\nWe tried it with SoapUI with the same request and the attachment is contained in the response, but as soon as we request it with Titanium, the (whole!!!) response is null. No header any more, nothing.", "attachment": [ { "id": "44988", "filename": "test.txt", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-01-08T08:04:23.000+0000", "size": 61382, "mimeType": "text/plain" }, { "id": "44937", "filename": "XML Test.1.zip", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-01-04T23:15:57.000+0000", "size": 2895661, "mimeType": "application/zip" } ], "flagged": false, "summary": "TiAPI: XML Response null when requesting binary attachment", "creator": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "environment": "OS X 10.8.2, MacBook Pro (2008)", "comment": { "comments": [ { "id": "260454", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Bernhard,\r\n\r\nPlease can you provide a reproducible test case that we can drop into an app.js and run?\r\n\r\nThanks!", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-01T18:16:55.000+0000", "updated": "2013-07-01T18:16:55.000+0000" }, { "id": "260894", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "I attached a project \"XML Test.zip\" that does a live request. In ui/common/FirstView.js happens all the magic. There you also can change the type of ouput.\r\nThe variable var responseType = \"XML\"; sets the response to XML\r\nvar responseType = \"PDF+XML\"; should return a soap response, but returns null...\r\nTry it with SoapUI and you'll see it works with PDF there, so there has to be some issue with the Titanium parser...", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-07-05T15:07:26.000+0000", "updated": "2013-07-05T15:07:56.000+0000" }, { "id": "260959", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "Did you try the example? Which results did you experience?", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-07-08T15:16:08.000+0000", "updated": "2013-07-08T15:16:08.000+0000" }, { "id": "271689", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello Bernhard Dengler,\r\n\r\nI test your code. It is showing an error. Please can you check your username and password? \r\n\r\n{code}\r\n[INFO] : soap:ServerUVST service errorUVST-5007Benutzername oder Passwort falsch.\r\n\r\n{code}\r\n\r\n\r\nThanks \r\n", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2013-09-18T07:22:57.000+0000", "updated": "2013-09-18T07:22:57.000+0000" }, { "id": "271922", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "Please replace \"FirstView.js\" with the one I attached above. We deleted the user that was configured there because no activity happened. We now configured a new user...please try again.", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-09-19T16:38:00.000+0000", "updated": "2013-09-19T16:38:00.000+0000" }, { "id": "271938", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\n\nI test your new code. its return following data:- \n\n\n{code}\n--uuid:3402beb6-ba03-4c72-b4e1-47756c470e2f\n Content-Type: application/xop+xml; charset=UTF-8; type=\"text/xml\";\n Content-Transfer-Encoding: binary\n Content-ID: \n \n 2013-09-19T19:23:59+02:00tid://20130919.20130939232357.00030031.GB@imd.attrueDiese Abfrage wurde, mit den selben Abfrageparametern, innerhalb der letzten 15 Minuten bereits durchgeführt. --uuid:3402beb6-ba03-4c72-b4e1-47756c470e2f\n Content-Type: application/xml; charset=UTF-8\n Content-Transfer-Encoding: binary\n Content-ID: <1eb84673-216d-47ab-b8c5-1c295d6c6bee-325@uvst.at>\n \n02013-09-19T19:23:59.264+02:00false4004021Möllersdorf45772442011Letzte TZ 7244/2011Einlage umgeschrieben gemäß Verordnung BGBl. II, 143/2012 am 07.05.201204021Möllersdorf1024trueBauflächen (Gebäude)3153Sonstige (Betriebsflächen)5163*8316Wiener Straße105-107Marzek-Straße28316GT_GBA031.6\n --uuid:3402beb6-ba03-4c72-b4e1-47756c470e2f--\n{code}\n\nI think that is your desired response’s text.\nThanks ", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2013-09-19T17:33:45.000+0000", "updated": "2013-09-19T17:33:45.000+0000" }, { "id": "272032", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi,\n\nNO!\n\nPlease read the initial postings: if you set the variable var responseType = \"PDF+XML\" in the FirstView.js (it's now set to \"XML\"), then the response is \"NULL\". BUT if you do the same request with e.g. SoapUI, there is a full response including the PDF.\n\nSo as soon as the response includes binary data, the Titanium parser returns \"NULL\"...\n\nSo I tried it with 3.1.3 now and it's still NOT working", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-09-19T22:20:25.000+0000", "updated": "2013-09-19T22:20:25.000+0000" }, { "id": "273983", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "Any news on this?", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-07T10:02:57.000+0000", "updated": "2013-10-07T10:02:57.000+0000" }, { "id": "286662", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "This one ISN'T resolved! Please give some feedback about your results, I'm still getting \"null\" when I request \"PDF+XML\"...and don't forget to replace the FirstView.js as mentioned above. Tried it with 3.2.0 now...", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-01-04T14:22:29.000+0000", "updated": "2014-01-04T14:24:29.000+0000" }, { "id": "286664", "author": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hi Bernhard,\n\nWe tested this issue with your code. However, we were unable to complete the test due to server error. Here is server response logs:\n\n1\n[INFO] : soap:ServerUVST service errorUVST-5005Die TransactionId entspricht nicht der Struktur: tid://JJJJMMTT.freier_teil.anschriftcode.anwendungskennung@domain-name.\n\n\nCan you please send us a detailed test case and server test access to review this further?\n\nRegards,", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-04T18:39:21.000+0000", "updated": "2014-01-04T18:39:21.000+0000" }, { "id": "286667", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "The actual test project", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-01-04T23:15:57.000+0000", "updated": "2014-01-04T23:15:57.000+0000" }, { "id": "286668", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi Shak,\n\nI updated the whole project and tested it again with 3.2.0, it works here.\nSee the attached file above (I removed the old ones).\n\nThe error message you posted above says that the transaction ID (which is based on the actual date and time) is in wrong format.\nThese both lines are responsible: \n[...]\n''+AbfrageDate1+''+\n' tid://'+AbfrageDate2+'.'+AbfrageKennung+'.00030031.GB@imd.at'+\n[...]\n\nThe variable \"AbfrageDate2\" should be in format \"YYYYMMDD\" and the variable \"AbfrageKennung\" should be in format \"YYYYMMDDhhmmss\"+20000000\n\nIf your locale settings are wrong or anything else, you have to hardcode these values. But they have to be actual, otherwise the request will be unsuccessful.", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-01-04T23:22:11.000+0000", "updated": "2014-01-04T23:22:11.000+0000" }, { "id": "286669", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "...and don't forget to do the request in both ways:\nvar responseType = \"XML\";\nand\nvar responseType = \"PDF+XML\";\n\nThe first line: response -> OK\nThe second line: response -> null", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-01-04T23:24:50.000+0000", "updated": "2014-01-04T23:24:50.000+0000" }, { "id": "286823", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "When are you planning to do the next tests? \nWe really need this asap...\nAs mentioned: the testfiles work, but the response is still NULL if it contains binary data. Otherwise it's working fine...", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-01-06T21:54:12.000+0000", "updated": "2014-01-06T21:54:12.000+0000" }, { "id": "286948", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "I found out something: the response is contained in the \"responseData\" Object! But it contains non-ASCII characters so you can't do anything with it. It's just there (as blob). But every function like .toString or .text returns no value (because of the non-ASCII characters).", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-01-07T12:57:53.000+0000", "updated": "2014-01-07T12:57:53.000+0000" }, { "id": "287159", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is a pdf attachment so I am assuming you are expecting the binary data back. You should be able to read the blob object content using Blob object API.\n\nhttp://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Blob\n", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-08T06:00:33.000+0000", "updated": "2014-01-08T06:00:33.000+0000" }, { "id": "287188", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi,\nno, it's no pure PDF, it's header says \"XOP+XML\". I've tried working with the Ti.Blob Object, but there's no possibility to read the file or separate the attachments out of it, I just can save it to the device.\n\nI'll attach the file that comes in the response...you can try yourself working with it and the Ti.Blob Object.", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-01-08T07:57:14.000+0000", "updated": "2014-01-08T07:57:14.000+0000" }, { "id": "287189", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "See attachment \"test.txt\"...\r\n\r\nThis is the response that comes through the responseData object from the httpClient request. \r\n\r\nSave it to the application folder on the device and try reading it with this code:\r\nvar fileStream = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,\"test.txt\"); \r\n var fileContent = fileStream.read();\r\n \r\n Ti.API.info(\"Response: \" + fileContent.toString());\r\nOR\r\nTi.API.info(\"Response: \" + fileContent.text());\r\nOR\r\nTi.API.info(\"Response: \" + fileContent.file());\r\nOR\r\nTi.API.info(\"Response: \" + fileContent.mimeType());\r\n\r\nThe last one returns the type of the file. \r\n\r\nAs soon as I'm cropping the PDF part manually out of the file, I can read the file.\r\n\r\nWhat I'd like to do: I'd like to read everything as a string, separate the header & attachments and save them seaparetly to the device.", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-01-08T08:04:23.000+0000", "updated": "2014-01-08T08:05:00.000+0000" }, { "id": "288746", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this to engineering for further evaluation and prioritization.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-19T04:05:22.000+0000", "updated": "2014-01-19T04:05:22.000+0000" }, { "id": "299998", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "Any news on this?", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-04-06T18:12:11.000+0000", "updated": "2014-04-06T18:12:11.000+0000" } ], "maxResults": 27, "total": 27, "startAt": 0 } } }