Ejemplo n.º 1
0
 public ReverseWordsResponse ReverseWords(ReverseWordsRequest request)
 {
     if (request == null)
     {
         throw new FaultException <ArgumentNullException>(new ArgumentNullException("request"), "null arguments are invalid");
     }
     try
     {
         var result = new ReverseWordsResponse(ReverseWordsManager.Reverse(request.s));
         return(result);
     }
     catch (ArgumentNullException exp)
     {
         throw new FaultException <ArgumentNullException>(exp, exp.Message);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Ejemplo n.º 2
0
 public async Task <ReverseWordsResponse> ReverseWordsAsync(ReverseWordsRequest request)
 {
     if (request == null)
     {
         throw new FaultException <ArgumentNullException>(new ArgumentNullException("request"), "null arguments are invalid");
     }
     return(await Task.Run <ReverseWordsResponse>(() => {
         try
         {
             var result = new ReverseWordsResponse(ReverseWordsManager.Reverse(request.s));
             return result;
         }
         catch (ArgumentNullException exp)
         {
             throw new FaultException <ArgumentNullException>(exp, exp.Message);
         }
         catch (Exception ex)
         {
             throw new FaultException(ex.Message);
         }
     }
                                                  ));
 }