Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF works as appliction, but not as service
    primarykey
    data
    text
    <p>I have a WCF server that I can run as a service or as a windows forms application. When I run it as a Windows Forms application I can connect to it via my client application. However when I run it as a service using the same code, I cannot connect to it. I have confirmed that the service is running and doing its work. Below is the server's config file.</p> <pre><code>&lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="Cns.TrafficCopService.ManagementService"&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="http://localhost:8000/TrafficCop/ManagementService" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;endpoint address="" binding="wsHttpBinding" contract="Cns.TrafficCopService.IManagementService" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;/system.serviceModel&gt; </code></pre> <p>and its hosting code, called 100 milliseconds after OnStart is called:</p> <pre><code>if (this.serviceHost != null) { this.serviceHost.Close(); } this.serviceHost = new ServiceHost(typeof(ManagementService)); this.serviceHost.Open(); </code></pre> <p>and the client's config file:</p> <pre><code>&lt;system.serviceModel&gt; &lt;bindings&gt; &lt;wsHttpBinding&gt; &lt;binding name="WSHttpBinding_IManagementService" /&gt; &lt;/wsHttpBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="http://localhost:8000/TrafficCop/ManagementService" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IManagementService" contract="IManagementService" name="WSHttpBinding_IManagementService"&gt; &lt;/endpoint&gt; &lt;/client&gt; &lt;/system.serviceModel&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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