I want to call a web service from my winforms application. My application is written on c# and the webservice is secured using spring security.
Is it possible to login to the website and call that web service?.
If it is possible how to do that?
I want to call a web service from my winforms application. My application is written on c# and the webservice is secured using spring security.
Is it possible to login to the website and call that web service?.
If it is possible how to do that?
Authentication can be setup in many ways with Spring Security. For example:
<http pattern="/webservice/**" create-session="stateless" realm="TestRealm">
<http-basic/>
<intercept-url pattern="/**" access="ROLE_USER"/>
</http>
Then it is as simple as this to authenticate from C#:
var request = (HttpWebRequest)WebRequest.Create(url);
request.Credentials = new NetworkCredential(username, pwd);