.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Automatic calls to WCF Service - Is this the correct way

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :WCF

This question is really about "Am I doing this correctly?"

Basically what i have is a Service with the following methods
public void SendCommand(string id, TechCommands.MediaCommands mediaCommand, string fileName)
public TechCommands.MediaCommands CheckMediaCommand(string id)

And i have many people using this service, but only 2 connect to each other at a time and only one person sends commands while the only person should only receive commands if that person send him a command.


As of now in WPF im doing this with DispatherTimers

private DispatcherTimer MediaCommandTimer = new DispatcherTimer();

      MediaCommandTimer.Tick += new EventHandler(MediaCommandTimerTick);
      MediaCommandTimer.Interval = TimeSpan.FromMilliseconds(10);

private void MediaCommandTimerTick(object sender, EventArgs e)
      Check Commands<br/>
      Execute commands
Is this the correct way for that one person to keep checking if a command was send to him?

Or is WCF is there a way to automatically keep calling th

View Complete Post

More Related Resource Links

Extreme ASP.NET: Client-Side Web Service Calls with AJAX Extensions


Microsoft AJAX Library and the ASP.NET 2.0 AJAX Extensions provide a number of compelling features ranging from client-side data binding, to DHTML animations and behaviors. Learn all about them here.

Fritz Onion

MSDN Magazine January 2007

jQuery calls asmx web service

I have a jQuery method that calls a .asmx web service.  the jquery method only executes one time but the web serivce executes multiple times.  Is there a way this could happen or ways to debug this beyond breakpoints in the c# code and alerts in the jQuery.

Bi directional service calls with "n to 1" and "1 to n" servers has host

Hey there.   I've been tasked to find out how to do the following for our company:   We have our ERP (MS Navision) exposed to the net to take orders. So far so good. Now management wants me to integrate our system with 3 other ERPs and 100s to 1000s of clients all having their own networks and sql servers which are completely outside of our "control".   Here's where I have a big problem.  In the "normal" way of things, each of the ERP, installed on each of our 100[0]s of big clients would be calling my services to process orders and whatnot.   However, the first step of our system is to do a search and display inventory.  We want to have complete control has this system is a new flagship product and we can't let other companies duplicate it.  The big sticking points for our clients is that they want us to show THEIR inventory on OUR site.  This happens after a login, but before their servers ever call mine. That means that I have to query their webservices first... 100[0]s of different servers (1 per client allowed on the system).   Now if we had only 2-5 clients I'd know what to do, but how can I have a scalable setup with 100s and possibly 5000+ different clients? 

Slow performance of WCF service calling singleton (which calls COM+!)


WCF Service call routing to COM+ application.
netTCPBinding, throttling set pretty high.

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode=ConcurrencyMode.Multiple)] 

Service has two methods, one simply returns the string was input, the other calls the COM+ component and FOR TESTING returns the string "success" for every call. Therefore, both methods return a simple string.

Client starts 20 threads, each calling the WCF Service twice. (NOTE: A "first call" is made to prime the singleton service and also the COM+ component)

Using log4net and a Stopwatch to log the timings of the clien

WCF hosted in a Windows Service, how to make calls to the WCF service from within the service host


I have a Windows service that I converted to a WCF service that I want to host in a Windows Service.  I need to do some specific tasks in the OnStart() and OnStop() just like I did when it was just a Windows service.  My original Windows service OnStart() is where I create the main worker thread.  So how do I make a call into my WCF service from within the hosting service? For example in the hosting service's OnStart() I do a host.Open() then I need to call a method in my WCF service but how?



ServiceHost host =

checking if my web service is correct


 * does database processes for the WebService
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.OleDb;
using System.IO;

/// <summary>
/// Summary description for ConnDb
/// </summary>
public class ConnDb
    OleDbConnection conn;
    string databasePath = "";
    public ConnDb(string databasePath)
        this.databasePath = databasePath;

    //Connects to database and opens it
    public void ConnectToDatabase()
        conn = new OleDbConnection(@"Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + databasePath);


    //disconnects from the database
    public void Disconne

"The request failed with HTTP status 403: Forbidden" when asp page calls remote web service



I use iis7 on win7 pro. I develope an aspx web page which calls the web service in remote site.When it runs, I get an error in the below:

"System.Net.WebException: The request failed with HTTP status 403: Forbidden..."

What's the problem?

Thanks for helps.



MSRS folder should be installed with Reporting Service, correct?


I know the answer to this, but i would like to confirm with you gurus out there :)

so, we have a client, and he said he has installed Reporting Service. However, I coudln't find any MSRS folder on his drive.

Usually, when a reporting service is installed properly, there should be a folder called MSRS$SOMETHING on the drive, correct?

Please let me know.


How to synchronize web service calls



i'm quite unsure as to where might be the best place to ask this question...

i have an iis server that exposes a webservice. this webservice needs to talk to another machine over a serial connection. (that is, on the other machine, there is a service running which provides a server that can be reached over a serial cable.).


infact i have multiple different web services, not just one. all of them need to use the serial connection...

:end edit

basically, that means that i need to somehow synchronize the async webservice calls; they must be queued somehow, or at least the part that connects via the serial connection needs to be.

i'm looking for any suggestion for how this could be implemented.

-thomas woelfer



Service "SQL Server (SQLEXPRESS)" is set as automatic but sometimes the service doesn't start or th



I am using SQL Server Express 2005 and Win XP SP3.

Once my SQL Server (SQLEXPRESS) service does not start automatic (although it is set as automatic), another time it works.

When the service starts automatic it can happen, that it stops unexpected.

I have no error messages in the event log and there are no error messages when I start the service manually.

This happens on 60 different notebooks. (all use SQL Server Express and Win XP SP3).

Sometimes the service works several days without any problems.

I reinstalled SQL Server Express several times but after some time I have the same problem again.

Are there any programs which are not compatible with SQL Server Express?

I hope you have some ideas.

Thanks and regards


To invoke multiple async WCF service calls within a WCF service


I have a scenario for WCF service A implementation where in one one WCF service interface method make multiple async calls to 4 separate WCF service interfaces to get some data (all 4 services have separate set of methods interacting to different servers over internet to get some data basis the input provided). The data thus returned to the WCF service A will be collated & maintained in cache & then will be used to make further 4 subsequent async calls to these 4 separate WCF services for different methods from WCF service A.

The wcf service A will be invoked from a portal asynchronously supplying the input parameters.

I would like to know if any one out here has ever done something like this & if yes then any challenges faced?

Or else how to achieve this kind of functionality using some other concept keeping the first level WCF service intact...



Cannot acces WCF service. WCF hangs after few calls when Streamed mode is used


I am using WCF service with streamed mode. WCF/IIS hangs after few calls. Client not able to access WCF service after few calls. But I am able to access the service from browser. It is happening only with streamd mode. With Buffered mode application is working fine. Tried throttling also but not working. I am accessing WCF service from windows application.



Automatic Format Selection in WCF RESTful service

In .NET framework 4.0, Automatic Format Selection feature is introduced by AutomaticFormatSelectionEnabled property of WebHttpBehavior class. The purpose is to dynamically find out and return the response in appropriate format for a service operation.

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

WCF Tip: Using Properties in Service Contracts

you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

Realizing a Service-Oriented Architecture with .NET

This article is meant to be a practical discussion guide to building a .NET application in a service-oriented architecture. We will consider real-world goals, real-world obstacles, and experience-based solutions. I quickly concede the approaches discussed here are not exhaustive or infallible. This paper is focused on application development, not application integration. We will specifically consider architectural issues and component design issues.

The Potential of Web Services

Automatic vs Explicit Properties

If the reason that motivated the change from automatically implemented property to explicitly implemented property was to change the semantics of the property then you should evaluate whether the desired semantics when accessing the property from within the class are identical to or different from the desired semantics when accessing the property from outside the class.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend