locked
check wcf service status/avaialability or ping the wcf service. RRS feed

  • Question

  • Hi all wcf experts,

    hope u all doing well,i have an requirement that is,

    transaction flow is service a->service b-> service c-> service d.

    if the service b gets down or is not working before calling service b method or hit,service a has to find that this service a is not running.

    i think the ping service is better way to do this,if it is yes how can i do this and no please give me any idea to do this?

    Appreciate all the replies/.


    Thanks&Regards Sivanathan.V
    Friday, January 27, 2012 10:23 AM

Answers

  • If service b is unavailable, shouldn't you abort the transaction then?

    Imagine you ping for B, you see it is unavailable, how long will you wait? Transactions should be as short as possible.

    If you call B right away, without knowing whether it is available, you can take care of the problem in the catch block (like rolling back the transaction, execute compenstation logic).

     

     


    If this post answers your quenstion, please mark it as such. If this post is helpful, click 'Vote as helpful'.
    • Marked as answer by Yi-Lun Luo Thursday, February 2, 2012 9:27 AM
    Friday, January 27, 2012 12:14 PM

All replies

  • Can't you solve your problem by implenting correct exception handing when calling service B? It will be a lot more efficient than pinging for availability...


    If this post answers your quenstion, please mark it as such. If this post is helpful, click 'Vote as helpful'.
    Friday, January 27, 2012 10:41 AM
  • Here's an example for you to implement a pingable WCF service.  http://www.codeproject.com/Articles/90244/WCF-Ping
    Friday, January 27, 2012 11:27 AM
  • Hi 
    Peter Borremans,

    Thanks for your reply.

    just consider this scenerio,

    one transaction is processing through on Service a to service b then c and d.

    if service b is not working,service a should not take that transaction to process,and also c and d.

    so if i do ping process in these services,

    like service b status can get in service a,

    so from  service a i can monitor the service b so the the service a no need to pass that transaction to process,

    how can i achieve this?

    can u pls help me,

     

    Appreciate your valuable replies.


    Thanks&Regards Sivanathan.V
    Friday, January 27, 2012 12:09 PM
  • If service b is unavailable, shouldn't you abort the transaction then?

    Imagine you ping for B, you see it is unavailable, how long will you wait? Transactions should be as short as possible.

    If you call B right away, without knowing whether it is available, you can take care of the problem in the catch block (like rolling back the transaction, execute compenstation logic).

     

     


    If this post answers your quenstion, please mark it as such. If this post is helpful, click 'Vote as helpful'.
    • Marked as answer by Yi-Lun Luo Thursday, February 2, 2012 9:27 AM
    Friday, January 27, 2012 12:14 PM