.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

How add Operation Behavior on a Receive Activity?

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


 how i can do this [adding an operation behavior]:



View Complete Post

More Related Resource Links

How to setup a ReceiveReply activity to receive the result of a WCF service operation?


I already figured out what I have to do to send a WCF message to a WCF service developed with .NET, but I could not get the result back to the workflow. I need to know what I have to do to get that result. 

I have a very simple test WCF service with following contract:

[ServiceContract(Namespace = http://www.juergen-bayer.net/samples/wcf)]
public interface IDemoService
  long Add(int value1, int value2);

The client application uses a workflow with a Send and a ReceiveReply activity. The WCF endpoint is configured in the config file:

   name="BasicHttpBinding_IDemoService" />

The Send activity is configured like follows:

Action="http://www.juergen-bayer.net/samples/wcf/IDemoService/Add" => This would also be the default value in my case

The parameters of the WCF message are placed in the content: 


Workflow Service 4.0 with One Way Receive activity will not get fired when called by a console based

Workflow Service 4.0 with One Way Receive activity will not get fired when called by a console based client application. This service does get called when there's the default ReceiveRequest coupled with a SendReply activity in the service. However deleting the ReceiveRequest and SendReply Activities and replacing it with a one way Receive Activity causes the Workflow 4.0 Service to not get called. Thanks, Leo Cono - http://www.YouLoveMe.com, Free Dating Site  

Change custom activity behavior



To run the workflows from XAML I use WorkflowApplication.Run. I would like to change behavior of the custom activity depends on how the activity was running. I mean - in some situations my custom activity should report to DB, but in other situation shouldn't. I can add InArgument (or property) to this activity, but I don't know how to pass to my custom activity value for this InArgument (property).

Is there any other way to do, what I described?

Passing parameters of type List<> from a web application to the Receive activity of a workflow servi



I have a Recieve activity with the following parameters in the Content property.  Using generic parameter names here:

- parameter1 of type Object1 assigned to Parameter1 variable

- parameter2 of type List<Object2> assigned to Parameter2 variable.  Note - default value of Parameter2 variable = New List(Of Object2)()

- parameter3 of type Object3 assigned to Parameter3 variable

In my web application, I create a service reference and create a client as such:


SomeWFServiceClient client = null


 client = new
 List<Object2> listOfObject2 = new
 List<Object2> { new
 Object2 {Id=1, Name="SomeName"
, Type="Customer"
 }, };

client.ProcessSomething(Object1, listOfObject2, Object3);


I have a breakpoint at the Receive activity.  When I look at the values that get assigned to the Receive activity parameters, I see that parameter1 and parameter3 ge

Debugging Receive activity that does not have corresponsing SendReply


I digged deeper into a problem I experienced earlier (and described in another question today), and here is what I found:

  • If I create a WorkflowService that contains correlated Receive and SendReply activities, then I can set a breakpoint there and step into it from a debugging session (e.g. from a unit test project)
  • If I delete Receive/SendReply pair or simply delete SendReply activity from a generated pair, then I can no longer step into a workflor in a debugger session.

Apparently the difference is that in the second case Receive activity is considered to be a one-way message, and it affects the session lifetime. However, in many cases it is essential to debug a wrapping sequence activity, and currently I don't seem to find a sensible way (except for brutal things like inserting Debugger.Break).

Is there a workaround for this?

Vagif Abilov

Can you use MSMQIntegration binding in a Receive Activity?



I am just learning both WCF4 and WF4 and trying to decide which technology fits my requirements so this may be a dumb question. I have no prior experience with previous versions so I'm flying blind with information overload right now.

I have an existing service that populates a MSMQ transactional message queue and I need to create (to start with anyway) another service that pulls the message of the queue and does some processing before passing them off to another component.

I have a Windows service that hosts a WCF service using ServiceHost; this I was able to get prototyped to pull messages of the incoming queue and place them on another queue.

I then tried to create a Workflow service to see if it can do the same thing. I ran the workflow in a Windows service using WorkflowService to load the xamlx and host it in WorkflowServiceHost.

  • I first used netMsmqBinding as shown below but it only ever took the first message from the queue when the service started up.
  • As my WCF worked using msmq integration binding, I tried to change the workflow's Receive Activity to use the MSMQ integration binding - this failed. Is this even possible?
<endpoint ad

Pick with receive/send reply behavior

Hi all,

I have this workflow (simplified view):

				<Receive CanCreateInstance="True"/>

The LongRunningActivity is a code activity which runs another workflow [through Task.Factory.StartNew(() => workflowApplication.Run())] and waits with a ManualResetEvent the completion of the inner workflow. The inner workflow contains other receive activities.
This is the Execute code of the LongRunningActivity CodeActivity:

WaitHandle waitHandle = new ManualResetEvent(false);
        // ...
        WorkflowApplication workflowApplication = new WorkflowApplication(definition);
        workflowApplication.Completed = args =>
        Task.StartNew(() => workflowApplication.Run());

When I run it, I have the same behavior:

Receive activity from PHP client

Hi, I am trying to call the ReceiveActivity hosted in IIS by php client. Service is hosted in IIS uses wsHttpContextBinding. I am using following code to generate a Soap request from php client which is hosted on apache at port 81. $instanceId='95f2f6c7-580b-49cd-99eb-824208591b06'; $url='http://localhost:8090/test12/Service.svc?wsdl'; //create context try { $paramSent=array('soap_version'=>SOAP_1_2); $soapClient = new SoapClient($url, $paramSent); $format ='<Context xmlns="%s"><Property name="instanceId">%s</Property></Context>'; $nameSpace='http://schemas.microsoft.com/ws/2006/05/context'; $headerStr = sprintf($format, $nameSpace, $instanceId); $soapVar = new SoapVar($headerStr, XSD_ANYXML, null, null, null); $soapHeader = new SoapHeader($nameSpace, 'Context', $soapVar, true); $soapClient->__setSoapHeaders(array($soapHeader)); var_dump($soapClient); try{ $params=array('value'=>'12'); $result=$soapClient->GetData($params); } catch (Exception $e) { print_r($e); } if (is_soap_fault($result)) { trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})&quo

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

Run Button Behavior: Suggestion/Bug


Note: This could be a bug or considered as suggestion. I am not looking for solution.

1: I have ImageWatermark.cshtml open and currently in focus.

2: I have Photo1.jpg selected in left Files workspace.

3: Now if I Click "Run", instead of opening ImageWatermark.cshtml it trys to open Photo1.jpg and it fails.

So ideally I would expect the "open file (ImageWatermark.cshtml) to run rather than running the selection from Workspace.

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is no



 I keep getting the following error. I also added time out parameter in the connection stirng and it still did not help. Has any one faced similar issues.

Thanks in adavance.

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]

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?


Word Automation - Multiple DCOM Errors/Behavior

Before I get started, I already know that Microsoft does not support and highly discourages server-based MS Office automation.  I've read a multitude of posts and smarmy "*wink*, here's a link" replies, so I'm looking for actual help here, not condescending reprimands.

That notwithstanding, here is my problem.  I have developed a simple method that will open a local Word document, modify some header information, and then save the document as a new file.  As expected, it works great as a console/windows app, but as soon as I went to ASP.NET, DCOM jacked my world up when accessing the app remotely from a different domain account (that has access to the ASP.NET app.  For reference, my method is shown below:


1    public static string ModifyAndSaveBuildDocument(string localFilePath, BuildDocumentType docType, string buildNumber, DateTime buildDate, string projectName)
2            {
3                try
4                {
5                    ProjectConfiguration config = (ProjectConfiguration)ConfigurationManager.GetSection("ProjectConfiguration");

ToggleDebugCompilation fails trying to perform "an unauthorised operation"



We're having a problem with the Visual Studio 2008 RTW version of the web deployment projects on a colleagues machine. The project works fine if I run it on my machine, but when he tries to run it on his machine he gets:

<SNIP : Most output removed>
  Task "Exec"
    if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
  Done executing task "Exec".
  Using "ToggleDebugCompilation" task from assembly "C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.Tasks.dll".
  Task "ToggleDebugCompilation"
    Updating Web.config <compilation> element debug attribute to 'True'.
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error : Attempted to perform an unauthorized operation.
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: The "ToggleDebugCompilation" task failed unexpectedly.
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: System.ArgumentNullException: Parameter "message" cannot be null.
    C:\Program Files\MSBuild\Microsoft\WebDeployment

A Simple XML-driven Tool: Monitor Your Web Site's Activity with COM and Active Scripting


This article describes a simple Web site monitoring tool built with XML, JScript, Windows Script Host, and COM objects. Although it is not intended to replace complete Web site monitoring software products, it has many useful features that help to keep Web servers up and running. An XML configuration file specifies which Web sites to monitor and the actions to be taken if the site isn't functioning properly. In addition, the tool can be scheduled to run at any specified interval using the Windows Task Scheduler. Functions that probe the sites, log events, and send e-mail notifications are written in JScript.

Panos Kougiouris

MSDN Magazine July 2000

ModalPopup/UpdatePanel from codebehind, inconsistent behavior onClick


First post bear with me please:

I have a simple form with a list of linkbuttons, each fires the same onclick event which sets an indicator image.  I have a dummy button with style="display:none" which I have set as the TargetControlID of the modal.

onClick event from the imagebutton, the modal is shown via modal.Show().  The cancel button inside the modalpopup fires an event which turns off the indicator image and hides the modal via modal.Hide(). 

The events fire perfectly, it's very simple!  Although after doing some testing I noticed the modalpopup is not presented after the 6-10th cycle of clicking the open event, then clicking cancel.  The grey background appears but it is behind the main panel and the modal is either presented behind this or is just simply not displaying. 

I spent hours researching various methods, implemented the CancelControlID to see if it was somehow tied to my call of modal.Hide() that fails.

This occurs with an updatepanel only.  The behaviour is much cleaner this way, so I would hope to be able to implement this.  I have basically eliminated everything but these two events!  Please help

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