locked
How to make WF service oneway? RRS feed

  • Question

  • In WCF there is “OneWay” attribute that we can add on the service contract and make service OneWay so the caller doesn’t have to wait till the service gets executed completely. The caller immediately gets the response back and but on the server side the service keeps getting executed

    1.       How do I achieve the same thing in Windows Workflow 4? I have WF service which takes one Int32 parameter and I want to make this service one-way.

    2.       Normally Onaway services returns void, but is it possible in WF to return workflow instance id to the caller immediatly?

    3.       I’m using WF 4 and .xamlx to build workflow. Please provide an example if possible

    Sunday, January 22, 2012 4:06 AM

Answers

  • Hi lax,
    1. WCF/WF service operations are implicitly one way if there is no associated reply (ReceiveReply/SendReply) activity.
    2. If you return data to the caller, by definition it is not a one-way operation any more.
    3. Easiest example is a WCF service application with just a receive activity.
    Tim
    • Proposed as answer by Tim Lovell-Smith Wednesday, January 25, 2012 6:52 AM
    • Marked as answer by lax4u Wednesday, January 25, 2012 3:53 PM
    Wednesday, January 25, 2012 6:49 AM

All replies

  • Hi lax,
    1. WCF/WF service operations are implicitly one way if there is no associated reply (ReceiveReply/SendReply) activity.
    2. If you return data to the caller, by definition it is not a one-way operation any more.
    3. Easiest example is a WCF service application with just a receive activity.
    Tim
    • Proposed as answer by Tim Lovell-Smith Wednesday, January 25, 2012 6:52 AM
    • Marked as answer by lax4u Wednesday, January 25, 2012 3:53 PM
    Wednesday, January 25, 2012 6:49 AM
  • you are correct that this is not a one way service. But i also found out that if you want to send the response back to  caller before executing any other activity, you have to add Delay after the "SendReply"

    Wednesday, January 25, 2012 3:54 PM