Solved

Asynhronic response from Web Service

Posted on 2008-06-26
4
226 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
ID: 21877100
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
ID: 21881718
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
ID: 21891678
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
ID: 21916491
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Web Form VB.Net  import CSV 4 39
C# guarantee sql connection close 6 41
How can my static class become undefined?? 8 49
tableview is not updating 1 10
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 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