By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,671 Members | 1,393 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,671 IT Pros & Developers. It's quick & easy.

Reg: Webservice Access

P: n/a
rvn
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
Jul 1 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
Jul 2 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.