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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With