Creating AYNC services

Topics: General Discussion Forum, Service Factory Modeling Edition Forum
May 1, 2008 at 3:01 PM
Hi All,

It appears that if you try to use the Async Pattern on the operation the proxy that gets generated does not implement the begin and end. Is this true? Do you have to use svcutil with the async switch to generate the proxy?

May 2, 2008 at 11:04 AM
The generated proxy only has sync operations (implements the standard sync pattern). So as you mentioned you will need to run svcutil with async switch in order to generate the async Begin/End pattern.
Jan 6, 2010 at 10:29 PM

Hi Charlyfriend...

Can we modify the wssf to emulate the svcutil /a command? The next version of this service factory tool, will include it?


Jan 8, 2010 at 9:29 PM

Hi Paris,

If you don't want to wait until the next version which might include that option (simple guess on this), you can experiment following these steps:

  1. Locate the recipe file "CreateWCFClientProxy.xml" which is in the folder path "...\Service Factory Guidance Package\Guidance Package\Recipes\CreateWCFClientProxy".
  2. Look for the argument named "ContractGenerationOptions" and replace the type with your own type that should derive from ContractGenerationOptions.
  3. In your custom type set the property "GenerateAsyncMethods" with "true". 
  4. Make sure you put your assembly with the type in #3 in the same folder as the rest of the wssf files.

The good part of this is that you don't need to recomplie WSSF source. If the recipe does not recognize your custom type that derives from Microsoft.Practices.ServiceFactory.Description.ContractGenerationOptions then you may need to update that class in the WSSF source and rebuild it following the documentation steps for updating WSSF source.

Good luck,