Tutorial by Examples

Create an interface decorated with a ServiceContract attribute and member functions decorated with the OperationContract attribute. namespace Service { [ServiceContract] interface IExample { [OperationContract] string Echo(string s); } } Create a concrete...
Let's say you have a service the same as the one defined in the "First service and host" example. To create a client, define the client configuration section in the system.serviceModel section of your client configuration file. <system.serviceModel> <services> <cli...
SOAP services can publish metadata that describes the methods that may be invoked by clients. Clients can use tools such as Visual Studio to automatically generate code (known as client proxies). The proxies hide the complexity of invoking a service. To invoke a service, one merely invokes a metho...
Creating a ServiceHost programmatically (without config file) in its most basic form: namespace ConsoleHost { class ConsoleHost { ServiceHost mHost; public Console() { mHost = new ServiceHost(typeof(Example), new Uri("net.tcp://localhost:9000/Example")); ...
When you also want to expose metadata without a config file you can build on the example programmatically creating a ServiceHost: public ConsoleHost() { mHost = new ServiceHost(typeof(Example), new Uri("http://localhost:8000/Example"), new Uri("net.tcp://9000/Example")); ...

Page 1 of 1