環境:
Visual Studio 2008
こんにちは。
ASP.NET の画面からの WCF へのアクセス (このシナリオでは、毎回 WCF サービスの接続が切れてしまいます) や、Workflow Enabled Service (WorkflowServiceHost を使った WCF サービス) による long-running トランザクションのサービスにおけるライフサイクル管理、などの目的で使用する Context オブジェクト (IContextManager を実装したクラス) について、Beta 2 から RTM 版で仕様変更がありました。
各所でご紹介しているサンプルのうち、以下が変更になります。
- 以下の MSDN サンプルソース、及び Web キャストでご紹介しているソースの変更 (今後、コンテンツ自体も正式に変更致します)
WCF と WF の連携 (第2回)
http://www.microsoft.com/japan/msdn/windows/windowsserver2008/tab/code/wcfwf2.aspx - IT Pro 道場「アプリケーションプラットフォーム編」のデモの中でご紹介しているソースコードの変更 (受講者の方にお配りしたテキストに記載しているソースコード)
変更された箇所は、 以下です。
// クライアントのプロキシを作成
ServiceReference.Workflow1Client cl = new ServiceReference.Workflow1Client();
// セッションにコンテキストがあれば、それを設定
IContextManager mgr = cl.InnerChannel.GetProperty<IContextManager>();
if (Session[“myContext”] != null)
{
IDictionary<XmlQualifiedName string, string> getCtx = (IDictionary<XmlQualifiedName string, string>)Session[“myContext”];
mgr.SetContext(getCtx);
}
// 注文実行
cl.SetOrder(1);
// コンテキストをセッションに設定
IDictionary<XmlQualifiedName string, string> setCtx = mgr.GetContext();
Session[“myContext”] = setCtx;
お手数ですが、RTM 版で作成の際は上記の通り IDictionary<string, string> にキャストしてご使用ください。
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2588034&SiteID=1
追記:
本件、広島の MVP の方 (IT Pro 道場 門下生の方) よりいち早くフィードバックを頂きました。
フィードバックありがとうございます。
Categories: Uncategorized
PingBack from http://geeklectures.info/2007/12/27/%e3%83%87%e3%83%a2%e3%81%a7%e3%81%94%e7%b4%b9%e4%bb%8b%e3%81%97%e3%81%a6%e3%81%84%e3%81%9f%e3%82%bd%e3%83%bc%e3%82%b9%e3%81%ae-net-framework-35-rtm-%e7%89%88-%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8b/
LikeLike