Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25533] Android: Allow HTTPClient to send request in onload

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-10-23T17:53:20.000+0000
Affected Version/sRelease 7.1.0
Fix Version/sRelease 7.5.0
ComponentsAndroid
LabelsTiHTTPClient, android, java, java.net.SocketTimeoutException
Reporterknd_rt@hotmail.com
AssigneeGary Mathews
Created2017-10-30T01:32:58.000+0000
Updated2018-10-25T14:01:21.000+0000

Description

I got an app that send post json objects synchronous via recursive function, Once an object is sent I wait for the response before sending another, but Im getting timedout errors:
[INFO]  to server: {"params":{"venta":{"ven_fecha":"2017-10-29 19:15:57","ven_usuario":7,"ven_cliente":279,"ven_salida":71,"ven_ruta":1,"ven_localidad":1,"ven_total":316,"ven_pagado":316,"ven_factura":0,"ven_tipo":1,"ven_estatus":0,"apa_monto":0,"ven_descuento":"","Detalles":[{"vpr_venta":3,"vpr_salida":71,"vpr_producto":77,"vpr_precio_oficial":121,"vpr_precio_venta":121,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":121,"vpr_descripcion":"BONAFONT 24/600ML","vpr_costo":82.42},{"vpr_venta":3,"vpr_salida":71,"vpr_producto":79,"vpr_precio_oficial":88,"vpr_precio_venta":88,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":88,"vpr_descripcion":"BONAFONT 12/1LT","vpr_costo":59.04},{"vpr_venta":3,"vpr_salida":71,"vpr_producto":80,"vpr_precio_oficial":107,"vpr_precio_venta":107,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":107,"vpr_descripcion":"BONAFONT 12/1.5 LTS","vpr_costo":71.96}]},"usuario":"marcelo","clave":"m1"},"metodo":"subirVentas","url":"http://bebimex.com/sw/servidor/mobil.php"}
[INFO]  art: Background partial concurrent mark sweep GC freed 115194(6MB) AllocSpace objects, 67(1340KB) LOS objects, 40%% free, 14MB/23MB, paused 563us total 109.330ms
[ERROR] TiHTTPClient: (TiHttpClient-7) [11182,220758] HTTP Error (java.net.SocketTimeoutException): timeout
[ERROR] TiHTTPClient: java.net.SocketTimeoutException: timeout
[ERROR] TiHTTPClient:   at com.android.okhttp.okio.Okio$3.newTimeoutException(Okio.java:212)
[ERROR] TiHTTPClient:   at com.android.okhttp.okio.AsyncTimeout.exit(AsyncTimeout.java:261)
[ERROR] TiHTTPClient:   at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:215)
[ERROR] TiHTTPClient:   at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:306)
[ERROR] TiHTTPClient:   at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:300)
[ERROR] TiHTTPClient:   at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:196)
[ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:191)
[ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:80)
[ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:907)
[ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:783)
[ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:463)
[ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:405)
[ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:521)
[ERROR] TiHTTPClient:   at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1224)
[ERROR] TiHTTPClient:   at java.lang.Thread.run(Thread.java:761)
[ERROR] TiHTTPClient: Caused by: java.net.SocketException: Socket operation on non-socket
[ERROR] TiHTTPClient:   at java.net.SocketInputStream.socketRead0(Native Method)
[ERROR] TiHTTPClient:   at java.net.SocketInputStream.read(SocketInputStream.java:151)
[ERROR] TiHTTPClient:   at java.net.SocketInputStream.read(SocketInputStream.java:120)
[ERROR] TiHTTPClient:   at com.android.okhttp.okio.Okio$2.read(Okio.java:136)
[ERROR] TiHTTPClient:   at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
[ERROR] TiHTTPClient:   ... 12 more
[INFO]  status 0


Attachments

FileDateSize
app.tar.gz2017-11-16T05:46:49.000+00009297776

Comments

  1. Mostafizur Rahman 2017-10-30

    Hello [~knd_rt@hotmail.com], Thanks for sharing with us. Can you please provide a sample test case to reproduce this issue on our end?
  2. Mostafizur Rahman 2017-11-05

    Hello [~knd_rt@hotmail.com],
 Just passing a followup here.Are you able to get that sorted out?  Please let us know if you need more help with this issue. Regards
 Axway Appcelerator Support
  3. knd_rt@hotmail.com 2017-11-05

    This is actually the method I export to handle all post request, In some cases it works perfect but sometimes some request just get in the limbo. This file is in my lib folder and required in my controllers via: var http = require('http.js'); and used like this:
       http.post(server, function(res){
         // handle response
       })
       
       exports.post = function(args, callback){
         var url= args.url;
         var httpObj = Ti.Network.createHTTPClient({
           // function called when the response data is available
           onload : function(e) {
             // Ti.API.info("response " + e);
             Ti.API.info("response json" + JSON.stringify(e));
             if(this.status===200){
                Ti.API.info("Received text: " + this.responseText);
               callback(JSON.parse(this.responseText));
             }
             else{
            
               callback({result: false, msj:this.status });
             }
       
           },
           // function called when an error occurs, including a timeout
           onerror : function(e) {
             Ti.API.debug("error: ", e.error);
             Ti.API.debug("error json: ", JSON.stringify(e));
               Ti.API.info("status "+this.status);
               // Ti.API.info("error " + e.toString);
       
             callback({result: false, msj:e.error });
           },
           timeout : 7000  // in milliseconds
         });
         // Prepare the connection.
         httpObj.open("POST", url);
         httpObj.setRequestHeader('Content-Type', 'application/json');
         httpObj.setRequestHeader('charset', 'utf-8');
         // Send the request.
         httpObj.send(JSON.stringify({
           method:args.metodo,
           params:args.params,
           id:'bebimex'
         })
        );
       
       }
       
  4. Mostafizur Rahman 2017-11-06

    Hello [~knd_rt@hotmail.com], We are unable to reproduce the issue on HUAWEI GR3 2017 device using the latest SDK 6.3.0.GA Please create a full test project and test steps to test the issue. Thanks
  5. Sharif AbuDarda 2017-11-11

    Hello [~knd_rt@hotmail.com], Please get back to us with a full reproducible sample code and guide to follow to reproduce the issue in our environment. Thanks.
  6. knd_rt@hotmail.com 2017-11-15

    It is complicated to generate since theres is a lot of details, the server is php and is using ZEND as json parser(encode / decode). I run with -l trace and got this:
       [INFO]  entramos a post {"params":{"usuario":"marcelo","clave":"m1"},"metodo":"hola","url":"http://bebimex.com/sw/servidor/mobil.php"}
       [WARN]  System: ClassLoader referenced unknown path: /system/framework/tcmclient.jar
       [DEBUG] NetworkSecurityConfig: No Network Security Config specified, using platform default
       [INFO]  case 1, readyState = 1
       [INFO]  case 2, readyState = 2
       [INFO]  case 3, readyState = 3
       [INFO]  case 4, readyState = 4
       [INFO]  Received text: {"result":1,"id":"bebimex"}
       [INFO]  entramos a post {"params":{"venta":{"ven_fecha":"2017-11-14 17:07:33","ven_usuario":7,"ven_cliente":279,"ven_salida":105,"ven_ruta":1,"ven_localidad":1,"ven_total":473,"ven_pagado":473,"ven_factura":0,"ven_tipo":1,"ven_estatus":0,"apa_monto":0,"ven_descuento":"","Detalles":[{"vpr_venta":1,"vpr_salida":105,"vpr_producto":84,"vpr_precio_oficial":180,"vpr_precio_venta":148,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":148,"vpr_descripcion":"LEVITE 24/600 ML PIÑA COCO","vpr_costo":123},{"vpr_venta":1,"vpr_salida":105,"vpr_producto":85,"vpr_precio_oficial":180,"vpr_precio_venta":180,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":180,"vpr_descripcion":"LEVITE 24/600 ML JAMAICA","vpr_costo":123},{"vpr_venta":1,"vpr_salida":105,"vpr_producto":89,"vpr_precio_oficial":145,"vpr_precio_venta":145,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":145,"vpr_descripcion":"LEVITE 12/1.5 LT PIÑA COCO","vpr_costo":96.6}]},"usuario":"marcelo","clave":"m1"},"metodo":"subirVentasooo","url":"http://bebimex.com/sw/servidor/mobil.php"}
       [DEBUG] HTTPClient: The persistent handle is disposed.
       [INFO]  case 1, readyState = 1
       [INFO]  onsendstream called, readyState = 1
       [INFO]  onsendstream called, readyState = 1
       [ERROR] TiHTTPClient: (TiHttpClient-2) [10917,301032] HTTP Error (java.io.IOException): unexpected end of stream on Connection{bebimex.com:80, proxy=DIRECT hostAddress=66.7.199.50 cipherSuite=none protocol=http/1.1} (recycle count=1)                                                                                                       
       [ERROR] TiHTTPClient: java.io.IOException: unexpected end of stream on Connection{bebimex.com:80, proxy=DIRECT hostAddress=66.7.199.50 cipherSuite=none protocol=http/1.1} (recycle count=1)                                                                                                                                                    
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:210)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:80)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:907)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:783)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:463)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:405)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:521)
       [ERROR] TiHTTPClient:   at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1224)
       [ERROR] TiHTTPClient:   at java.lang.Thread.run(Thread.java:761)
       [ERROR] TiHTTPClient: Caused by: java.io.EOFException: \n not found: size=0 content=...
       [ERROR] TiHTTPClient:   at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:200)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:191)
       [ERROR] TiHTTPClient:   ... 8 more
       [INFO]  res:{"result":false,"msj":"valio unexpected end of stream on Connection{bebimex.com:80, proxy=DIRECT hostAddress=66.7.199.50 cipherSuite=none protocol=http/1.1} (recycle count=1)"}
       
       
  7. knd_rt@hotmail.com 2017-11-15

    why is this happening?:
       [DEBUG] HTTPClient: The persistent handle is disposed.
       
  8. Mostafizur Rahman 2017-11-15

    Hello [~knd_rt@hotmail.com], We are investigating this.Can you please test this on latest SDK and let us know the results. Thanks
  9. knd_rt@hotmail.com 2017-11-16

    I created a test project using latest SDK with JSON data I need to upload to server, I tested and got same errors:
       INFO]  case 1, readyState = 1
       [INFO]  onsendstream called, readyState = 1
       [INFO]  onsendstream called, readyState = 1
       [INFO]  APSAnalyticsService: Send already in progress, skipping intent
       [ERROR] TiHTTPClient: (TiHttpClient-2) [51129,56562] HTTP Error (java.net.SocketTimeoutException): timeout
       [ERROR] TiHTTPClient: java.net.SocketTimeoutException: timeout
       [ERROR] TiHTTPClient:   at com.android.okhttp.okio.Okio$3.newTimeoutException(Okio.java:212)
       [ERROR] TiHTTPClient:   at com.android.okhttp.okio.AsyncTimeout.exit(AsyncTimeout.java:261)
       [ERROR] TiHTTPClient:   at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:215)
       [ERROR] TiHTTPClient:   at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:306)
       [ERROR] TiHTTPClient:   at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:300)
       [ERROR] TiHTTPClient:   at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:196)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:191)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:80)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:907)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:783)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:463)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:405)
       [ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:521)
       [ERROR] TiHTTPClient:   at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1241)
       [ERROR] TiHTTPClient:   at java.lang.Thread.run(Thread.java:761)
       [ERROR] TiHTTPClient: Caused by: java.net.SocketException: Socket closed
       [ERROR] TiHTTPClient:   at java.net.SocketInputStream.socketRead0(Native Method)
       [ERROR] TiHTTPClient:   at java.net.SocketInputStream.read(SocketInputStream.java:151)
       [ERROR] TiHTTPClient:   at java.net.SocketInputStream.read(SocketInputStream.java:120)
       [ERROR] TiHTTPClient:   at com.android.okhttp.okio.Okio$2.read(Okio.java:136)
       [ERROR] TiHTTPClient:   at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
       [ERROR] TiHTTPClient:   ... 12 more
       
       
  10. Mostafizur Rahman 2017-11-16

    Hello, I have tested the issue and unable to reproduce the issue using SDK 6.3.0.GA. Please check the callback function used in the *http.js* file(onload function) and make sure there is no syntax error. Please share your appc info here. *Test Environment:* Appcelerator Command-Line Interface, version 6.3.0 Mac OS X 10.12.6 Architecture 64bit CPUs 4 Memory 8589934592 Axway Appcelerator Studio, build: 4.10.0.201709271713 Appcelerator Command-Line Interface, version 6.2.4, SDK Version = SDK 6.3.0.GA Node.js Version = 4.7.0 npm Version = 2.15.11 Android Device: HUAWEI GR3 2017 *Test Steps:* 1. Open Studio 2. Run the project using the sample code provided 3. Click the label *send http post json* and no http error found on our end *Output:* Console logs:
        [INFO] :   ACS Login Results for environment development:
        [INFO] :   [object Object]
        [WARN] :   TiVerify: (Timer-0) [4997,4997] Verifying module licenses...
        [INFO] :   TiVerify: (Timer-0) [1027,6024] Succesfully verified module licenses
        [INFO] :   hwaps: JNI_OnLoad
        [INFO] :   entramos a post {"params":{"venta":{"ven_fecha":"2017-11-15 22:46:13","ven_usuario":7,"ven_cliente":279,"ven_salida":105,"ven_ruta":1,"ven_localidad":1,"ven_total":440,"ven_pagado":440,"ven_factura":0,"ven_tipo":1,"ven_estatus":0,"apa_monto":0,"ven_descuento":"","Detalles":[{"vpr_venta":4,"vpr_salida":105,"vpr_producto":85,"vpr_precio_oficial":180,"vpr_precio_venta":180,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":180,"vpr_descripcion":"LEVITE 24/600 ML JAMAICA","vpr_costo":123},{"vpr_venta":4,"vpr_salida":105,"vpr_producto":89,"vpr_precio_oficial":145,"vpr_precio_venta":145,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":145,"vpr_descripcion":"LEVITE 12/1.5 LT PIÑA COCO","vpr_costo":96.6},{"vpr_venta":4,"vpr_salida":105,"vpr_producto":94,"vpr_precio_oficial":115,"vpr_precio_venta":115,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":115,"vpr_descripcion":"JUIZZY 12/1LT NARANJA","vpr_costo":81.2}]},"usuario":"marcelo","clave":"m1"},"metodo":"subirVentas","url":"http://bebimex.com/sw/servidor/mobil.php"}
        [INFO] :   case 1, readyState = 1
        [INFO] :   entramos a post {"params":{"venta":{"ven_fecha":"2017-11-15 22:46:13","ven_usuario":7,"ven_cliente":279,"ven_salida":105,"ven_ruta":1,"ven_localidad":1,"ven_total":440,"ven_pagado":440,"ven_factura":0,"ven_tipo":1,"ven_estatus":0,"apa_monto":0,"ven_descuento":"","Detalles":[{"vpr_venta":4,"vpr_salida":105,"vpr_producto":85,"vpr_precio_oficial":180,"vpr_precio_venta":180,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":180,"vpr_descripcion":"LEVITE 24/600 ML JAMAICA","vpr_costo":123},{"vpr_venta":4,"vpr_salida":105,"vpr_producto":89,"vpr_precio_oficial":145,"vpr_precio_venta":145,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":145,"vpr_descripcion":"LEVITE 12/1.5 LT PIÑA COCO","vpr_costo":96.6},{"vpr_venta":4,"vpr_salida":105,"vpr_producto":94,"vpr_precio_oficial":115,"vpr_precio_venta":115,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":115,"vpr_descripcion":"JUIZZY 12/1LT NARANJA","vpr_costo":81.2}]},"usuario":"marcelo","clave":"m1"},"metodo":"subirVentas","url":"http://bebimex.com/sw/servidor/mobil.php"}
        [INFO] :   case 1, readyState = 1
        [INFO] :   onsendstream called, readyState = 1
        [INFO] :   onsendstream called, readyState = 1
        [INFO] :   onsendstream called, readyState = 1
        [INFO] :   onsendstream called, readyState = 1
        [INFO] :   case 3, readyState = 3
        [INFO] :   case 3, readyState = 3
        [INFO] :   case 4, readyState = 4
        [INFO] :   Received text: {"result":702,"id":"bebimex"}
        [INFO] :   res:{"result":702,"id":"bebimex"}
        [INFO] :   entramos a post {"params":{"venta":{"ven_fecha":"2017-11-14 17:08:15","ven_usuario":7,"ven_cliente":279,"ven_salida":105,"ven_ruta":1,"ven_localidad":1,"ven_total":783,"ven_pagado":783,"ven_factura":0,"ven_tipo":1,"ven_estatus":0,"apa_monto":0,"ven_descuento":"","Detalles":[{"vpr_venta":3,"vpr_salida":105,"vpr_producto":79,"vpr_precio_oficial":88,"vpr_precio_venta":88,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":88,"vpr_descripcion":"BONAFONT 12/1LT","vpr_costo":59.04},{"vpr_venta":3,"vpr_salida":105,"vpr_producto":80,"vpr_precio_oficial":107,"vpr_precio_venta":107,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":107,"vpr_descripcion":"BONAFONT 12/1.5 LTS","vpr_costo":71.96},{"vpr_venta":3,"vpr_salida":105,"vpr_producto":84,"vpr_precio_oficial":180,"vpr_precio_venta":148,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":148,"vpr_descripcion":"LEVITE 24/600 ML PIÑA COCO","vpr_costo":123},{"vpr_venta":3,"vpr_salida":105,"vpr_producto":85,"vpr_precio_oficial":180,"vpr_precio_venta":180,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":180,"vpr_descripcion":"LEVITE 24/600 ML JAMAICA","vpr_costo":123},{"vpr_venta":3,"vpr_salida":105,"vpr_producto":89,"vpr_precio_oficial":145,"vpr_precio_venta":145,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":145,"vpr_descripcion":"LEVITE 12/1.5 LT PIÑA COCO","vpr_costo":96.6},{"vpr_venta":3,"vpr_salida":105,"vpr_producto":94,"vpr_precio_oficial":115,"vpr_precio_venta":115,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":115,"vpr_descripcion":"JUIZZY 12/1LT NARANJA","vpr_costo":81.2}]}},"metodo":"subirVentas","url":"http://bebimex.com/sw/servidor/mobil.php"}
        [INFO] :   case 4, readyState = 4
        [INFO] :   case 4, readyState = 4
        [INFO] :   case 1, readyState = 1
        [INFO] :   case 4, readyState = 4
        [INFO] :   Received text: {"result":701,"id":"bebimex"}
        [INFO] :   res:{"result":701,"id":"bebimex"}
        [INFO] :   entramos a post {"params":{"venta":{"ven_fecha":"2017-11-14 17:07:51","ven_usuario":7,"ven_cliente":279,"ven_salida":105,"ven_ruta":1,"ven_localidad":1,"ven_total":337,"ven_pagado":337,"ven_factura":0,"ven_tipo":1,"ven_estatus":0,"apa_monto":0,"ven_descuento":"","Detalles":[{"vpr_venta":2,"vpr_salida":105,"vpr_producto":80,"vpr_precio_oficial":107,"vpr_precio_venta":107,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":107,"vpr_descripcion":"BONAFONT 12/1.5 LTS","vpr_costo":71.96},{"vpr_venta":2,"vpr_salida":105,"vpr_producto":94,"vpr_precio_oficial":115,"vpr_precio_venta":115,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":115,"vpr_descripcion":"JUIZZY 12/1LT NARANJA","vpr_costo":81.2},{"vpr_venta":2,"vpr_salida":105,"vpr_producto":96,"vpr_precio_oficial":115,"vpr_precio_venta":115,"vpr_IVA":1,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":115,"vpr_descripcion":"JUGO KIDS 24/300ML  UVA","vpr_costo":78.92}]}},"metodo":"subirVentas","url":"http://bebimex.com/sw/servidor/mobil.php"}
        [INFO] :   case 1, readyState = 1
        [INFO] :   onsendstream called, readyState = 1
        [INFO] :   onsendstream called, readyState = 1
        [INFO] :   onsendstream called, readyState = 1
        [INFO] :   onsendstream called, readyState = 1
        [INFO] :   onsendstream called, readyState = 1
        [INFO] :   case 3, readyState = 3
        [INFO] :   case 4, readyState = 4
        [INFO] :   case 4, readyState = 4
        
    Best
  11. knd_rt@hotmail.com 2017-11-17

    I checked the server and something is not right, the sample proyect should send 4 json objects, and only 2 got inserted, :
          Received text: {"result":701,"id":"bebimex"}
         Received text: {"result":702,"id":"bebimex"}
        
    Also it is supposed to only send one json and wait for the response before sending another, and your log shows async sent. APPC INFO: Operating System Name = Manjaro Linux Version = 17.0.6-EOL Architecture = 64bit # CPUs = 2 Memory = 7.6GB Node.js Node.js Version = 6.11.5 npm Version = 5.5.1 Appcelerator CLI Installer = 4.2.9 Core Package = 6.3.0 Titanium CLI CLI Version = 5.0.14 node-appc Version = 0.2.41 Titanium SDKs 6.3.0.GA Version = 6.3.0 Install Location = /home/knd/.titanium/mobilesdk/linux/6.3.0.GA Platforms = android, mobileweb node-appc Version = 0.2.43 6.2.2.GA Version = 6.2.2 Install Location = /home/knd/.titanium/mobilesdk/linux/6.2.2.GA Platforms = android, mobileweb node-appc Version = 0.2.43 6.1.2.GA Version = 6.1.2 Install Location = /home/knd/.titanium/mobilesdk/linux/6.1.2.GA Platforms = android, mobileweb node-appc Version = 0.2.43 6.1.0.GA Version = 6.1.0 Install Location = /home/knd/.titanium/mobilesdk/linux/6.1.0.GA Platforms = android, mobileweb node-appc Version = 0.2.43 Java Development Kit Version = 1.8.0_152 Java Home = /lib/jvm/java-8-jdk
  12. Gary Mathews 2018-02-28

    master: https://github.com/appcelerator/titanium_mobile/pull/9893
  13. knd_rt@hotmail.com 2018-03-10

    I used jquery .ajax in a webview as a workaround to send the json objects
  14. Lokesh Choudhary 2018-05-09

    FR Passed. Waiting for merge to get enabled.
  15. Lokesh Choudhary 2018-10-23

    PR Merged.
  16. Samir Mohammed 2018-10-25

    *Closing ticket* Verified fix in SDK Version 7.5.0.v20181025051112. test and other information can be fount at: https://github.com/appcelerator/titanium_mobile/pull/9893

JSON Source