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

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

Long Running Service Operation & WCF

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


I have a requirement where in my service operation is going to be long running process. I dont want to rely on typical duplex call back mechanism cos these service may be used in non wcf technologies as well. can anyone suggest best practices, approach, alternative to achieve the same

Many thanks


View Complete Post

More Related Resource Links

Video: Coding a Long-Running Operation Page in SharePoint Server 2007 or Windows SharePoint Services

Watch this visual how-to video as you learn to write code to mimic the default long-running operations page (the "spinning wheel") in SharePoint Server 2007 or Windows SharePoint Services 3.0. (Length: 7:56)

Coding a Long-Running Operation Page in SharePoint Server 2007 or Windows SharePoint Services 3.0 (V

Watch the video and explore code as you learn how to write code to mimic the default long-running operations page (the "spinning wheel") in SharePoint Server 2007 or Windows SharePoint Services 3.0.

A lengthy operation in an ASP.NET web service


I've built an ASP.NET web service with .NET 2.0 (an asmx file). I invoke a web service method using Ajax. The method takes a substantial amount of time to execute (5 minutes to 1 hour). I believe it's not a good idea to "hang" the web request for so long.
I'm wondering if the web service method could spawn an additional process which in turn would execute the lengthy operation and notify the web service once the operation is completed.
Are there any good practices regarding this kind of functionality?


ASP.NET Workflow: Web Apps That Support Long-Running Operations


Integrating workflow into ASP.NET applications means communicating with activities via a workflow queue and hosting the runtime in the global application class. We'll show you how.

Michael Kennedy

MSDN Magazine January 2009

Develop a Web Service: Up and Running with the SOAP Toolkit for Visual Studio


The new Simple Object Access Protocol (SOAP) Toolkit for Visual Studio 6.0 provides the infrastructure for developers to build, expose, and consume Web services. With a few exceptions that are outlined in the toolkit, the SOAP Toolkit complies with the SOAP version 1.1 specification. It includes the Remote Object Proxy Engine (ROPE), a Service Description and Code Generation Wizard, and code that provides ASP and ISAPI reference implementations of SOAP listeners. This article describes the tools and the object model of the SOAP Toolkit, and then demonstrates ASP and ISAPI implementations of a functional Web service using this toolkit.

Rob Caron

MSDN Magazine August 2000

CRUD Operation should be Part of BO or Service/Manager Classes?



I am developing an application which has a general structure similar to what Scott has described at http://nhibernateasp.codeplex.com

Thanks to Scott for developing such a nice architecture which can be used for most of the projects!

It uses Service Layer which contains service classes (like Product Service) which actually talk to the repository layer (ProductRepository) and these service classes are responsible for CRUD operations while the BO (Product) contains just the data and the validation methods.

As I have read, in OO design, you should design a class which contain both data and behavior, in which case, the BO (Product) should be responsible for doing its own CRUD and it should not be a responsibility of Service classes.

Which approach you think is better design and what could be the reasons?

Any help is this regard is appreiciated.




WCF Service: takes very long time to start up

Hi, What could be the reasons, why my WCF service takes up to 40 seconds to get started? My service class is set to [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] I am running a thread inside this class. The WCF service gets initialized and opened within the context of this thread. The Initialization: private void InitializeWCFService() {      // initialize servcie base addrresses      this.SetupBaseAddresses();      //MetaData behaviour : allow HttpGet      ServiceMetadataBehavior metaDataBehavior = new ServiceMetadataBehavior();      metaDataBehavior.HttpGetEnabled = true;      // initialize service host instance      this.seviceHost = new ServiceHost(this, this.httpBaseAddress, this.tcpBaseAddress);      // add service endpoints and behavior.      this.seviceHost.AddServiceEndpoint(typeof(IUpdateServer), this.GetServerBinding(BindingType.Tcp), EndpointName);      this.seviceHost.AddServiceEndpoint(typeof(IUpdateServer), this.GetServerBinding(BindingType.Http), EndpointName);      this.seviceHost.Description.Behaviors.Add(metaDataBehavior);      // MEX endpoint      this.seviceHost.AddServic

SPWebConfigModification Access Denied & Operation Already Running

I have a question about SPWebConfigModification.  In our site collection feature receiver, we modify the web.config using SPWebConfigModification, and first, we have a problem of access denied because the app pool identity doesn’t have permission to run certain stored procedures on the sp config db.  And then after giving the app pool identity db_owner, we don’t get access denied, but “a web configuration modification operation is already running”.  I have been researching the problem, and I have a feeling it has to do with running ApplyWebConfigModifications at the site collection level, but does anyone know why we hit these two problems and how we “should” be doing it?my blog - Tea Time with Meowkins

Workflow Runtime and Long Running Processes

I am trying to get a handle on the fact that applications have to manage the persistance of workflows directly. in 4.0.  If I set a workflow to run every night at 3:00 AM and then be persisted, how will I know that my application will be awake and ready to do the job.  I know that SharePoint currently uses a timer on the server which fires off every 5 minutes (default). 

Service Operation - Get proper data when browsing the service, but not when calling the service from

Hello, I recently implemented a service operation in an attempt to pass some filter parameters to a data service (a user guid and an organization, actually, for impersonation of a user on the service's call to the application). I successfully added the service operation to the data service, and I can browse the service and see the data filtered as I expected. However, when I call the service operation from the Silverlight client, I don't get any results, even though I should. Am I missing something? Code below if it's helpful. Thanks! Service Operation Definition: [WebGet] public IEnumerable<opportunity> filteredopps(string userid, string org) { /*Define the connection with the impersonated user*/ CrmConnection crmc = CrmConnection.Parse("Authentication Type=Passport; Server=https://" + org + ".crm.dynamics.com/" + org + "; User ID=myuser; Password=mypassword; Device ID=mydeviceid; Device Password=mydevicepassword"); crmc.ImpersonatedUser = new Guid(userid); var crmOnline = new DataContext(crmc); List<opportunity> uplist = new List<opportunity>(); crmOnline.UsingService(service => { var query = from o in crmOnline.opportunityopportunities select o; foreach (opportunity thisopp in query) { uplist.Add(thisopp);

Long running WPF application - Garbage Collection

Hi All, I have a long running WPF application; users start the application and keep it open for at least 6 hours straight. I spend a couple days with a Memory Profiler, solving a couple of memory leaks. According to the Memory Profiler, all is good now. However, when I run the application, and monitor the Memory in the Windows Task Manager, it only seems to grow. When I create a button to force the garbage collection (GC.Collect()), a lot of memory is freed from the app. My questions: 1. I don't feel like it's a good idea to call GC.Collect() explicitly; is there any case where it is advised to do so? 2. Is it normal that it takes WPF that long to start garbage collecting automatically? Thanks, Koen

Error while invoking wcf service and running its methods

Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service.    I am using a wcf service with some methods in it called by some layers wherein i am putting all my business logic.While invoking the service from wcftestclient  and when running few methods i am getting this error . I am getting output for some methods in the same service but for some other methods i am getting this error . I am using LINQ in the methods.    My solution has number of projects .For running the service ,i am right clicking on the project and viewing in the browser as i cannot build whole solution as i have few errors in some unit test projects.       As i am getting output for some methods ,this is definetly not about starting the service .  

Service Operation with Joins between entities

Hello, I have a service operation that queries multiple entities in a data source using joins. However, I can't seem to get to the joined entity, either when browsing the data service in IE, or when consuming the data service in the silverlight client code. With this code in the data service operation method: var query = from o in crmOnline.opportunityopportunities join su in crmOnline.systemusers on o.ownerid.Value equals su.systemuserid select o; Should I not be able to view the data service in a browser and see the systemusers like this (the service operation takes two arguments, userid and org): http://localhost:6246/convoservice.svc/filteredresults?userid='22222222-f3sw-aahh-hy65-nn88dd3333ee'&org='testorg'/systemusers or to consume it in the client like this foreach (opportunity opp in response) { string name = opp.name; string ownername = opp.opportunity_owning_user.fullname; ... ? In either scenario, I'm not having success. When browsing the URL posted above, I get an http 400 "webpage cannot be found" error. I get a null reference exception in the client. Any help would be greatly appreciated! Web: http://invoc.net

Is it possible to show on a site whether a service is running?

I am trying to have a marker show whether or not a particular service within the services.msc is running on a remote server(s). I have a service called Yardi Services on a virtual server.  I want to be able to show on a dashboard I am creating for work, whether this service in running or stopped.  For some reason this service will randomly stop though I have a auto restart on error.  It is really confusing and so I want to be able to know when it stops so I can restart it.       I have not been able to find anything online to support this.  I am assuming that I would need to create a web service or use WMI?  I am new to this stuff and could use some help or direction.  

help need for long running task

i have wcf service and method which runs very long running task and i have subscription service which let's out all the notifications. From asp.net web page i subscribe for the notifications and call the async method..notifications are being recived by the page (kept a debug and can see). On the web page i kept ajax timer, update panel with a label which refreshes every 10 sec. But asp.net seems to be waiting for async completed even to be fired and then update panels shows me all the notification (no use of notifications as the activity is over). I feel because both are in the same thread, that's why asp.net s behaving this way. Any help you guys can offer?

Sharepoint Search Service is running but no results

Hi,   I am new in working with Sharepoint. I recently installed the sharepoint foundation 2010 on a windows server 2008 machine. The sharepoint installed properly and the Sites are working fine. But I just cannot make the Sharepoint Search feature (using the search from the search bar). It always returns no results found. The Sharepoint foundation Search service is started. Also I cannot find the "Search Service" link under the Manage Service applications tab. Did I do anything wrong while installing Sharepoint. Also it will be very helpful if someone can point to a resource where the details about the Search Installation process and working is explained. Thanks

Handling Long running task in Asp.net ???

Hi ,  i am working on Asp.net application with database sqlserver. I have a long running task which takes 50 minutes processing time now in this scenario user cannot wait for this much of time and my web page will also gets expired. basically of long running task does data shifting from one database to another database. In my application multi users can works at the same time this means that users can put multiple requests at the same time. Now my problem is that i want to complete this long running task totally offline which would trigger when user put any request, but what happened when another user put a request at same time this means first request would override by second one. FOR EXAMPLE GOOGLE  mail importing task. if you seen google mail importing task . google provides import your mail from yahoo or others servers when you click on import button then an import task is started and show importing. this importing task runs for one or two days which can be stop by users at any point of time.  this indicates that importing task is totally offline.  I want to implement same functionality in my application. please suggest any way to implement above scenario. Every suggestion would be appreciated. 
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