denghongcai / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

rpc client proxy code generation #63

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
email: s.volchkov@gmail.com

Hello, Marc!

With the recent changes to rpc in protobuf-net, including the removal of
ServiceModel/RpcClient.cs in r242, what would you recommend to use as a
client proxy? As I can see, protogen still has the option -p:protoRpc, that
generates classes like FooClient for Foo rpc service in .proto, which seems
to be almost what I need. However, the FooClient is derived from
non-existent class RpcClient, and additionally I cannot see how to tie the
proxy to specific ITransport.

Apparently, another way to generate client proxy class would be to use
option combination -p:datacontract -p:asynchronous -p:clientProxy, however
that case supposes using WCF.

As an example, please find attached an example foo.proto and the generated
foo.cs. Generation command used:

protogen.exe -i:foo.proto -o:foo.cs -p:protoRpc

Tested on .net 3.5, protobuf-net r260.

Thanks!

Original issue reported on code.google.com by s.volchkov on 20 Jul 2009 at 12:50

Attachments:

GoogleCodeExporter commented 9 years ago
I will need to double-check the current state of RPC generation, which I can't 
do at 
this moment (limited access); however; the protocol buffers spec itself doesn't 
specify any particular RPC stack.

WCF is a very viable option. Initially I added some experimental non-WCF RPC 
code, 
but I don't think this got far; however, more recently I have added 
ProtoClient<TService>, which provides a simple http-based RPC client/server. 
There 
are some simple examples in the example/unit-test project.

I apologise if the code-generation has fallen out of date with the RPC code; 
I'll try 
to get this tied up.

If I have removed something you were actively using, please let me know; but I 
**thought** the code I removed was non-operational.

Original comment by marc.gravell on 20 Jul 2009 at 7:18

GoogleCodeExporter commented 9 years ago
Thanks a lot for your explanation. I apologize for my unclear issue explanation 
-
currently I am investigating possible options of rpc implementation, and 
protobuf
with your HTTP stack looks very convenient, including easy implementations of 
the
same stack in other programming languages. The question was specifically 
regarding
the rpc generation to be up-to-date or not.

I have updated csharp.xslt slightly to use the ProtoClient<> class; after that, 
the
auto-generated client classes worked completely ok for me. My modifications are
attached for your reference.

Original comment by s.volchkov on 21 Jul 2009 at 10:56

Attachments: