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

How is a strongly-named assembly different from one that isn’t strongly-named?

0 Answers  


What are the 3 types of comments in c#?

0 Answers  


What is difference between Method and function

3 Answers  


How do you remove white spaces from a string?

0 Answers  


What?s the difference between the Debug class and Trace class?

2 Answers   Siebel,


What is a type c#?

0 Answers  


Does C# supports multi-dimensional arrays ?

4 Answers   Microsoft,


Is goto statement supported in c#?

0 Answers  


What is generic types in c#?

0 Answers  


What are the security issues if we send a query from the application?

1 Answers   Microsoft,


What are the benefits of using windows services:

0 Answers  


Can hashtable have duplicate keys in c#?

0 Answers  


Categories