Microsoft TechDayshttp:// Ефимцева Наталия Partner Technologies Consultant
Microsoft TechDayshttp:// Полностью переработанная WF Runtime WorkflowServiceHost WorkflowControlEndpoint Активности SendReply ReceiveReply Корреляция Явная (request-reply correlation) На основе контекста (context correlation) На основе SOAP сообщения (content based)
Microsoft TechDayshttp:// WCF 4.0
WorkflowServiceHost host = new WorkflowServiceHost("HelloWorld.xamlx", new Uri(" host.AddDefaultEndpoints(); host.Description.Behaviors.Add( new ServiceMetadataBehavior{ HttpGetEnabled = true }); host.Open();
WorkflowServiceHost host = new WorkflowServiceHost("HelloWorld.xamlx", new Uri(" host.AddDefaultEndpoints(); WorkflowControlEndpoint wce = new WorkflowControlEndpoint( new NetNamedPipeBinding(),new EndpointAddress("net.pipe://localhost/helloworld/WCF")); host.AddServiceEndpoint(wce); host.Open(); IWorkflowCreation creationClient = new ChannelFactory ( creationEndpoint.Binding, creationEndpoint.Address).CreateChannel(); Guid instanceId = creationClient.CreateSuspended(null); WorkflowControlClient controlClient = new WorkflowControlClient(controlEndpoint); controlClient.Unsuspend(instanceId);
Variable Item = new Variable (); Variable OrderHandle = new Variable (); Receive StartOrder = new Receive { CanCreateInstance = true, ServiceContractName = OrderContractName, OperationName = "StartOrder" }; SendReply ReplyToStartOrder = new SendReply { Request = StartOrder, CorrelationInitializers = { new ContextCorrelationInitializer { CorrelationHandle = OrderHandle } };
Microsoft TechDayshttp:// WCF REST Starter Kit WCF WebHttp Service Кэширование (IIS/WAS) Динамический определение формата XML, JSON, ATOM, бинарный и т.п. Поддержка ASP.NET Routing Поддержка JSONP для AJAX сервисов Автоматическое создание help-страницы
Microsoft TechDayshttp:// WCF 4.0 WCF 4.0 Источник:
[WebGet(UriTemplate = "Users/{userName}")] public User GetUser(string userName) { } [WebInvoke(UriTemplate = "Tasks/{id}", Method = "PUT")] public Task UpdateTask(string id, Task task) { }
if (user == null) { throw new WebFaultException ( string.Format("There is no user with the userName '{0}'.", userName), HttpStatusCode.NotFound); }
private void RegisterRoutes(RouteCollection routes) { routes.Add(new ServiceRoute("Customers", new WebServiceHostFactory(), typeof(Service))); }
[AspNetCacheProfile("CacheFor60Seconds")] [WebGet(UriTemplate=XmlItemTemplate)] public Counter GetItemInXml() { return HandleGet(); }
Microsoft TechDayshttp:// © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.