Reg: Webservice Access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rvn

    Reg: Webservice Access

    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 be done.

    Any help is highly appreciated.

    Thanks in Advance
    Rvn
  • Looch

    #2
    Re: Reg: Webservice Access

    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.Serv ices.WebService
    {
    public AuthHeader Authentication;

    public Service()
    {
    }

    [WebMethod]
    [SoapHeader("Aut hentication", 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.

    Comment

    Working...