Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - Should I use svcutil?

 
 
Old 01-19-2007   #1 (permalink)
Richard


 
 

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 SpecsSystem Spec
Old 01-19-2007   #2 (permalink)
Mariano Omar Rodriguez


 
 

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 SpecsSystem Spec
Old 01-21-2007   #3 (permalink)
Arkady Frenkel


 
 

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 SpecsSystem Spec
 

Thread Tools



Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46