omnip620 / node-zookeeper-dubbo

A middleware helps node to communicate dubbo by using its default protocol, which is registered in zookeeper
300 stars 80 forks source link

Dubbo service init done TypeError: Dubbo.FOO.sayHello is not a function #37

Closed 65725738 closed 7 years ago

65725738 commented 7 years ago

什么情况?

const nzd=require('node-zookeeper-dubbo'); const app=require('express')(); const opt={ application:{name:'hello-world-app'}, register:'localhost:2181', root:'dubbo', dependencies:{ FOO:{interface:'com.mor.server.dubbo.service.DemoServer',version:'LATEST',timeout:6000} } } const Dubbo=new nzd(opt); var arg1={$class:'java.lang.String',$:'13100000001'}//参数1 var args=[arg1];//参数数组 app.get('/foo',function(req,res){ Dubbo.FOO.sayHello(args) .then(function(data){ res.send(data); }).catch(function(err){ res.send(err); }); })

app.listen(9090)

omnip620 commented 7 years ago

参数不需要放到数组中 直接用就行 另外 建议使用md格式提问