Android Restet HTTPS

When trying to get some data on my Android client from my web service (running on the application) using this code

ClientResource cr = new ClientResource("https://myapp.appspot.com/restlet/service/");
IServiceResource res = cr.wrap(IServiceResource.class);
m_Services = res.getServices();

I get this error:

05-20 08:30:15.406: ERROR/AndroidRuntime(31767): Caused by: Communication Error (1001) - Could not change the mode after the initial handshake has begun.

I have org.restlet.ext.ssl.jar for https support and I use this line to add a client

Engine.getInstance().getRegisteredClients().add(new HttpsClientHelper(null));

this is the closest I came to receive https: // calls to work since I moved to restlet 2.1m4 (moved because I needed the Buffering entity ..)

Any ideas? Any other information I have to provide?

+5
source share
2 answers

It worked. Changed HttpClient to org.restlet.ext.net.

On Android, you are prompted to do this to change the client

Engine.getInstance().getRegisteredClients().add(new HttpClientHelper(null));

,

Engine.getInstance().getRegisteredClients().clear();
Engine.getInstance().getRegisteredClients().add(new HttpClientHelper(null));

( org.restlet.ext.ssl ​​ ). , " (1002)). , , .

+3

- ksoap2, ksoap2, ur.

0

All Articles