Some questions about WCF servers and clients

A

Andrew Falanga

Hi,

I'm very much a newbie to the whole WCF thing. I'm working a client/
server system that uses TCP, from the code I modeled from on MSDN I'm
assuming http. However, in the tutorial I setup the client by first
starting the server and then using svcutil to "talk" with the server
and generate some code for the client program. Then, when using the
client, I don't even have to specify hostnames or anything. I just
new a client class object and away I go.

The question is, the plan for the project I'm working on is that there
could be a few different servers and, depending on who's using the
client, they would use a different server. How does one make the
client use a different server? Would the svcutil program have to be
run against each server?

Thanks,
Andy
 
S

sloan

If the code is the same then you will alter you <client> area of your client
side configuration files to point to the different host(ing) server.

............

check here.
There are options around the svcutil proxy code generator tool.

Are you doing to have DotNet clients? Or heterogeneous clients?
(java,asp,etc,etc)?

That's a big question in your design.

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry
Check that out. That is a "DotNet to DotNet" WCF example.

I would also suggest the WCF book by Juval Lowy. He's the guru of this
stuff.
Check ebay, sometimes you can get a used copy cheap. Or amazon.com if you
want free shipping (over $25).
No, I don't work for ebay or amazon.
 
M

Mr. Arnold

Andrew Falanga said:
Hi,

I'm very much a newbie to the whole WCF thing. I'm working a client/
server system that uses TCP, from the code I modeled from on MSDN I'm
assuming http. However, in the tutorial I setup the client by first
starting the server and then using svcutil to "talk" with the server
and generate some code for the client program. Then, when using the
client, I don't even have to specify hostnames or anything. I just
new a client class object and away I go.

The question is, the plan for the project I'm working on is that there
could be a few different servers and, depending on who's using the
client, they would use a different server. How does one make the
client use a different server? Would the svcutil program have to be
run against each server?


The client WCF solution has its own app.config or Web.config, and that is
where you make the changes in the the config file to point to where the WCF
server part of the solution is located, which the svcutil would have made
the config file one time and you would copy it to client machines and make
the appropriate changes to point to the service host machine.


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4243 (20090714) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
A

Andrew Falanga

If the code is the same then you will alter you <client> area of your client
side configuration files to point to the different host(ing) server.

...........

check here.
There are options around the svcutil proxy code generator tool.

Are you doing to have DotNet clients?  Or heterogeneous clients?
(java,asp,etc,etc)?

That's a big question in your design.

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry
Check that out.  That is a "DotNet to DotNet" WCF example.

I would also suggest the WCF book by Juval Lowy.  He's the guru of this
stuff.
Check ebay, sometimes you can get a used copy cheap.  Or amazon.com if you
want free shipping (over $25).
No, I don't work for ebay or amazon.

Thanks for the reply. I was hoping that it would as simple as editing
that app.config file. In this case it will all be .NET stuff.

Andy
 
S

sloan

In the simplest of terms....yes, you'll deploy the code to different
servers.
And each client will point its config file information to the different
(hosting) servers.

However, if you're in a dotnet to dotnet world....then using the svcutil
proxy code generator tool to create artificial proxy classes is a high
maintenance route.
Change a server object.....guess what?? Update the proxy (or hand modify
them).

That is why I specifically sent you to that URL (and downloadable example)
because it relies on interfaces and does not need the svcutil proxy code
generator tool.

Easy (Up Front) does not always equate to easiest to maintain down the road.
In fact, I would usually think the opposite. Easier (up front) means more
and harder maintenance down the road.




If the code is the same then you will alter you <client> area of your
client
side configuration files to point to the different host(ing) server.

...........

check here.
There are options around the svcutil proxy code generator tool.

Are you doing to have DotNet clients? Or heterogeneous clients?
(java,asp,etc,etc)?

That's a big question in your design.

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry
Check that out. That is a "DotNet to DotNet" WCF example.

I would also suggest the WCF book by Juval Lowy. He's the guru of this
stuff.
Check ebay, sometimes you can get a used copy cheap. Or amazon.com if you
want free shipping (over $25).
No, I don't work for ebay or amazon.

Thanks for the reply. I was hoping that it would as simple as editing
that app.config file. In this case it will all be .NET stuff.

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top