using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; namespace testapp { /// <summary> /// Summary description for Service /// </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 Service : System.Web.Services.WebService { public AuthSoapHd spAuthenticationHeader; public Service () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod, SoapHeader("spAuthenticationHeader")] public string HelloWorld() { if (spAuthenticationHeader.strUserName == "TestUser" && spAuthenticationHeader.strPassword == "TestPassword") { return "User Name : " + spAuthenticationHeader.strUserName + " and " + "Password : " + spAuthenticationHeader.strPassword; } else { return "Access Denied"; } } public class AuthSoapHd : SoapHeader { public string strUserName; public string strPassword; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)