-
-
Notifications
You must be signed in to change notification settings - Fork 3
Adding Authentication
Cussa Mitre edited this page Feb 7, 2018
·
1 revision
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");
- Home
- Migrating from v1 to v2
- Referencing the Library
- Make a simple call
- Adding Parameters
- Adding Authentication
- Adding Custom Headers
- Calling a web method without use a typed return
- Using the WsContract and the ServiceCatalog
- Using the WsContract just to use the namespace
- Using the WsMapper: no more ugly properties!
- SoapActionComplement: because sometimes it's necessary even more!