using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Text; namespace AuthWebApplication { using System.Security.Cryptography; /// <summary> /// Summary description for WebService1 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class WebService1 : System.Web.Services.WebService { public WebService1 () { //Uncomment the following line if using designed components //InitializeComponent(); } //public AuthHeader SoapAuthentication; [WebMethod(Description = "A sample Web Method to demonstrate a simple web Service Authentication using SOAP Headers")] public string SampleWebMethod(string Username,String Password) { if (Username == "demo" && Password == "123") { return Username + " is an Authenticated User to access the Web Method"; } else { return "Access Denied for " + Username; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)