ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  Dot Net  >>  Dot Net Framework
 
 


 

 
 Dot Net Framework interview questions  Dot Net Framework Interview Questions
 Dot Net Remoting interview questions  Dot Net Remoting Interview Questions
 Dot Net WindowsForms interview questions  Dot Net WindowsForms Interview Questions
 Dot Net General interview questions  Dot Net General Interview Questions
 Dot Net AllOther interview questions  Dot Net AllOther Interview Questions
Question
How to ensure the credentials for WebService using Windows 
authentication
 Question Submitted By :: Mathew298
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to ensure the credentials for WebService using Windows authentication
Answer
# 1
Passing client credentials to a Web service using Windows 
authentication 

Sometimes a Web Service is under a configuration that 
requires Windows Authentication. It is not a problem 
for .NET, all you need to do is set your environment to 
send the client credentials. 
1.	First Create a Reference to a Web Service:


 


To do that just go to the references of your project and 
add a Web Reference. Type the URL of your web service. This 
will find your Web Service Reference and you can update it. 
This will generate the proxy code you need to access your 
webservice. 

If you try to call your webservice with a call like: 

WebReference.MyService pService = new 
WebReference.MyService (); 
pService.doStuff("A", "B"); 

You’ll get a HTTP 404 forbidden access exception. 

Now to send the user and password to call your service 
write some code like the following: 

WebReference.MyService pService = new 
WebReference.MyService (); 
pService.Credentials = new System.Net.NetworkCredential
("user", "password"); 
pService.doStuff("A", "B"); 

You can also send the domain name as part of the parameter 
to the NetworkCredential class: 

pService.Credentials = new System.Net.NetworkCredential
("user", "password","domain"); 

It will be even better to have your user and password not 
in your code but in the configuration file for your 
program. You can then use the AppSettings class to access 
those properties. 
 
Is This Answer Correct ?    1 Yes 0 No
Prasanna
 

 
 
 
Other Dot Net Framework Interview Questions
 
  Question Asked @ Answers
 
Can source code be reverse-engineered from IL?  2
In which circumstances you used delegates? HP3
Features in .net framework 1.1 ? Digital-GlobalSoft1
If Controller is not there in MVC Pattern what happens?  1
If you are using components in your application, how can you handle exceptions raised in a component ? Accenture3
What are the features that are new in .net 2.0 Emphasis2
About namespaces ? MMTS2
What is boxing and unboxing? Kanbay2
What is side by side Execution ? MMTS3
About .NET Framework ? MMTS4
What is reflection? Merrill-Lynch3
How do assemblies find each other?  1
What is shared and private assembly ? Accenture2
What is Partial Assembly References? Microsoft2
what is an assembly?  10
what are background threads? give ex? Kanbay3
what are partial classes? HP11
About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use ? MMTS2
What is gacutil.exe. Where do we store assemblies ? Accenture2
If foreground completes its processing will it wait for background threads? Kanbay1
 
For more Dot Net Framework Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com