Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加withType参数 #53

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

lishengguo
Copy link

增加withType参数,控制hessian是否返回{$class:'',$:{}},

update parent project code
增加withType参数,控制hessian是否返回{$class:'',$:{}},
@omnip620
Copy link
Owner

感谢提供新特性,不过有点不太明白这个参数的意义,能否稍微详细说明下,以及参数有哪些可选值,🙏。

@lishengguo
Copy link
Author

lishengguo commented Oct 19, 2017

withType是hessian返回的对像是否带类型,默认为false,为true时返回值形式如:{$class:'java.lang.Long',$:100}。
opt.withType改成opt.returnWithType更好理解点, 是吧。

 增加opt.returnWithType 参数,默认值为false,为true时hessain返回的对象有类型描述信息,如:{$class:'boolean',$:true}。
使用场景:根据类型做反序列化时使用。
@xiaojinhe2
Copy link

Hello,
I would like to ask node-zookeeper-dubbo this module how to use it, I always use TypeError: Cannot read property 'buildUserAgentTree' of undefined can not find the method, in fact, this service interface exists, I use telnet to log in dubbo When you can view the interface information of the service through ls, the following is my call code, trouble to help look down

var nzd = require('node-zookeeper-dubbo');

const opt = {
application:{ name:'parkhelper-service' },
registry:'127.0.0.1:2182',
dubboVer:'2.6.1',
group:'cn.parkhelper',
root:'dubbo',
dependencies:{
AgentService:{
interface:'cn.parkhelper.service.park.AgentService',
version:'1.0-SNAPSHOT',
group:'cn.parkhelper',
timeout:5000
}
}
};

const Dubbo = new nzd(opt);

var arg1 = {$class:'java.lang.String',$:'8a04a41f59305d810159639b42ae000d'};
Dubbo.AgentService.buildUserAgentTree(arg1).then(function(data){ //error message is here
console.log(data);
}).catch(function(err){
console.log(err);
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants