Note that there are some explanatory texts on larger screens.

plurals
  1. POcannot print the Json-RPC Response
    primarykey
    data
    text
    <p>I have a java webservice, that must return a response if the login is successful</p> <p>The return line of the server side method is</p> <pre><code> return new Response(new InfoSessionJson(newKey, is), null, id); </code></pre> <p>To get the response I have tried to use the code</p> <pre><code>HttpResponse response = mClient.execute(httppost); HttpEntity entity = response.getEntity(); InputStream is = entity.getContent(); if(response != null){ BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder(); String line = null; loggato=true; try { while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } System.out.println("The response is "+sb.toString()); </code></pre> <p>But the output print returns an apache error</p> <p>I have tried to print the output of the</p> <pre><code>HttpEntity entity = response.getEntity(); InputStream is = entity.getContent(); </code></pre> <p>directly with </p> <pre><code> System.out.print(entity); System.out.print(response); </code></pre> <p>and this print:</p> <p><em>org.apache.http.conn.BasicManagedEntity@40575ac8 org.apache.http.message.BasicHttpResponse@40574a00</em></p> <p>Where is the error??</p> <p>I cannot parse the response correctly or the problem is before???</p> <p>the webservice method has this fim</p> <pre><code>@Webservice(paramNames = {"email", "password", "stayLogged", "idClient"}, public Response startSession(String email, String password, Boolean stayLogged, String idClient) </code></pre> <p>and I send a json with</p> <pre><code>StringEntity stringEntity = new StringEntity(jsonObject.toString()); httpost.setEntity(stringEntity); httpost.setHeader("Accept", "application/json"); httpost.setHeader("Content-type", "application/json"); </code></pre> <p>Where the json object sent is </p> <pre><code>{"method":"startSession","params":[{"email":"test.web@yahoo.it","password":"1234","idClient":"ANDROID","stayLogged":"1"}]} </code></pre> <p>The webservice works fine with an iOS app but wont work with mine android app,</p> <p>Where is the error in the procedure that I have described in this thread???</p> <p>I hope someone can help me.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload