Fre*_*erg 5 https android restlet
尝试使用此代码从我的webservice(在app-engine上运行)获取我的Android客户端上的一些数据时
ClientResource cr = new ClientResource("https://myapp.appspot.com/restlet/service/");
IServiceResource res = cr.wrap(IServiceResource.class);
m_Services = res.getServices();
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
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.
Run Code Online (Sandbox Code Playgroud)
我有https支持的org.restlet.ext.ssl.jar,我使用这一行添加客户端
Engine.getInstance().getRegisteredClients().add(new HttpsClientHelper(null));
Run Code Online (Sandbox Code Playgroud)
这是我最接近https://调用工作,因为我搬到了resm 2.1m4(因为我需要entityBuffering而移动).
有任何想法吗?我需要分享的其他任何信息?
成功了。将 HttpClient 更改为 org.restlet.ext.net。
在 Android 上,系统会告诉您执行此操作来更改客户端
Engine.getInstance().getRegisteredClients().add(new HttpClientHelper(null));
Run Code Online (Sandbox Code Playgroud)
然而这样做没有任何改变,相反,我取得了成功
Engine.getInstance().getRegisteredClients().clear();
Engine.getInstance().getRegisteredClients().add(new HttpClientHelper(null));
Run Code Online (Sandbox Code Playgroud)
这解决了问题(请确保您的构建路径中也有 org.restlet.ext.ssl )。这还解决了其他问题,例如“内部连接器错误 (1002) - 调用线程在等待响应以解锁它时超时”。
| 归档时间: |
|
| 查看次数: |
2228 次 |
| 最近记录: |