使用HessianKit的记录

来源:互联网 发布:淘宝达人时尚大咖 编辑:程序博客网 时间:2024/04/27 00:52

因项目需要,需要在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。

原创粉丝点击