Solved

Asynhronic response from Web Service

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IEnumerable<T> to a List<T> 8 53
VS2010 Build fails to install 14 82
Wordpress Hacked 1 71
Powershell Regex Replace Question 5 24
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 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