.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

Calling WF 4 Workflow Service Asynchronously from ASP.NET

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :Windows Application


I have a developed a workflow service in VS 2010 and added it to my web site as a service reference with the option of 'Generate asynchronous operations' checked.I am now calling the workflow from my asp.net page and everything works fine except that the page will not finish loading until the workflow completes its operations.I have also added the page directive async=true to the top of the page.My workflow service  is just two activities and a 10 seconds delay in the middle, so the second operations will get called after 10 seconds.I have also configured the persistence store from the web.config file.


Here is my code:


ServiceClient svc = new JobWorkflow.ServiceClient();

Thanks in advance.




View Complete Post

More Related Resource Links

Workflow Service not calling workflow in another project

I have a windows workflow service 4.0 that calls a workflow located in another project (i.e. another assembly). I have created a project reference in my workflow service project to the workflow in the other assembly. I have set a breakpoint in the workflow service receive activity and this breakpoint is hit. Next I step into the next activity which is an activity located in another project and the debugger does not work. Also the other workflow is sending an email.  It appears that the other workflow is not being called because I never receive an email from the workflow in the other project.   Any help is greatly appreciated.

Calling a Web Service Method Asynchronously does not work in Console Application

I have a web service that has a CreateReport method that generates a report based on the specified criteria. When I call this method Synchronously using a Windows Application or Console Application, the call works fine and the report is created. When I call this method ASynchronously (CreateReportASync) using Windows Application the report is created. When I call this method ASynchronously (CreateReportASync) using Console Application the web service does not even get the call.  I am using VS2005 and .Net Framework 2.0.  So the proxy is automatically created with the Async methods.  I am not really interested the result of the method call, so I do not add a Callback Delegate.  

Windows service calling web services asynchronously.


I have followed the code example from http://msdn.microsoft.com/en-us/magazine/cc163821.aspx#S4 to create a windows service that runs web services at scheduled intervals and have hit some scaleability challenges.

Background and disclaimer.

This is my first attempt at a windows service running scheduled web services, for the most part it has been working fine for months until introducing log running tasks.

OS: Windows Server 2003

.NET Framework 3.5

IIS Version 6

Several of the web services I am calling via the windows service task scheduler are long running, 20-30 minutes in duration, and have caused me to fight through a myriad of timeout issues

Calling a data-driven web service method asynchronously


I am trying to write a Windows Service which will call web service methods based on a run schedule.  I have setup a ‘schedule’ table which holds the name of the web service method and some scheduling details (e.g. run every day at 0200).  I am using VS 2005/vb.net.

My service creates a timer which runs every minute and when the timer is fired the schedule table is read and  any entries which are due to fire are actioned.  This could mean multiple methods being fired at the same time.  As some of the methods are overnight batch processes and may take some time, I don’t want processes to wait for others to finish before being actioned.  As the methods themselves write to the system log to report their success or failure the scheduling service does not care whether the job fails or not – it is simply doing a ‘fire and forget’ exercise.

What I need is some code which will fire a data-driven web service method asynchronously.

I have investigated two types of method call.  The first is a simple InvokeMethod:-

mywebservice.GetType().InvokeMember(ScheduleRow("WebMethod").TOString(),(Reflection.BindingFlags.InvokeMethod Or Reflection.BindingFlags.IgnoreReturn), Nothing, mywebservice, Nothing)

The second is an asynchronous call:-

Dim asyncCall as New AsyncCallB

Web Service Workflows: Deploy Distributed Business Processes With Windows Workflow And Web Services


Due to the distributed nature of a business process it makes sense for a workflow to be deployed as a distributed application. See how Windows Workflow and Web Services hold the key.

Israel Hilerio

MSDN Magazine October 2006

VS2005 calling VS2010 asmx service returns empty string


Anyone have any experience with this?

We are using VS 2005 for the front end, and vs 2010 for the web services part (asmx), not wcf yet.


Web service works just like the vs2005 when run locally, no problems.


Connecting to it from a test app returns an empty string. Connecting to a 2005 app doesn't!

Anyone run into this before or have a suggestion? Surely vs 2005 can connect to web services from a later version?






WCF Workflow Service Application - Required Extensions

Hello, I built a WCF Workflow Service App and I built a custom activity that requires an extension in the workflow. In a web app, I'm trying to create a service reference to the WCF workflow service but it says that an extension that is required has not been provided; so how do I consume a service with a required extension? At what point do I supply that extension in an ASP.NET scenario? Thanks. http://linkedin.com/in/brianmains

calling WCF service Method in HTTP GET by browser or ASP.NET ( like HttpWebRequest for example)

Can i call a WCF service Method using HTTP GET by browser or ASP.NET (without WCF Client)? it can be done with asmx web service.... but i can't find a way to call a WCF service Method with HTTP GET through the browser or C# ASP.NET Code... can i do that ?

Calling an asp.net web service from jQuery

As I have post it in earlier post that jQuery is one of most popular JavaScript library in the world amongst web developers Lets take a example calling ASP.NET web service with jQuery . You will see at the end of the example that how easy it is to call a web service from the jQuery. Let's create a simple Hello World web service. Go to your project right click->Add -> New Item and select web service and add a web service like following.   Now modify the code of web service like following. [WebService(Namespace = "http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)][System.ComponentModel.ToolboxItem(false)]// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService]public class HelloWorld : System.Web.Services.WebService{ [WebMethod] public string PrintMessage() { return "Hello World..This is from webservice"; }} Here please make sure that [System.Web.Script.Services.ScriptService] is un commented because this attribute is responsible for allowing web service to be called by Client side scripts. Now to call this  web service from jquery we have to include jQuery Js like following. I am already having in my project so i don't need to include in project just need to add script tag like following. <script type="t

Workflow Service failing on high load

Hi, I am load testing my workflow service to ensure that it can sustain high loads for a high volume transaction application. I am using Visual Studio's Load Test to run on a simple unit test to call the workflow service. I have configured the bindings on my service as follows:  <bindings>      <netTcpBinding>        <binding portSharingEnabled="true" closeTimeout="00:10:00"                 openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"                 maxBufferPoolSize="20480000" maxBufferSize="20480000" maxConnections="10"                  maxReceivedMessageSize="20480000"  >                    <security mode="None" />        </binding>      </netTcpBinding>  &n

calling a web service on a remote server from an ASPX page

hi, I want to call a web service on a remote server. I've done "add web reference" in my project, and VS2005 has created the .discomap and .WSDL in the App_Web_Reference folder. When I try add the namespace representing the web server (the name I created when I added the web reference) by "using XXXXX;" the code does not compile because XXXXX is not defined. Have I missed any steps? thanks, -me

While calling Web service gets exception "The request failed with HTTP status 401: Unauthorized"

Hi All, I created a ASP.NET web service, which was hosted on default visual studioserver, and on excecution of webservice it run .exe file which in turn update xml file. Now i hosted this webservice on IIS 6.0 server, and when i run the service, itfails to execute the exe.When i run it on debug mode, i never get any exception.Code...public string HelloWorld()    {        Process myProcess = new Process();        try        {            myProcess.StartInfo.UseShellExecute = false;            // You can start any process,             myProcess.StartInfo.FileName = @"E:\Projects\some.exe";            myProcess.StartInfo.CreateNoWindow = true;            myProcess.Start();            myProcess.Close();            myProcess.Dispose();            return "Suceess";         }&n

calling a web service on a remote server from a ASPX page (web site project VS2005)

HI,I am maintaining a web site project in VS2005 and have to call a new web service on a remote server. I've done add web reference, and created the .wsdl and .discomap files in the app_webReference folder.  When I try to create a object representing the web service in the code ( wsnamespace.serviceName ws = new wsnamespce.serviceName(); ) the code wouldn't compile.The web site project is already calling other web services. When I right click on the type representing the web service and "go to definition" it takes me to a proxy class (derived from of course SoapHttpClientProtocol) in the metadata. I think this is what's missing for  the new web service i'm trying to call. Have I missed any steps?Thanks in advance.-me

Error calling WCF service that is returning list.".Debugging resource strings are unavailable ......

Ok.this is just making me frustrated... Here is step by step of what I am trying to do (& not able to) 1. I am calling WCF service hosted in a SharePoint 2010 site from a silverlight app in same domain (So no cross doman I guess). 2. I use Linq to Sharepoint for querying the DB. 3. I am having a list "machines" in Sharepoint 2010 that is having a lookup column from Other list called "part" 4. My WCF method GetAllMachines() works perfectly well when it skips the lookup column "partname" & returns List of type machineitem. 5. But problem occurs when I add machineitemobject.parts.partsname in my Linq to Sharepoint query . My service gives the error not found Async_ExceptionOccurred] Arguments: Debugging resource strings are unavailable." 6. Note that return type of my Method is List<machinesitem> 7. The point to note here is that I use SPMETAL tool to generate the LINQ class that maps the lists . So When I try to query the lookup column it tries to add List item of the type class & that is what causing the error. Is it because I am not using datacontract in my service (but it returns the strings & all private members of machines list e.g. name,title etc) Is it making the attribute Serialisable will solve the error ??? I am kind of lost in it ...Plss help!!   Thanks

Unable to call an asmx web service using windows authentication from a Service workflow

Hello, I need to use an existing asmx service from inside my service workflow and I am unable to call it. This asmx service is hosted in a web application with iis set to windows authentication, anonymous is not allowed. I need to send the authentication, only way seems too be using transport for basicHttpBindings. Every time I try to call the service I get an error saying that there is nothing listening to the url of the service generated automatically by VS when I added the Service Reference ? my web config <configuration> <configSections> </configSections> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <protocolMapping> <add scheme="http" binding="wsHttpBinding" bindingConfiguration="WindowsCreds" /> </protocolMapping> <bindings> <basicHttpBinding> <binding name="UtilitiesSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

WCF Workflow Service Hosting

Is there any way I can host a WCF Workflow Service Application in a Windows service instead of IIS?

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);
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