Thanks Mr. Michael Lumish for your timely reply.

Actually I think that error is because I was calling server-side streaming 
function as simple rpc function. So please ignore the previous error.
But when I tried to call correctly I got the below error. I guess below 
error is caused because I'm not passing the correct parameters to 
grpc.credentials.createFromMetadataGenerator 
function  

W20170523-13:20:15.298(-3)? (STDERR) 
C:\Users\xxxxxxxx\Desktop\Meteor_Practice\node_modules\grpc\src\node\src\credentials.js:100
W20170523-13:20:15.300(-3)? (STDERR)     metadata_generator({service_url: 
service_url}, function(error, metadata) {
W20170523-13:20:15.301(-3)? (STDERR)     ^
W20170523-13:20:15.311(-3)? (STDERR) TypeError: metadata_generator is not a 
function
W20170523-13:20:15.317(-3)? (STDERR)     at 
C:\Users\xxxxxx\Desktop\Meteor_Practice\node_modules\grpc\src\node\src\credentials.js:100:5
=> Exited with code: 1


Below given is my program. I just wanted to know what is the input 
parameter for grpc.credentials.createFromMetadataGenerator function. 
Whether the parameter is metadata or access token?
Can you please explain me how to process the access token before passing it 
to grpc.credentials.createFromMetadataGenerator function.

var metadata = new grpc.Metadata();
metadata.add('authorization', access_token);
console.log(metadata);
var auth_creds = grpc.credentials.createFromMetadataGenerator(metadata);
console.log(auth_creds);
var combined_creds = grpc.credentials.combineChannelCredentials(ssl_creds, 
auth_creds);
var clientnew = new proto.Gateway('localhost:50001',combined_creds);
var cmd = {};
var call = clientnew.somefunction(cmd);
call.on('data', function(systems) {
  console.log(systems);
});


-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/bd471b80-f020-4542-a07a-0e2ac2449729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to