locked
Web Service RRS feed

  • Question

  • User1551896424 posted

    HI,

    I m going to create new web service, which will accept few parameters and will respond with result.

    Now need to check weather the response is delivered to webservice callie successfully or not.

    I need this status for further processing. If the responce is not deliverd successfully, I have to roll back the process.

    Wednesday, May 15, 2013 7:47 AM

Answers

  • User-488622176 posted

    This depends on what you want to achieve. If you call a webservice from a client (win/web), you probably do not have the best solution for the problem. If you have a webservice calling another webservice, you can use the transaction mechanism from WCF as illustrated in this sample : http://dotnetslackers.com/articles/wcf/Transaction-Propagation-in-WCF.aspx

    This implies you set up logic in the called webservice and the callie webservice, that runs under a transction scope. Implying both will succeed, or none will.

    The called webservice can never know the caller received the response. The called webservice is a slave...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 15, 2013 9:40 AM
  • User220959680 posted

    Check whether service method is returning any data or not.

    //WCF SOAP
    WCFServiceClient proxy = new WCFServiceCleint();
    proxy.Open();
    
    //Call the service method
    var data = proxy.GetProducts();
    
    if(data != null)
    {
       //process here
    }
    else
    {
       //process revoke action here
    }

    It would be similar in RESTFul service, the only difference is no need of service proxy initialization. 



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 15, 2013 10:34 AM

All replies

  • User-488622176 posted

    This depends on what you want to achieve. If you call a webservice from a client (win/web), you probably do not have the best solution for the problem. If you have a webservice calling another webservice, you can use the transaction mechanism from WCF as illustrated in this sample : http://dotnetslackers.com/articles/wcf/Transaction-Propagation-in-WCF.aspx

    This implies you set up logic in the called webservice and the callie webservice, that runs under a transction scope. Implying both will succeed, or none will.

    The called webservice can never know the caller received the response. The called webservice is a slave...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 15, 2013 9:40 AM
  • User220959680 posted

    Check whether service method is returning any data or not.

    //WCF SOAP
    WCFServiceClient proxy = new WCFServiceCleint();
    proxy.Open();
    
    //Call the service method
    var data = proxy.GetProducts();
    
    if(data != null)
    {
       //process here
    }
    else
    {
       //process revoke action here
    }

    It would be similar in RESTFul service, the only difference is no need of service proxy initialization. 



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 15, 2013 10:34 AM