WebService in Web Application

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I added a Webservice (.asmx) in a WebApplication.
Dose it new an Session when a user link the WebService of the
WebApplication?
 
I am not sure what you are trying to do.

Can you hit the same seb service over and over again on the same session?
Sure, there are articles that show how to set up session with services. It
is not the norm, as web services are generally set up without session as
they are completely stateless. ANd, if you are using multiple hits in a row,
you are best to look at the web service extensions (3.0 for the 2.0
Framework)

Can you hit a page and then go to a web service under the same session? Yes,
as long as the browser instance is in the same context (same browser or
another instance opened from that instance). This is very unusual.

Can you set up a browser app (in a windows form) and start using services
under that session? Yes, as long as you are not spawning outside of the
browser app domain. Otherwise, the service call is separate.

Are any of these a best practice? NO! NO! NO!

You are best to be stateless and use some other means of authentication and
authorization handling than session. X.509 certs come to mind, but there are
other Public Key Infrastructure (PKI) options that work. You can also set up
user tokens in the app config (encrypted of course) and use the token. This
is better than relying on session.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************
 
Thanks,
I am reading your post again and again.
You teach me a lot.
I am not useing Session object to reserve the state, but to exchange some
data form on function to another.
I use this a lot in Web application, for example to reserve a DataTable for
use in another function.

Maybe it is not a good habit, but it have no problem in Web application.
 
Back
Top