Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it necessary to set NetworkCredential domain?

Is it necessary to set networkCredential domain while accessing a web service?

var service = new service1.SoapEx();
service.Credentials = new NetworkCredential("user", "password", "domain");

or i can do:

 var service = new service1.SoapEx();
 service.Credentials = new NetworkCredential("user", "password");

Thanks

like image 504
dvIta Avatar asked Nov 16 '15 13:11

dvIta


1 Answers

No, it's not necessary as the NetworkCredential class features a constructor just like your second example. Keep in mind though that the password param only accepts SecureString, not String.

like image 64
Eric Walker Avatar answered Nov 12 '22 23:11

Eric Walker