Windows Workflow Services 4.0 を REST インターフェイスで動作させようとしています。receiveRequest アクティビティと sendResponse アクティビティを持つ「Service1」という非常に単純なワークフロー サービスがあります。
デフォルトでは、WF サービスは実装されているクラスとインターフェースを自動生成しますが、WF サービスに、内部で自動生成されたインターフェースではなく、独自の REST 対応インターフェースを強制的に使用させたいと考えています。
インターフェイスは次のようになります。
[ServiceContract]
public interface IService
{
[OperationContract]
[WebInvoke( UriTemplate = "/Data/{item}", Method = "GET" )]
String GetData( Int32 item );
}
ただし、このインターフェイスで動作するように XAML を構成するのは困難です。サービス コントラクト名が自分のコントラクトであることを指定するには、次のような XAML 構成が必要です。
<Receive x:Name="__ReferenceID0" CanCreateInstance="True" DisplayName="ReceiveRequest" sap:VirtualizedContainerService.HintSize="464,90" OperationName="GetData" ServiceContractName="w:IService">
ただし、このワークフロー サービスを実行すると、次の例外が発生します。
コントラクト名 'wfService.IService' は、サービス 'Service1' によって実装されたコントラクトのリストに見つかりませんでした。
ただし、バックグラウンドで作成されるサービスは IService インターフェイスを実装していません。ワークフロー エンジンによってインスタンス化されるサービスを拡張して、独自のインターフェイスを実装する方法を知りたいです (上記で説明しました)。
ありがとう