locked
How to get response from Partner RRS feed

  • Question

  • Hi all,

    I'm using C# and MSRS to develop my project. My project has 2 Services
    1. IPCamera Serivce : use as partner and use to get the image or video stream from ip camera
    2. Display Service : use as a main service and use to start and display response from IPCamera Service

    now, i can send message from Display Service to call function in his parther (IPCamera Service)
    but i don't know how to send the response (ex. image data etc.) reply to main service (Display Service).

    I can't find any examples. Could someone help me?

    thank you :)
    • Edited by zensuie Tuesday, May 26, 2009 2:37 PM edit message
    Tuesday, May 26, 2009 11:28 AM

Answers

  • No, you cannot pass a Bitmap directly. The reason is that it is a data structure that contains pointers.

    It is not clear to me what you are doing. Are you using the IPCamera service that comes with RDS? If so, then you do not need to pass a Bitmap. What that service does is send you the bitmap data (the pixels) as an array.

    Trevor
    Monday, June 1, 2009 7:14 AM

All replies

  • Each message sent to a DSS service has a ResponsePort where response messages are posted. A classic pattern is to have a Arbiter.Choice that waits for a successful or a fault response.

    Example :

    Command com = new Command ();
    _partnerPort.Post (com);
    
    yield return Arbiter.Choice (com.ResponsePort, (sucess) => { ... }, (fault) => { ... });

    Or if you use proxy generated helpers that return the response port :

    yield return Arbiter.Choice (_partnerPort.Command (), (sucess) => { ... }, (fault) => { ... });

    Regards,
    Vincent
    http://www.simplysim.net/
    Wednesday, May 27, 2009 7:22 AM
  • Thank you Vincent. :)

    I can pass through the variable between Services now by using base.SendNotification(_submgrPort, ServiceOperation).
    It work but  I got this Warning when i define one DataMember as bitmap  :

    "The type System.Drawing.Bitmap is used as a member type but cannot be deeply cloned.
    Consider implementing IDssSerializable on that type."

    Can't bitmap use as DataMember in ServiceOperation-Type?

    When not, how can i pass the bitmap through service? Do anyone have an idea?

    Regards,
    zensuie
    Friday, May 29, 2009 11:45 AM
  • No, you cannot pass a Bitmap directly. The reason is that it is a data structure that contains pointers.

    It is not clear to me what you are doing. Are you using the IPCamera service that comes with RDS? If so, then you do not need to pass a Bitmap. What that service does is send you the bitmap data (the pixels) as an array.

    Trevor
    Monday, June 1, 2009 7:14 AM
  • I'm clear now. Thank you very much Trevor :)

    I am using another service that i have created, not the IPCamera service from RDS.
    now, I pass the bitmap data as an array and it works fine.

    Regards,
    zensuie
    Monday, June 1, 2009 11:24 AM