因项目需要,需要在iPhone上使用hessian协议和server端通讯。找到了现成的 hessiankit,不过还是遇到了些问题。
记录下:
hessiankit: http://wiki.caucho.com/Hessian_-_Objective-C_2.0_Implementation
1. server端有用户名 密码的验证,需要在hessian协议里加入。通过参考其他语言的hessian实现和网络截包,发现只要
在http头中加入 Authorization 的值就可以了,值是由用户名和密码组成的一个24位变32为的字段。
2.在自定义对象转换时遇到这个问题 unrecognized selector sent to instance 调查后发现是本地对象和远程对象的
域名不匹配。作者没在doc中说明。加入 CWHessianTranslator * ct=[[CWHessianTranslator alloc]init];
[ct setProtocol:@protocol(HHostCard) forDistantTypeName:@"com.glority.ecard.hessian.so.HHostCard"]; fix。
使用HessianKit的记录
最新推荐文章于 2024-09-14 16:00:00 发布