1
AjaxCallback<XmlDom> cb = new AjaxCallback<XmlDom>();
cb.weakHandler(this, callback).url(soapUrl).type(XmlDom.class)
    .header("CustomHeader", "Custom_header_string")
    .header("Content-Type", "application/xml;charset=utf-8");
cb.method(AQuery.METHOD_POST);
HttpEntity entity = new StringEntity(data);
cb.param(AQuery.POST_ENTITY,entity);
cb.setSSF(SelfSignedCertsSSLSocketFactory.getSocketFactory());
aq.sync(cb);

is my Aquery code for sending a POST request to a server on a VPNed network. I seem to get a 200 response, as I get the following, but the callback is never called.

W/AQuery﹕ response:200

Am I doing anything wrong, and how can I find out more?

Tom Macdonald
  • 6,433
  • 7
  • 39
  • 59

1 Answers1

1

Firstly I set the URL to callback property, the URL never called and the callback never fired. Finally I set the URL direct to AQuery and working

    AjaxCallback<JSONObject> cb = new AjaxCallback<JSONObject>() {

        @Override
        public void callback(String url, JSONObject html, AjaxStatus status) {        
            System.out.println(html);
        }
    };

    AQuery aq = new AQuery(MainActivity88.this);

    cb.header("Authorization", "key=yourkey");
    cb.header("Content-Type", "application/json; charset=utf-8");

    Map<String, Object> params = new HashMap<String, Object>();
    params.put(AQuery.POST_ENTITY, createStringEntity(json));

    cb.params(params);

    aq.ajax("https://yourdomain.com",JSONObject.class, cb);

try also http://loopj.com/android-async-http/

Zakari
  • 453
  • 4
  • 15