locked
ServiceTutorial5 Not starting subscribed service RRS feed

  • Question

  • I am new to MSRDS and have begun running through the service tutorials. Up through the fourth tutorial I have simply been updating the ServiceTutorial1 service. When I started the fifth one I created another service (ServiceTutorial5) in the same solution as my ServiceTutorial1 service. I completed the tutorial up to and including this statement. 

    _clockPort.Subscribe(_clockNotify);
    

    The tutorial states that if I then build and run the project, that I should see both ServiceTutorial4 and ServiceTutorial5 started. However, I only see ServiceTutorial4 and then the tick print outs. I have gone over the tutorial a several times to make sure I did not miss anything and I don't believe I have. One difference I did notice was that the tutorial said to add: "using rst4 = Robotics.ServiceTutorial4.Proxy". However, I could only add: "using rst1 = Robotics.Proxy;". 

    I have searched the forums for other ServiceTutorial5 problems, but saw none that were similar to mine. I am sure that I am missing something small and would appreciate any help from those more experienced.

    Monday, August 31, 2009 3:42 AM

Answers

  • Which version of RDS are you using? (It makes a difference).

    If you have been editing ServiceTutorial1, it is likely that you have not really created ServiceTutorial4. In the code for ServiceTutorial5 it partners with ServiceTutorial4, but it relies on the rst4 alias. If you cannot create this alias, it suggests that you don't have a ServiceTutorial4, or you have not added a reference to ServiceTutorial4 in your project.

    Note that ServiceTutorial5 automatically starts ServiceTutorial4 because of the following code at the top of the service:

            #region CODECLIP 02-2
            // Partner with ServiceTutorial4 and refer to it by the name Clock
            [Partner("Clock", Contract = rst4.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExistingOrCreate)]
            rst4.ServiceTutorial4Operations _clockPort = new rst4.ServiceTutorial4Operations();
            rst4.ServiceTutorial4Operations _clockNotify = new rst4.ServiceTutorial4Operations();
            #endregion
    


    Trevor
    Tuesday, September 1, 2009 5:59 AM

All replies

  • Which version of RDS are you using? (It makes a difference).

    If you have been editing ServiceTutorial1, it is likely that you have not really created ServiceTutorial4. In the code for ServiceTutorial5 it partners with ServiceTutorial4, but it relies on the rst4 alias. If you cannot create this alias, it suggests that you don't have a ServiceTutorial4, or you have not added a reference to ServiceTutorial4 in your project.

    Note that ServiceTutorial5 automatically starts ServiceTutorial4 because of the following code at the top of the service:

            #region CODECLIP 02-2
            // Partner with ServiceTutorial4 and refer to it by the name Clock
            [Partner("Clock", Contract = rst4.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExistingOrCreate)]
            rst4.ServiceTutorial4Operations _clockPort = new rst4.ServiceTutorial4Operations();
            rst4.ServiceTutorial4Operations _clockNotify = new rst4.ServiceTutorial4Operations();
            #endregion
    


    Trevor
    Tuesday, September 1, 2009 5:59 AM
  • Hi Trevor,
    Thank you for responding. I am also reading your book as I go along with these service tutorials! I am using RDS 2008 R2 Express. Anyway, here is my code that you were making reference to in your post:

    using rst1 = Robotics.Proxy;

    [Partner("Clock", Contract = rst1.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExistingOrCreate)] rst1.ServiceTutorial1Operations _clockPort = new rst1.ServiceTutorial1Operations();
    rst1.ServiceTutorial1Operations _clockNotify = new rst1.ServiceTutorial1Operations();

    In my .NET solution I have both a service for ServiceTutorial4 (Still named ServiceTutorial1) and another service for ServiceTutorial5. In the code above, I reference ServiceTutorial1 since that is the service which holds all the code I have completed up through Tutorial 4. I have compared my code for Tutorial 5 with the already completed one in the "ServiceTutorials" folder. However, I have not done the same for Tutorial 4. I will try that to see if there is something I am missing.
    Wednesday, September 2, 2009 2:24 AM