Web service setdata()
-
Hi All I have a tough one (for me that is). I have written a web service that recieve SOAP messages from an embedded device and it works fine I now need to get this information into a service on a server running in the back ground so that I can manipulate the data and in the end save it a SQL2005 db. I have seen that when I receive SOAP udates from my embedded device the web service "fires" on each POST from the embedded device, This can be as much as 10 000 time per second, I can see all my data. My first idea was to allow the web service to udate the SQL2005 db directly but this process is to slow. That is why I planning a service running on the same server as a process in the background. Regards
-
Hi All I have a tough one (for me that is). I have written a web service that recieve SOAP messages from an embedded device and it works fine I now need to get this information into a service on a server running in the back ground so that I can manipulate the data and in the end save it a SQL2005 db. I have seen that when I receive SOAP udates from my embedded device the web service "fires" on each POST from the embedded device, This can be as much as 10 000 time per second, I can see all my data. My first idea was to allow the web service to udate the SQL2005 db directly but this process is to slow. That is why I planning a service running on the same server as a process in the background. Regards
I had a similar situation when I recieved a lot of web requests when doing statistics for a web site. I didn't solve it using a service, but with a thread. I store the data in a static list, until the list gets to a specific age or a specific size. Then I start a thread that will loop through the list and save the data to the database, and create a new empty list to store new data in.
--- b { font-weight: normal; }
-
I had a similar situation when I recieved a lot of web requests when doing statistics for a web site. I didn't solve it using a service, but with a thread. I store the data in a static list, until the list gets to a specific age or a specific size. Then I start a thread that will loop through the list and save the data to the database, and create a new empty list to store new data in.
--- b { font-weight: normal; }
-
Hi Guffa Good idea. Just one question. When the Web service is in the IIS environment will the werb service store the incomming info in memory and if so how do a separate thread or application retrive this data? Regards
I used a static variable to hold the reference to the list where I stored the data. As it is static, all different threads that handle requests can reach it, but you have to use locking to prevent more than one thread to access it at once. When the list was "full", I copied the reference to the list into an object that I later used to start a new thread, and created a new list and put the reference to it in the static variable. So, as the new thread was started from the thread handling the request, there was no problem sending the data to it.
--- b { font-weight: normal; }
-
I used a static variable to hold the reference to the list where I stored the data. As it is static, all different threads that handle requests can reach it, but you have to use locking to prevent more than one thread to access it at once. When the list was "full", I copied the reference to the list into an object that I later used to start a new thread, and created a new list and put the reference to it in the static variable. So, as the new thread was started from the thread handling the request, there was no problem sending the data to it.
--- b { font-weight: normal; }
Ok Thanx Ill try that. Im used to straight C++ and VB6 so this .Net thing and ADO.net is new to me. I'm busy to see if the DataSet and DataAdapter object will be fast enough for my requirement. But It takes a bit time as I'm used to Recordsets and ODBC. Another question is, if a Web service "fires" on an incoming event and it executes and during execution another event comes in will the web service "fire" again on a different thread, or will IIS buffer this new incomming event?
-
Ok Thanx Ill try that. Im used to straight C++ and VB6 so this .Net thing and ADO.net is new to me. I'm busy to see if the DataSet and DataAdapter object will be fast enough for my requirement. But It takes a bit time as I'm used to Recordsets and ODBC. Another question is, if a Web service "fires" on an incoming event and it executes and during execution another event comes in will the web service "fire" again on a different thread, or will IIS buffer this new incomming event?
BLOEDHOND wrote:
I'm busy to see if the DataSet and DataAdapter object will be fast enough for my requirement.
You can use the Execute methods of the connection object if you want less overhead. If you don't use the DataSet to feed a user interface, there is not really any reason to have it.
BLOEDHOND wrote:
Another question is, if a Web service "fires" on an incoming event and it executes and during execution another event comes in will the web service "fire" again on a different thread, or will IIS buffer this new incomming event?
Each request will run in a separate thread, so you can have a number of requests executing at the same time. The web server limits (buffers) the requests per user (session), though, so you will not have more than one request running at a time for each user.
--- b { font-weight: normal; }