locked
Workflow Service 4.0 with One Way Receive activity will not get fired when called by a console based client application. RRS feed

  • Question

  • 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

     

    Saturday, September 11, 2010 2:15 PM

Answers

  • Hi Steve -

    I did re-add the service reference to the console application but that did not work.

    Also in my original post, I originally thought that the problem was calling an Activity Library located in another project.

    Since then I discovered that it has nothing to do with an Activity Library in another project.  Thus I created a new msdn forum thread for better clarity and to simplify reporting of this problem.

    I have a solution to this problem by working with Microsoft Tech Support.

    Here are the details:

    There was an error getting thrown in the Receive Behavior.  

    The error msg was:

     

    RequestReplyCorrelationInitializer should not be specified on a one way Send or Receive activity. When initializing RequestReply correlation, Send should be paired with a ReceiveReply activity and Receive should be paired with a SendReply activity.

    You will need to remove your RequestReplyCorrelationInitializer to get this to work.

     

    Here is what I did:
     
    1.) Add new WCF Workflow Service item to the Workflow 4.0 Service project.
    2.) Delete the automatically added ReceiveRequest and SendResponse Activitites.
    3.) Add a Receive Activity inside the Sequential Service sequence parent activity.
    4.) Set OperationName to RunWorkflow and set the CanCreateInstance = true.
    5.) View Service3.xamlx with code view and remove the <Receive.CorrelationInitializers> node

    Change from this:

        <Receive CanCreateInstance="True" sap:VirtualizedContainerService.HintSize="255,90" OperationName="RunWorkflow">
          <Receive.CorrelationInitializers>
            <RequestReplyCorrelationInitializer CorrelationHandle="[__handle1]" />
          </Receive.CorrelationInitializers>
        </Receive>

     
    To this:
    <Receive CanCreateInstance="True" sap:VirtualizedContainerService.HintSize="255,90" OperationName="RunWorkflow" />
     
    6.) Next to be sure the CorrelationInitializer is deleted, click on Receive Activity then click on Variables and delete the handle CorrelationHandle by selecting the entire grid row  and click on the delete key
    7.) Go to the console application and add service reference Service3.xamlx (i.e. the Workflow Service item you added in step 1)

    8.) Add the following client console application code:
                Service3.Service3Client client3 = null;
                try
                    client3 = new Service3.Service3Client();
                    client3.RunWorkflow();
                }
                catch (Exception exception)
                {
                    Console.WriteLine("Unhandled exception: {0}", exception.Message);
                }
                finally
                {
                    client3.Close();
                }

    9.) the breakpoint in the workflow 4.0 service is never hit and it is never called and here is the solution to the debugger:

    Here is what you need to do to fix the debugging problem:

    1.) Right-click your solution in solution explorer and choose set startup project.
    2.) Choose multiple startup projects and change the action to start for the console application and start for the workflow service project
    3.) This will also start Internet Explorer but just disregard that and keep ie open.
    4.) Since it is fire and forget one way calling, the breakpoint will be hit after the finally block client3.Close() is finished processing.

    Sincerely,

    Leo Cono - http://www.YouLoveMe.com, Free Dating Site

     

    • Marked as answer by LeoCono Monday, September 13, 2010 1:26 PM
    Monday, September 13, 2010 1:26 PM

All replies

  • Hi,

    Did you re-add the service reference to the console applicationa fter you replaced the Receive/SendReply with the Receive activity?

    There is a similar thread that has some more details:

    http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/50181155-5da0-4fd4-bba8-c350cda1d9fd

    I just noticed that the other thread is yours as well. Is the same issue as that one or is it still occuring?

    Thanks,

    Steve Danielson [Microsoft]
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

     

    Saturday, September 11, 2010 6:47 PM
  • Hi Steve -

    I did re-add the service reference to the console application but that did not work.

    Also in my original post, I originally thought that the problem was calling an Activity Library located in another project.

    Since then I discovered that it has nothing to do with an Activity Library in another project.  Thus I created a new msdn forum thread for better clarity and to simplify reporting of this problem.

    I have a solution to this problem by working with Microsoft Tech Support.

    Here are the details:

    There was an error getting thrown in the Receive Behavior.  

    The error msg was:

     

    RequestReplyCorrelationInitializer should not be specified on a one way Send or Receive activity. When initializing RequestReply correlation, Send should be paired with a ReceiveReply activity and Receive should be paired with a SendReply activity.

    You will need to remove your RequestReplyCorrelationInitializer to get this to work.

     

    Here is what I did:
     
    1.) Add new WCF Workflow Service item to the Workflow 4.0 Service project.
    2.) Delete the automatically added ReceiveRequest and SendResponse Activitites.
    3.) Add a Receive Activity inside the Sequential Service sequence parent activity.
    4.) Set OperationName to RunWorkflow and set the CanCreateInstance = true.
    5.) View Service3.xamlx with code view and remove the <Receive.CorrelationInitializers> node

    Change from this:

        <Receive CanCreateInstance="True" sap:VirtualizedContainerService.HintSize="255,90" OperationName="RunWorkflow">
          <Receive.CorrelationInitializers>
            <RequestReplyCorrelationInitializer CorrelationHandle="[__handle1]" />
          </Receive.CorrelationInitializers>
        </Receive>

     
    To this:
    <Receive CanCreateInstance="True" sap:VirtualizedContainerService.HintSize="255,90" OperationName="RunWorkflow" />
     
    6.) Next to be sure the CorrelationInitializer is deleted, click on Receive Activity then click on Variables and delete the handle CorrelationHandle by selecting the entire grid row  and click on the delete key
    7.) Go to the console application and add service reference Service3.xamlx (i.e. the Workflow Service item you added in step 1)

    8.) Add the following client console application code:
                Service3.Service3Client client3 = null;
                try
                    client3 = new Service3.Service3Client();
                    client3.RunWorkflow();
                }
                catch (Exception exception)
                {
                    Console.WriteLine("Unhandled exception: {0}", exception.Message);
                }
                finally
                {
                    client3.Close();
                }

    9.) the breakpoint in the workflow 4.0 service is never hit and it is never called and here is the solution to the debugger:

    Here is what you need to do to fix the debugging problem:

    1.) Right-click your solution in solution explorer and choose set startup project.
    2.) Choose multiple startup projects and change the action to start for the console application and start for the workflow service project
    3.) This will also start Internet Explorer but just disregard that and keep ie open.
    4.) Since it is fire and forget one way calling, the breakpoint will be hit after the finally block client3.Close() is finished processing.

    Sincerely,

    Leo Cono - http://www.YouLoveMe.com, Free Dating Site

     

    • Marked as answer by LeoCono Monday, September 13, 2010 1:26 PM
    Monday, September 13, 2010 1:26 PM
  • Hi Leo,

    Awesome, I am glad that you got it working! I will take a look at updating our documentation to make that more clear.

    Steve Danielson [Microsoft]
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

     

    Monday, September 13, 2010 7:38 PM