![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Should I use svcutil? Hello, I have a small app that previously used Remoting. I need to convert it to use WCF. The app contains three assemblies, one client, one server and one interface, e.g. Interfaces.dll: interface IMyService { string MyMethod1(string arg, ...); } Server.exe: set up remoting. Implement IMyService Client.exe: Connect to server, use IMyService implemented by Server.exe Pretty straightforward. Anyway, the schoolbook examples of WCF all use svcutil.exe to generate code for the service from a "live" server. While this is probably a very good approach for writing clients to known services with fixed interfaces, I dislike this approach for a number of reasons, mainly: - I want to compile the whole app in one shot. - I am in control of the interface and the implementation. The interface changes often. - I want to write my own client code to provide additional stuff like fallback servers, retry etc, without having to mess around with CodeDOM graphs. I know of code generation in custom tools etc, I also know that it's possible to generate the client class offline from the servicecontract assembly by using System.ServiceModel.Description.ServiceContractGenerator. But my preferred method of operation is to use something like Remoting's TransparentProxy, while having my code executing at every remoted call, dynamically. This code should not be generated, as that limits flexibility. I'm not sure if anyone gets exactly what I need, but from my point of view it can not be a completely uncommon demand. So, can anyone give me an idea where to start out? Links to examples and book references would be greatly appreciated. Thanks |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Should I use svcutil? You could use the ChannelFactory class: ChannelFactory<IRemoteClass> factory = new ChannelFactory<IRemoteClass>(); IRemoteClass service = factory.CreateProxy(); "Richard" <ri_ma@mydomain.npspam> wrote in message news:erYKUO9OHHA.2232@TK2MSFTNGP02.phx.gbl... > Hello, > I have a small app that previously used Remoting. I need to convert it to > use WCF. > > The app contains three assemblies, one client, one server and one > interface, e.g. > > Interfaces.dll: > interface IMyService { > string MyMethod1(string arg, ...); > } > > Server.exe: > set up remoting. Implement IMyService > > Client.exe: > Connect to server, use IMyService implemented by Server.exe > > Pretty straightforward. > > Anyway, the schoolbook examples of WCF all use svcutil.exe to generate > code for the service from a "live" server. While this is probably a very > good approach for writing clients to known services with fixed interfaces, > I dislike this approach for a number of reasons, mainly: > - I want to compile the whole app in one shot. > - I am in control of the interface and the implementation. The interface > changes often. > - I want to write my own client code to provide additional stuff like > fallback servers, retry etc, without having to mess around with CodeDOM > graphs. > > I know of code generation in custom tools etc, I also know that it's > possible to generate the client class offline from the servicecontract > assembly by using > System.ServiceModel.Description.ServiceContractGenerator. > But my preferred method of operation is to use something like Remoting's > TransparentProxy, while having my code executing at every remoted call, > dynamically. This code should not be generated, as that limits > flexibility. > I'm not sure if anyone gets exactly what I need, but from my point of view > it can not be a completely uncommon demand. > > So, can anyone give me an idea where to start out? Links to examples and > book references would be greatly appreciated. > > Thanks |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Should I use svcutil? Don't forget that such approach will allow you to change config file and not code if you have some data to change ( e.g. IP of hosts .... ) Arkady "Richard" <ri_ma@mydomain.npspam> wrote in message news:erYKUO9OHHA.2232@TK2MSFTNGP02.phx.gbl... > Hello, > I have a small app that previously used Remoting. I need to convert it to > use WCF. > > The app contains three assemblies, one client, one server and one > interface, e.g. > > Interfaces.dll: > interface IMyService { > string MyMethod1(string arg, ...); > } > > Server.exe: > set up remoting. Implement IMyService > > Client.exe: > Connect to server, use IMyService implemented by Server.exe > > Pretty straightforward. > > Anyway, the schoolbook examples of WCF all use svcutil.exe to generate > code for the service from a "live" server. While this is probably a very > good approach for writing clients to known services with fixed interfaces, > I dislike this approach for a number of reasons, mainly: > - I want to compile the whole app in one shot. > - I am in control of the interface and the implementation. The interface > changes often. > - I want to write my own client code to provide additional stuff like > fallback servers, retry etc, without having to mess around with CodeDOM > graphs. > > I know of code generation in custom tools etc, I also know that it's > possible to generate the client class offline from the servicecontract > assembly by using > System.ServiceModel.Description.ServiceContractGenerator. > But my preferred method of operation is to use something like Remoting's > TransparentProxy, while having my code executing at every remoted call, > dynamically. This code should not be generated, as that limits > flexibility. > I'm not sure if anyone gets exactly what I need, but from my point of view > it can not be a completely uncommon demand. > > So, can anyone give me an idea where to start out? Links to examples and > book references would be greatly appreciated. > > Thanks |
My System Specs![]() |