I agree that there are no documents for the wcf object, and this is sad because it is a really great tool, and it would be very disappointing if people did not use it because they could not get started, so let me see, I I can help you a little if I can ...
Create three project applications that have:
- Class Library for General Contracts
- Console application acting as a server
- Console application acting as a client
The idea is that we want to be able to use service names when we register services and share the base URL (I think this is what you asked for, and if not, I hope you can extrapolate here). So, firstly, general contracts just have this in it (nothing special, normal WCF tariff):
[ServiceContract] public interface IMyService1 { [OperationContract] void DoSomething(); } [ServiceContract] public interface IMyService2 { [OperationContract] void DoSomethingToo(); }
Now the console console application looks like this: first we execute service contracts (again, nothing special there, just classes that implement interfaces), and then just register them as services (do not pay attention to any configuration file here, and you can change how do you decide which services, etc. use all the options that Windsor gives you - my scheme is a bit limited, but it gives you an idea):
namespace Services { public class MyService1 : IMyService1 { public void DoSomething() { } } public class MyService2 : IMyService2 { public void DoSomethingToo() { } } }
And this is the server, now how to use these services? Well, actually it's pretty simple, here is the client console application (it only refers to the contract class library):
class Program { static void Main() {
This, hopefully, will get you started (I find that experimenting and using intellisense usually leads me where I need to go). I showed you both sides of the service and the customer, but you can just use one or the other if you want.
You should be able to see where the binding is and how I started building the URLs, so in your case, you can just rip out your base URL from the configuration file or whatever you want to do.
It should be mentioned that you can add your custom behavior to the endpoint by adding it as an extension for the endpoint, so in the client example you will have something like this:
Endpoint = WcfEndpoint .BoundTo(new WSHttpBinding()) .At(string.Format("http://localhost/MyServices/{0}", c.Name.Substring(1))) .AddExtensions(new AuthTokenBehavior())