How to authenticate web service? When you enter the web
service url in browser it should ask username and password.
After entering the un&pwd we have to show its methods and
service description(wsdl).

Answers were Sorted based on User's Feedback



How to authenticate web service? When you enter the web service url in browser it should ask usern..

Answer / gp_bellamkonda

If external clients want to access our webservices,We can
declare and use our own keys like userid,password and
domain in web.config.

TYPE IN WEB.CONFIG
=============
<appSettings>
<add key ="UserID" value ="User123"/>
<add key ="Password" value="Pwd@123"/>
<add key="Domain" value ="ABC"/>
</appSettings>

and
IN CODE
=======
try
{
ISAuthenticatedUser = new AuthenticateUsers
().Authenticate(LoginUserId, LoginPassword, "DEVDCDOM");
if (ISAuthenticatedUser == "Error")
returnMSg = "Application error has
occured.Please check log files for details.";
else if (ISAuthenticatedUser
== "Authentication Failed")
returnMSg = "USer not Authorized.";
}
catch (Exception ex)
{
throw ex;
}

Is This Answer Correct ?    0 Yes 0 No

How to authenticate web service? When you enter the web service url in browser it should ask usern..

Answer / m.yousuf

by implementing digest authentication model.

Is This Answer Correct ?    0 Yes 0 No

How to authenticate web service? When you enter the web service url in browser it should ask usern..

Answer / siyaa

The webservice has to be created under windows
authentication mode and it has to be impersonated with a
username and password .

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More C Sharp Interview Questions

What is the diff between the System.Array.CopyTo() and System.Array.Clone()?

0 Answers   Siebel,


what is the difference between passing a value object by reference and a reference object by value?

4 Answers   TCS,


What does addressof operator do in background ?

0 Answers  


Which is the best way for keeping the data in XML or SQL server..and why?

8 Answers   Infosys, Satyam,


Can you override private virtual methods?

11 Answers   AROBS Transilvania Software, IBM, Mind Tree, Revalsys,


What is delegates and events?

0 Answers  


How can you sort the elements of the array in descending order?

1 Answers   Junosource, Siebel Systems, Wipro,


What is boxing and unboxing in c#?

0 Answers  


Explain boxing and unboxing in c#?

0 Answers  


Can a string be null c#?

0 Answers  


What is iqueryable in c#?

0 Answers  


Will finally block get executed if the exception had not occurred?

2 Answers  


Categories