ammar_heidari
۲۵ دی ۱۳۸۸, ۲۱:۱۱
یک راه برقراری امنیت برای سرویس های وب تحت http استفاده از header های soap میباشد
کد:
[WebMethod]
[SoapHeader("Authent",Required=true)]
public string MyWebMethod(string Name)
{
if (Authent.UserName == "Meysam" && Authent.Password == "123400")
return "Authentiocation is succesfull(Welcome {"+Name+"})";
else
return "Authentiocation is fail";
}
با چیزی شبیه این کد میتواننید یک تابع سرویس را ملزم به استفاده از header های soap کنید
کد:
[WebMethod]
[SoapHeader("Authent",Required=true)]
public string MyWebMethod(string Name)
{
if (Authent.UserName == "Meysam" && Authent.Password == "123400")
return "Authentiocation is succesfull(Welcome {"+Name+"})";
else
return "Authentiocation is fail";
}
با چیزی شبیه این کد میتواننید یک تابع سرویس را ملزم به استفاده از header های soap کنید