On Jul 1, 1:43*am, rvn wrote:
In a web service suppose i want to expose only few methods to a company like ABC and all the methods to another company like XYZ. then how this can bedone.
Any help is highly appreciated.
Thanks in Advance
Rvn
Check out SOAP Header authentication. You can apply user name and
passwords to individual methods in the same .aspx page.
EX.
public class Service : System.Web.Services.WebService
{
public AuthHeader Authentication;
public Service()
{
}
[WebMethod]
[SoapHeader("Authentication", Required = true)]
public void MyMethod()
{
if (Authentication.Username == "the username" &&
Authentication.Password == "the password")
{
//Do Stuff.
}
}
}
You'll have to incorporate sending the username and password in the
client's SOAP request which is also easily done in .NET.