Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF Timing out from Windows Services but not Web Applications
    text
    copied!<p><strong>Hi All</strong></p> <p>I am currently having an issue calling a WCF service from a windows service. My Application Solution looks like this.</p> <ul> <li>Web Administration Console (Web Project)</li> <li>Central Control (Windows Service) <ul> <li>WCF service so the Web Administration Console can connect to it and configure it</li> <li>Several Calls to use WCF on the Node (Window Service)</li> </ul></li> <li>Node (Windows Service) <ul> <li>WCF service to allow the Central Control Windows service configure it</li> </ul></li> </ul> <p>The Web Administration Console can access the Central Control WCF but the Central Control Times Out when ever it tries to connect to the Node. In testing this I created a Launcher app which is a simple Windows Form Project which creates an instance of each service and has a couple of buttons which use a WCF function in each of the windows services (just to see what was failing) this Launcher app couldn’t speak to either of the Windows Services. This was confused me so I added the same buttons to a Web Form in the Web Administration Console and it connected to both Windows Services perfectly through WCF. I know the WCF stuff is working as I can hit it through IE and see all of the wonderful XML (and obviously the fact that the calls work from the web app are a good indication of it being up and running)</p> <p><strong>In short</strong> My web apps can use the WCF services in my Windows Services but Windows Forms and Windows services cannot. Why is this!?</p> <p>I have pretty much already run out of time on this project so speedy replies would be awesome!</p> <p><strong>Tech/Code details</strong> I am not using config files in the applications. Everything is being created through code and I have been using the same code to make my WCF calls every where. Also I have tried to turn security off everywhere in case that was the issue. Also I am using the same <strong>svcutil</strong> generated proxy files everywhere as well to keep it all consistent</p> <p><strong>Example of a call to the Node</strong></p> <pre><code>Dim Bind As New WSHttpBinding(SecurityMode.None, True) Bind.CloseTimeout = New TimeSpan(0, 0, 10) Bind.OpenTimeout = New TimeSpan(0, 0, 10) Bind.SendTimeout = New TimeSpan(0, 0, 10) Dim client As New BN.BNodeServiceClient(Bind, New EndpointAddress("http://localhost:27374/Node")) client.sendMessage("Test Message") client.Close() </code></pre> <p><strong>The Node opening its WCF</strong></p> <pre><code>BNodeHost = New ServiceHost(GetType(iBNodeService)) BNodeHost.AddServiceEndpoint(GetType(BNodeService), New WSHttpBinding(SecurityMode.None, True), New Uri("http://localhost:27374/Node")) Dim metadataBehavior As ServiceModel.Description.ServiceMetadataBehavior metadataBehavior = BNodeHost.Description.Behaviors.Find(Of _ ServiceModel.Description.ServiceMetadataBehavior)() If metadataBehavior Is Nothing Then metadataBehavior = New ServiceModel.Description.ServiceMetadataBehavior() metadataBehavior.HttpGetEnabled = True metadataBehavior.HttpGetUrl = New Uri("http://localhost:27374/Node") BNodeHost.Description.Behaviors.Add(metadataBehavior) Else BNodeHost.Description.Behaviors.Add(metadataBehavior) End If BNodeHost.Open() </code></pre> <p>This was all working before I made the different bits proper Windows Services and tried to add installers to it. The installers work fine and install the services which start and allow me to see all the WCF XML in IE.</p> <p>As you might be able to tell, I am very new to WCF and this is my first application using it. The fundamental bits have been pretty much Copy/Paste/Alter jobs from a sample that doesn’t use config files.</p> <p>Any help would be greatly appreciated.</p>
 

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