Soap query with jQuery / Phonegap always fail on Android

I developed an iPhone/Android app with jQuery mobile & Phonegap (now Cordova). This app use different services with no problem. One of this services is a Soap one so i use the jsSOAPClient (jquery.jqSOAPClient.js) for jQuery in order to request the service. I have no problem at all from an iOS device but the query always fail on Android.

In jsSOAPClient the request looks like that :

  • Is there a repo where you can download android virtual devices?
  • Why shouldn't I use the menu icons provided by the OS?
  • Why does OnClickListener on a ViewHolder don't work?
  • android remote service within the app vs separate app
  • Google Analytics on Android
  • Justify Text in TextView Android
  •         function getResponse(xData, status) {
                if(!!callback) {
                    SOAPClient.Status = xData.status;
                    SOAPClient.ResponseText = xData.responseText;
                    SOAPClient.ResponseXML = xData.responseXML;
                 type: "POST",
                 url: SOAPClient.Proxy,
                 dataType: "xml",
                 processData: false,
                 data: content,
                 complete: getResponse,
                 beforeSend: function(req) {
                    req.setRequestHeader("Method", "POST");
                    req.setRequestHeader("Content-Length", SOAPClient.ContentLength);
                    req.setRequestHeader("Content-Type", SOAPClient.ContentType + "; charset=\"" + SOAPClient.CharSet + "\"");
                    req.setRequestHeader("SOAPServer", SOAPClient.SOAPServer);
                    req.setRequestHeader("SOAPAction", soapReq.Action);

    The “getResponse” “status” value is “error” and the “SOAPClient.Status” (equal to “xData.status”) value is “0”.

    The server seems to not receive request at all…

    I repeat that the same code with the same request datas have results on iOS.

    Thanks for help.

    / EDIT */
    I tried to comment the line :

    //type: "POST",

    it seems to work, i mean i have a 200 status code in this case even if i have a parse error due to the unexpected response format.

    Related posts:

    How can I get device ID for Admob
    Error:(27, 13) Failed to resolve:
    Android Mediarecorder recorded video duration different from expected duration
    How can I programmatically include layout in Android?
    How can I add spacing in RelativeLayout
    How to fold if/else sub blocks in eclipse
  • Android ListView with Button is not selectable(Clickable)
  • How to hide Soft Keyboard when activity starts
  • android - align a textview to the center of another view
  • Capture image without intent, Gives different output on different devices
  • Chromium webview does not seems to work with Android applyOverrideConfiguration
  • Subscribing topics with Google Cloud Messenger token, Invalid argument received
  • One Solution collect form web for “Soap query with jQuery / Phonegap always fail on Android”

    Apparently there is a bug in Android 2.x where setting the
    “Content-length” header causes the problem you describe. It looks like
    the bug has been fixed in Android 4.0.3. So try your code unmodified
    in the 4.0.3 emulator and it should work then come back to 2.x and
    remove the Content-length header to see if it works as well.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.