Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 0.82 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Trying to override SoapHeaderAttribute to add Authentication to the attribute
  2. public WebserviceAuthentication currentUser;
  3.  
  4.     [WebMethod(Description="Returns the logged in users credentials")]
  5.     [SoapHeader("currentUser")]
  6.     public string HelloWorld()
  7.     {
  8.         var user = AuthenticateUser(currentUser, WebServiceResources.MEDICAREELIGIBILITY_HELLOWORLD);
  9.         return string.Format("{0} {1} {2}", user.User.UserName, user.User.ProviderUserKey, user.AccountId);
  10.     }
  11.        
  12. public WebserviceAuthentication currentUser;
  13.     public CustomAuthentication user;
  14.  
  15.     [WebMethod(Description="Returns the logged in users credentials")]
  16.     [SoapHeaderAuthentication("currentUser")]
  17.     public string HelloWorld()
  18.     {
  19.         return string.Format("{0} {1} {2}", user.User.UserName, user.User.ProviderUserKey, user.AccountId);
  20.     }