Android Restlet HTTPS
当尝试使用此代码从我的网络服务(在应用程序引擎上运行)获取 Android 客户端上的一些数据时,
ClientResource cr = new ClientResource("https://myapp.appspot.com/restlet/service/");
IServiceResource res = cr.wrap(IServiceResource.class);
m_Services = res.getServices();
我收到此错误:
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.
我有 https 支持的 org.restlet.ext.ssl.jar 并且我正在使用此添加客户端的行,
Engine.getInstance().getRegisteredClients().add(new HttpsClientHelper(null));
这是自从我升级到 Restlet 2.1m4 以来我最接近的 https:// 调用工作(移动是因为我需要实体缓冲..)
有什么想法吗? 我还需要分享其他信息吗?
When trying to get some data on my android client from my webservice (running on app-engine) with 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 the org.restlet.ext.ssl.jar for the https-support and i am using this line to add the client
Engine.getInstance().getRegisteredClients().add(new HttpsClientHelper(null));
this is the closest i have come to getting https:// calls to work since i moved up to restlet 2.1m4 (moved because i was in need of entityBuffering..)
Any ideas?
Any other information i need to share?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
成功了。
将 HttpClient 更改为 org.restlet.ext.net。
在Android上,你被告知这样做来改变客户端,
但是这样做没有任何改变,相反,我成功地
解决了这个问题(确保在你的构建路径中也有org.restlet.ext.ssl)。
这还解决了其他问题,例如“内部连接器错误 (1002) - 调用线程在等待响应以解锁它时超时”。
Got it working.
Changed HttpClient to org.restlet.ext.net.
On Android, you are told to do this to change the client
However nothing changes by doing so, instead, i had success with
This solves the issu(be sure to have org.restlet.ext.ssl in your build path aswell).
This also solves other issues such as the "Internal Connector Error (1002) - The calling thread timed out while waiting for a response to unblock it."
我曾使用 ksoap2 处理过 Web 服务,您可以通过下载 jar 并将其包含在您的项目中来尝试使用 ksoap2。
I had worked with web service using ksoap2, u can try using ksoap2 by downloading the jar and including in ur project.