Adding Authentication - HodStudio/XitSoap GitHub Wiki
When we are talking about Web Services, is totally normal that the owner of it will try to protect it against unauthorized access. And this is normally done by using authentication.
To make it easier, XitSoap already implements the two most used types of Authentication: BasicAuthentication and Bearer Token.
using HodStudio.XitSoap.Authentication;
...
var wsCon = new WebService("http://localhost/XitSoap/ProductService.asmx");
wsCon.SetAuthentication(new BasicAuthentication("user", "password"));
var result = wsCon.Invoke<Product>("SearchProduct");
using HodStudio.XitSoap.Authentication;
...
var wsCon = new WebService("http://localhost/XitSoap/ProductService.asmx");
wsCon.SetAuthentication(new BearerTokenAuthentication("myBearerToken"));
var result = wsCon.Invoke<Product>("SearchProduct");