right click on your solution => add => new Item => web service, and then form your solution make a new project, build project, opern your webservice in browser , right click on another refrence folder => add web refrence => discover=> ok!
now if you using namespace of your service , you can use the methods in them!
this is a web service for check the username!
using System.Linq;
using System.Web;
using System.Web.Services;
namespace AspNetAjax_Examples
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class HelperWebService : System.Web.Services.WebService
{
[WebMethod]
public bool CheckUsername(string Username)
{
System.Threading.Thread.Sleep(3000);
string url = HttpContext.Current.Request.UrlReferrer.ToString();
var Context = new AdvancedASP_8_ExamplesEntities();
return (from u in Context.Users
where u.Username.ToLower() == Username.ToLower()
select u).Any();
}
}
}