Solved

Asynhronic response from Web Service

Posted on 2008-06-26
4
223 Views
Last Modified: 2010-04-15
I need to generate XML from myWebService to another Web Service but only when Table.field in database is with value "0". When myWebService get information that "field" is with value "0" or field are inserted, myWebService need to generate XML and change Table.field value to "1".

How would myWebService know when the value of "field" is changed to "0" or inserted in Table with value "0" (I need some methodology which would trigger my Web service at any time when it occurs - Web Service in Web Service).
Some code example would be appropriate.

0
Comment
Question by:novabankaee
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:elimesika
Comment Utility
HI

You have several options

1) pooling - creating  a timer object and check for the value each X seconds

2) Use Cache Dependency on the table
http://msdn.microsoft.com/en-us/library/ms178604.aspx

3) create a CLR stored procedure that will be called from a trigger on the table

http://msdn.microsoft.com/en-us/library/ms131094.aspx


I highly recommend the 2nd option

0
 

Author Comment

by:novabankaee
Comment Utility
I don't use MS Sql Server so 2nd and 3rd options are not in options.
I use Informix database. This is more database then Visual studio (C#) releated problem. Isn't it?
0
 
LVL 19

Accepted Solution

by:
elimesika earned 500 total points
Comment Utility
HI

OK, than you are left with the 1st option , this is the easiest solution to implement and it might meet your needs if the update rate is not extensive.

Another option, if you have any control on the service that updates the service, you may use messaging to send a message from updating service to the other service.
0
 

Author Comment

by:novabankaee
Comment Utility
How and where to implement Timer Object in WebServis?

public class MyWebService : System.Web.Services.WebService

    {
 

        public MyWebService()

        {

        }
 

        [WebMethod]

        public string WebMethod1()

        {

            //Business Logic

        }
 

        public void PrivateMethod1()

        {

            //Business Logic

        }

   }

Open in new window

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now