locked
WebCam service question RRS feed

  • Question

  • Hi there,

    I'm having some problems with getting the webcam service running from my C# code. Please note that I am a newbie, but I have completed all relevant tutorials.

    The problem is this: As I understand (please correct me if I'm wrong) in order to use the webcam service from another service I should subscribe to it, such that I can catch the notifications that are sent by the webcam service. First I defined a shortcut to the webcam service proxy as follows:

    using webcam = Microsoft.Robotics.Services.WebCam.Proxy;

    The next step would be to create a port over which the notifications will be sent:

    [Partner("WebCam", Contract = cam.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExisting)]
            webcam.WebCamOperations _camPort = new webcam.WebCamOperations();
            webcam.WebCamOperations _camNotify = new webcam.WebCamOperations();

    My problem is as follows: when I build the source code the compiler complains that "WebCamOperations" does not exist in the webcam namespace. I have added a reference to WebCamService.Y2006.M05.proxy , but it still does not recognize "WebCamOperations". I have the feeling that I am missing a point here, or that I'm reffering to the wrong proxy. Can someone point me in the right direction?

    Greetings

    Jorn


    Monday, May 21, 2007 12:43 PM

Answers

  • Yes, this is a common gotcha. 

    The WebCamServiceOperations class is defined in RoboticsCommon.Proxy.dll.

     

    This can be discovered by using [1] Lutz Roeder's .NET Reflector, or by viewing the source of the webcam service as follows:

     

    Open the Webcam service installed in your MSRS directory at [2] and view webcam.cs you will notice that it references WebCamOperations from a different dll.

     

    using webcam = Microsoft.Robotics.Services.WebCam;

    ...

    [ServicePort("/webcam", AllowMultipleInstances = true)]

    WebCamServiceOperations _mainPort = new WebCamServiceOperations();

    webcam.WebCamOperations _altFwdPort;

     

    when you walk through the references, you will find this namespace [3] in RoboticsCommon.

     

    [1] Lutz Roeder's .NET Reflector, or by viewing the source of the webcam service as follows:

     

    Open the Webcam service installed in your MSRS directory at [2] and view webcam.cs you will notice that it references WebCamOperations from a different dll.

     

    using webcam = Microsoft.Robotics.Services.WebCam;

    ...

    [ServicePort("/webcam", AllowMultipleInstances = true)]

    WebCamServiceOperations _mainPort = new WebCamServiceOperations();

    webcam.WebCamOperations _altFwdPort;

     

    when you walk through the references, you will find this namespace [3] in RoboticsCommon.

     

    [1] http://msdn.microsoft.com/msdnmag/issues/04/07/MustHaveTools/ 

    [2] ...\samples\sensors\webcam\webcam.csproj

      [3] Microsoft.Robotics.Services.WebCam
    Monday, May 21, 2007 5:32 PM

All replies

  • Yes, this is a common gotcha. 

    The WebCamServiceOperations class is defined in RoboticsCommon.Proxy.dll.

     

    This can be discovered by using [1] Lutz Roeder's .NET Reflector, or by viewing the source of the webcam service as follows:

     

    Open the Webcam service installed in your MSRS directory at [2] and view webcam.cs you will notice that it references WebCamOperations from a different dll.

     

    using webcam = Microsoft.Robotics.Services.WebCam;

    ...

    [ServicePort("/webcam", AllowMultipleInstances = true)]

    WebCamServiceOperations _mainPort = new WebCamServiceOperations();

    webcam.WebCamOperations _altFwdPort;

     

    when you walk through the references, you will find this namespace [3] in RoboticsCommon.

     

    [1] Lutz Roeder's .NET Reflector, or by viewing the source of the webcam service as follows:

     

    Open the Webcam service installed in your MSRS directory at [2] and view webcam.cs you will notice that it references WebCamOperations from a different dll.

     

    using webcam = Microsoft.Robotics.Services.WebCam;

    ...

    [ServicePort("/webcam", AllowMultipleInstances = true)]

    WebCamServiceOperations _mainPort = new WebCamServiceOperations();

    webcam.WebCamOperations _altFwdPort;

     

    when you walk through the references, you will find this namespace [3] in RoboticsCommon.

     

    [1] http://msdn.microsoft.com/msdnmag/issues/04/07/MustHaveTools/ 

    [2] ...\samples\sensors\webcam\webcam.csproj

      [3] Microsoft.Robotics.Services.WebCam
    Monday, May 21, 2007 5:32 PM
  • Hi David,

    I renamed the namespace to [3] and removed the reference to WebCamServices.Y2006.M05.proxy. And it works! Thanks a lot.

    Monday, May 21, 2007 7:28 PM