Vasu Gadhiya

Vasu Gadhiya

  • NA
  • 429
  • 103.1k

How to secure webservice ?

Jul 2 2018 7:27 AM
i have developed webservice using webmethod
  1. [WebMethod]  
  2. public string HelloWorld()  
  3. {  
  4.       return "Hello World";  
  5. }  
  6. public UserDetails User;  
  7. [WebMethod]  
  8. [SoapHeader("User", Required = true)]  
  9. public string SayHello(string userName)  
  10. {  
  11.       if (User != null)  
  12.       {  
  13.          if (User.IsValid())  
  14.              return string.Format("Hello...{0} ☺ ", userName);  
  15.          else  
  16.              return "Error in authentication";  
  17.       }  
  18.       else  
  19.       {  
  20.             return "Error in authentication";  
  21.       }  
  22. }
All working Fine
 
but issue is when i run from desktop app its data (request and response) shown in web debugging software Like Fiddler.
 
even SOAP header is Shown.
(see attached screenshot)
 
How can i secure this Type of web Service (web method)
 




Answers (1)