Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. windows service

windows service

Scheduled Pinned Locked Moved C#
questioncsharpwcfdata-structures
14 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Mirko1980

    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.

    A Offline
    A Offline
    arkiboys
    wrote on last edited by
    #5

    Yes, the wcf is separate to windows service.

    M 1 Reply Last reply
    0
    • A arkiboys

      Yes, the wcf is separate to windows service.

      M Offline
      M Offline
      Mirko1980
      wrote on last edited by
      #6

      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.

      A 1 Reply Last reply
      0
      • M Mirko1980

        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.

        A Offline
        A Offline
        arkiboys
        wrote on last edited by
        #7

        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

        M 1 Reply Last reply
        0
        • A arkiboys

          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

          M Offline
          M Offline
          Mirko1980
          wrote on last edited by
          #8

          Yes, you are right.

          A 2 Replies Last reply
          0
          • M Mirko1980

            Yes, you are right.

            A Offline
            A Offline
            arkiboys
            wrote on last edited by
            #9

            Many thanks

            1 Reply Last reply
            0
            • M Mirko1980

              Yes, you are right.

              A Offline
              A Offline
              arkiboys
              wrote on last edited by
              #10

              I have now developed a simple console app based on the example:

              M 1 Reply Last reply
              0
              • A arkiboys

                I have now developed a simple console app based on the example:

                M Offline
                M Offline
                Mirko1980
                wrote on last edited by
                #11

                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.

                A 1 Reply Last reply
                0
                • M Mirko1980

                  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.

                  A Offline
                  A Offline
                  arkiboys
                  wrote on last edited by
                  #12

                  Hi, I don't think I have "and a console application that exposes a WCF service" I only have a windows service.

                  M 1 Reply Last reply
                  0
                  • A arkiboys

                    Hi, I don't think I have "and a console application that exposes a WCF service" I only have a windows service.

                    M Offline
                    M Offline
                    Mirko1980
                    wrote on last edited by
                    #13

                    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.

                    A 1 Reply Last reply
                    0
                    • M Mirko1980

                      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.

                      A Offline
                      A Offline
                      arkiboys
                      wrote on last edited by
                      #14

                      Thank you

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups