Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here's how I got this to work self hosted using an app.config file. I did it this way because this is what I am familiar with. If you want, I can modify it to be configured through code instead of through the app.config file...</p> <pre><code>using System; using System.ServiceModel; using Castle.Facilities.WcfIntegration; using Castle.MicroKernel.Registration; using Castle.Windsor; namespace DISandbox { public class Program { private static WindsorContainer _container; public static void Main(string[] args) { _container = new WindsorContainer(); _container.AddFacility&lt;WcfFacility&gt;(); _container.Register( Component .For&lt;IAccountDataService&gt;() .ImplementedBy&lt;AccountDataService&gt;() .AsWcfService(), Component .For&lt;IInstitutionDataService&gt;() .ImplementedBy&lt;InstitutionDataService&gt;() .AsWcfService()); Console.WriteLine("Press any key to exit..."); Console.ReadLine(); } } [ServiceContract] public interface IAccountDataService { [OperationContract] void DoStuff(); } public class AccountDataService : IAccountDataService { public void DoStuff() { } } [ServiceContract] public interface IInstitutionDataService { [OperationContract] void DoStuff(); } public class InstitutionDataService : IInstitutionDataService { public void DoStuff() { } } } </code></pre> <p>And the config file...</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;system.serviceModel&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="MyHttpServiceBehavior"&gt; &lt;serviceMetadata httpGetEnabled="True" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="True" httpHelpPageEnabled="True"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;services&gt; &lt;service name="DISandbox.AccountDataService" behaviorConfiguration="MyHttpServiceBehavior"&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="http://localhost:49246/AccountDataService"/&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;endpoint binding="basicHttpBinding" contract="DISandbox.IAccountDataService" /&gt; &lt;/service&gt; &lt;service name="DISandbox.InstitutionDataService" behaviorConfiguration="MyHttpServiceBehavior"&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="http://localhost:49246/InstitutionDataService"/&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;endpoint binding="basicHttpBinding" contract="DISandbox.IInstitutionDataService" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;/system.serviceModel&gt; &lt;/configuration&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload