Click here to Skip to main content
15,943,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created proxy like:
C#
ServiceReference1.Service1Client proxy = new ServiceReference1.Service1Client();
           proxy.ClientCredentials.UserName.UserName = "Second";
           proxy.ClientCredentials.UserName.Password = "Second";
proxy.GetData();


When I am creating New object for same service, Again its asking for authentication

XML
<pre lang="cs">ServiceReference1.Service1Client proxy2 = new ServiceReference1.Service1Client();
proxy.GetData();</pre>


client should authenticated only once.
I am using below security and session contextmode:

Security:
XML
<security mode="TransportWithMessageCredential">
                       <transport clientCredentialType="None" />
                       <message clientCredentialType="UserName" />
                   </security>


Session:
Persession


Can't we create access methods with new object without giving credentials again.
Posted
Comments
SarveshShukla 3-Jan-14 1:37am    
I think you need to provide credentials again as these credentials need to be sent in SOAP and when you are creating new proxy object there are no crdentials hence you are asked for the credentials.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900