windows service
-
Hello, I am populating a queue inside a windows service. The windows service is now installed and started on my machine. I can see in the eventlog that the queue is indeed populated i.e. enqueue and Dequeue... In the windows service, there is a simple method i.e. getQueueData which should return what is inside the queue. While the windowsservice is running, I start a wcf project which has a reference to the getQueueData method inside the windowsservice. Question: Should the wcf return the queue as it is showing inside the eventlog? I mean, while I see the queue being populated, the at the same time when I run the wcf, then should the wcf return the number of items in the queue? I ask because the wcf only seems to think there is always zero items in the queue whilst I see the eventlog and queue has data in it. Have I done everything correctly? Thanks
-
Hello, I am populating a queue inside a windows service. The windows service is now installed and started on my machine. I can see in the eventlog that the queue is indeed populated i.e. enqueue and Dequeue... In the windows service, there is a simple method i.e. getQueueData which should return what is inside the queue. While the windowsservice is running, I start a wcf project which has a reference to the getQueueData method inside the windowsservice. Question: Should the wcf return the queue as it is showing inside the eventlog? I mean, while I see the queue being populated, the at the same time when I run the wcf, then should the wcf return the number of items in the queue? I ask because the wcf only seems to think there is always zero items in the queue whilst I see the eventlog and queue has data in it. Have I done everything correctly? Thanks
arkiboys wrote:
Have I done everything correctly?
Obviously not. If your queue has data in it, and you can't see it then you haven't done everything correctly. Without seeing your code, I'm going to take a flier as a guess - your queue is not a singleton inside the windows service, and the WCF functionality is seeing a different instance. As I say though, we can't do anymore to diagnose the issue because we have no idea what your code is. What you could do, is attach your debugger to the running instance of the service and actually step through the code and see what's going on. That would be my choice.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
Hello, I am populating a queue inside a windows service. The windows service is now installed and started on my machine. I can see in the eventlog that the queue is indeed populated i.e. enqueue and Dequeue... In the windows service, there is a simple method i.e. getQueueData which should return what is inside the queue. While the windowsservice is running, I start a wcf project which has a reference to the getQueueData method inside the windowsservice. Question: Should the wcf return the queue as it is showing inside the eventlog? I mean, while I see the queue being populated, the at the same time when I run the wcf, then should the wcf return the number of items in the queue? I ask because the wcf only seems to think there is always zero items in the queue whilst I see the eventlog and queue has data in it. Have I done everything correctly? Thanks
-
arkiboys wrote:
Have I done everything correctly?
Obviously not. If your queue has data in it, and you can't see it then you haven't done everything correctly. Without seeing your code, I'm going to take a flier as a guess - your queue is not a singleton inside the windows service, and the WCF functionality is seeing a different instance. As I say though, we can't do anymore to diagnose the issue because we have no idea what your code is. What you could do, is attach your debugger to the running instance of the service and actually step through the code and see what's going on. That would be my choice.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
Hi, Do you mean the following ? 1- start the windows service in the services list 2- in th ewindows service project, debug, attach to process, select the windows service from the list. If thi sis what you mean, then i do not see the windows service that I started in the list of the attach to process window. Thanks
-
Is the WCF service hosted by your Windows service? Or is a different executable? If the second, obviously the WCF service sees an empty queue, because it references a different object from the one used by the Windows service.
-
Then, as I said, the queue you use in the WCF service is different from the one populated in the Windows service. The WCF service must be hosted by the Windows service and reference the same instance of the queue. See here for hosting WCF services in custom applications.
-
Then, as I said, the queue you use in the WCF service is different from the one populated in the Windows service. The WCF service must be hosted by the Windows service and reference the same instance of the queue. See here for hosting WCF services in custom applications.
I see what you mean. To make me understand better I would like to ask: 1- can my issue be solved if silverlight page accesses the method which is inside the windows service project? I think the answer is No and even if it did I still face the same issue because it will be lokking at a different instance to the one with the queue in it. I guess the only way to get around this is as you said to host the wcf inside the windows service project which has the queue in it being build. Am I right please? Thanks
-
I see what you mean. To make me understand better I would like to ask: 1- can my issue be solved if silverlight page accesses the method which is inside the windows service project? I think the answer is No and even if it did I still face the same issue because it will be lokking at a different instance to the one with the queue in it. I guess the only way to get around this is as you said to host the wcf inside the windows service project which has the queue in it being build. Am I right please? Thanks
-
Now you have a Windows service (that is actually a console application) that manages your queue, and a console application that exposes a WCF service. What you have to do is to put the two things together: include the code of the new console app into the code of your Window Service and make sure that both reference the same queue instance. Then, when you start the Windows service, it will also expose the WCF service that you can call from Silverlight.
-
Now you have a Windows service (that is actually a console application) that manages your queue, and a console application that exposes a WCF service. What you have to do is to put the two things together: include the code of the new console app into the code of your Window Service and make sure that both reference the same queue instance. Then, when you start the Windows service, it will also expose the WCF service that you can call from Silverlight.
-
Hi, I don't think I have "and a console application that exposes a WCF service" I only have a windows service.
You said "I have now developed a simple console app based on the example". So I thought that you had put the WCF service on a separate Console Application. If you have already put the WCF service into the Windows service, you should be able to browse it from IE on the url you specified when coding it (the example I gave you uses http://localhost:8080/hello). You have only to add a service reference to your WCF service in the Silverlight application so that it can communicate with the Windows service.
-
You said "I have now developed a simple console app based on the example". So I thought that you had put the WCF service on a separate Console Application. If you have already put the WCF service into the Windows service, you should be able to browse it from IE on the url you specified when coding it (the example I gave you uses http://localhost:8080/hello). You have only to add a service reference to your WCF service in the Silverlight application so that it can communicate with the Windows service.