Solved

Asynhronic response from Web Service

Posted on 2008-06-26
4
227 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hey Audio! 9 44
Graphics 2 32
Do you know how to ensure that a string date is padded with 0 in ASP.Net using C# and VS2010 in format MM/dd/yyyy ? 4 28
MailAddress in vb 4 29
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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

832 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