Dropped Sessions?

  • Thread starter Thread starter Davej
  • Start date Start date
On 5/6/2012 9:19 PM, Davej wrote:
[...]
Ah, it is working until I throw some sort of exception reading the
database with SqlDataReader or improperly passing the result array
back. At that point everything dies -- including the sessions.
The session should not be invalidated due to an exception.
But obviously you need to handle the exception properly.
Would it be possible to expose the data as a web service
instead of as a web page (that would make many things
easier client side)?
I was confused by web services so I went down the path of "screen
scraping" with the idea that I could perhaps switch over later.

I think it would have been way easier for you with web services.

WCF is a bit complex, but there are alternatives:
* oldfashioned .asmx web services
* a simple web handler (.ashx)

Arne

I will have to read up on those. I wanted to avoid just using some
mysterious library that would magically do everything. I am still
trying to grasp some of the underlying limitations and issues of my
simple-minded approach; for example sending numbers is no problem, but
strings have to be sent with caution, particularly in the download
direction. In my application strings are not too important, but I have
some strings come back in the debugging messages and I did include a
"chat" feature. Although I have not tested this I'm guessing that
"<table>" or "</html>" would be bad sequences to find in a chat
message.
 
On 5/6/2012 9:19 PM, Davej wrote:
[...]
Ah, it is working until I throw some sort of exception reading the
database with SqlDataReader or improperly passing the result array
back. At that point everything dies -- including the sessions.
The session should not be invalidated due to an exception.
But obviously you need to handle the exception properly.
Would it be possible to expose the data as a web service
instead of as a web page (that would make many things
easier client side)?
I was confused by web services so I went down the path of "screen
scraping" with the idea that I could perhaps switch over later.

I think it would have been way easier for you with web services.

WCF is a bit complex, but there are alternatives:
* oldfashioned .asmx web services
* a simple web handler (.ashx)

I will have to read up on those. I wanted to avoid just using some
mysterious library that would magically do everything. I am still
trying to grasp some of the underlying limitations and issues of my
simple-minded approach; for example sending numbers is no problem, but
strings have to be sent with caution, particularly in the download
direction. In my application strings are not too important, but I have
some strings come back in the debugging messages and I did include a
"chat" feature. Although I have not tested this I'm guessing that
"<table>" or"</html>" would be bad sequences to find in a chat
message.

A simple web handler (.ashx) does not contain much magic.

Arne
 
If it does not force me to use XML I will give it a try next week.

You can do XML, JSON, CSV or whatever format you like.

Unless bandwidth is a primary concern, then I believe
XML would be a nice format.

Arne
 
You can do XML, JSON, CSV or whatever format you like.

Unless bandwidth is a primary concern, then I believe
XML would be a nice format.

Arne

Well, I am still trying to get my basic functionality working, but if
I try a web service option I would want to keep the simple
(concatenated/delimited strings with a simple header) message format
that I am using now. Maybe add a wrapper if that is required. I am
curious about how major or minor the change over might be. I noticed
that there are apparently some changes that need to be made to the
web.config file for a web service. Thanks.
 
Well, I am still trying to get my basic functionality working, but if
I try a web service option I would want to keep the simple
(concatenated/delimited strings with a simple header) message format
that I am using now. Maybe add a wrapper if that is required. I am
curious about how major or minor the change over might be. I noticed
that there are apparently some changes that need to be made to the
web.config file for a web service.

That is only for WCF.

Neither old style .asmx nor simple web handlers .ashx
requires changes to web.config.

Arne
 
Back
Top