What's new in Wcf4

  • Published on
    16-Apr-2017

  • View
    528

  • Download
    0

Embed Size (px)

Transcript

<p>Whats new in WCF 4.0</p> <p>Whats new in WCF 4.0about.me/Chakravarthy About ME1.40</p> <p>About MEMCA, MVP, MCPD, MCTS and CSMj.mp/CareerHistoryDeveloper turned ArchitectWHAT !!Who else !!</p> <p>Community PersonAgenda2.40</p> <p>AgendaWhats new !!??ConfigurationTracingSerializationMessage queuingService discoveryRoutingWorkflow servicesDemo3.40</p> <p>Lets start ..</p> <p>WCF !!??4.40</p> <p>Whats new in WCF</p> <p>Kalpana5.40</p> <p>Kalpana (1948) is a Bollywood movie from a time before the term had been invented. This 155-minute-long black-and-white feature film gives full rein to the talents of choreographer Uday Shankar, the films director and a legend of Indian dance. The film is about a young dancer who dreams of founding his own dance school, played by the director himself. Despite living until the age of 76, Kalpana is the one and only film Uday Shankar directed in his entire career. In the dance world, however, he will be remembered as a veritable master of the art of choreography. Kalpana will be screened at Cannes Classics on Thursday 17th May at 19:30, Salle Buuel.After ..6.40</p> <p>Far from the world of Indian dancing, After the Curfew (1954) has as its backdrop the post-war period in Indonesia. In the months following independence, Iskandar returns to civilian life. For this medical student it is a time of bitter disillusionment, as he sees corruption and political incompetence take hold throughout the country. The director, Usmar Ismail, is considered as one of the forefathers of Indonesian cinema. He made a major contribution to the development of Indonesian cinema in the 1950s by founding Perfini, the countrys first film studios. After The Curfew will be screened at Cannes Classics on Thursday 17th May at 17:15, Salle Buuel.</p> <p>Huh !!??7.40</p> <p>??!!</p> <p>WCF ..8.40</p> <p>Configuration9.40</p> <p>Source : http://j.mp/WCF4ConfigImp a) Configuration ImprovementsRemoved the need for explicit per-service configurationdefault values for WCF bindings &amp; behaviorsthe standard endpoint, which will allow you to define reusable preconfigured endpointsDefault Binding10.40</p> <p>Default bindings &amp; behaviors Config Improv11.40</p> <p>Source : http://j.mp/WCF4ConfigImp Configuration ImprovementsFileless Activ12.40</p> <p>File-less activationIn WCF 4, you no longer need physical .svc files to activate servicesInstead you can define a virtual mapping in config</p> <p> Def Endpoint13.40</p> <p>Default endpointsWCF 3.x services required at least one endpoint or youd get an exceptionWCF 4.0 services come with default endpointsOne default endpoint per contract/base address combinationAssuming you havent defined any manuallyIf youve defined at least one endpoint, you wont get default endpointsStd EPs14.40</p> <p>Standard endpointsWCF 4 also comes with several preconfigured standard endpointsThese cover some of the most common usage scenariosYou can simply reuse them as-is without changeYou refer to standard endpoints by name using the kind attributeMakes it easier to get up and running in certain scenarios</p> <p>Media Formats 15.40</p> <p>Formats and FlexibilityApprox 90016.40</p> <p>preConfig EndPointsapplication/jsonapplication/xmlapplication/atom+xmlimage/pngtext/directorytext/calendarapplication/xaml+xmltext/htmlimage/svg+xmlmultipart/form-dataapplication/x-www-form-urlencodedApprox 900 App media types!17.40</p> <p>MIX 1112/12/2013 2011 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.17</p> <p>preconfigured Standard endpoints in v4.0Standard endpoint nameDescriptionmexEndpointDefines a standard endpoint for MEX configured with IMetadataExchange for the service contract, mexHttpBinding as the default binding (you can change this), and an empty address.dynamicEndpointDefines a standard endpoint configured to use WCF Discovery within a WCF client application. When using this standard endpoint, an address is not required because during the first call, the client will query for a service endpoint matching the specified contract and automatically connect to it for you. discoveryEndpointDefines a standard endpoint that is pre-configured for discovery operations within a client application. The user needs to specify the address and the binding when using this standard endpoint. udpDiscoveryEndpointDefines a standard endpoint that is pre-configured for discovery operations within a client application using the UDP binding at a multicast address.Derives from DiscoveryEndpoint.announcementEndpointDefines a standard endpoint that is pre-configured for the announcement functionality of discovery. The user needs to specify the address and the binding when using this standard endpoint. udpAnnouncementEndpointDefines a standard endpoint that is pre-configured for the announcement functionality over a UDP binding at a multicast address. This endpoint derives from announcementEndpoint.workflowControlEndpointDefines a standard endpoint for controlling execution of workflow instances (create, run, suspend, terminate, etc).webHttpEndpointDefines a standard endpoint configured with WebHttpBinding and WebHttpBehavior. Use to expose REST services.webScriptEndpointDefines a standard endpoint configured with WebHttpBinding and WebScriptEnablingBehavior. Use to expose Ajax services.</p> <p>Default protocol18.40</p> <p>Default protocol mapping How 2 Choose19.40</p> <p>How to choose a BindingInside Firewall &amp; .NET to .NETLocal OnlyYesNoSupport Legacy?YesNoYesNoNeed to DisconnectYesNoNetTcp BindingNetMsmq BindingNetNamedPipe BindingBasicHttp BindingWsHttp BindingMSMQ ClientYesNoMsmq Integration BindingDef behavior20.40</p> <p>Default behavior configuration</p> <p>Routing Srv21.40</p> <p>RoutingServiceMsg Pump22.40</p> <p>12/12/2013 3:14 AM2005 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.22</p> <p>Message Pump as a ServiceScenariosBasic Message RoutingProtocol BridgingService AggregationVersioningConcernsConnection StateSecurityDelivery FailureTransactionsMessage Pump</p> <p>Inbound ChannelOutbound ChannelRoutingService: A Message Pump Service for you to host, extend, and enjoy!Routing ServiceRoutingServiceMsg Rout23.40</p> <p>23</p> <p>Message RoutingClientTimeServiceRoutingServiceEchoIRequestReplyRouterBasicHttphttp://routinghost/routerABCSupported Message Exchange PatternsMulticastInterfaceRequest Reply, Sessionful Request ReplyNoIRequestReplyRouterOneWayYesISimplexDatagramRouterSessionful OneWayYesISimplexSessionRouterSessionful DuplexYesIDuplexSessionRouter</p> <p>Msg Rout24.40</p> <p>24</p> <p>Message RoutingMessageFilterEndpointaction == http://Message/EchoEchoaction == http://Message/GetCurrentTimeTimeService</p> <p>ClientTimeServiceRoutingServiceEchoFilter OnMessageFilterActionActionMessageFilterAddress headerAddressMessageFilterAddress header longest prefix matchingAddressPrefixMessageFilterEndpoint NameEndpointNameMessageFilterNo Filter matches everythingMatchAllMessageFilterLogical And of two filtersStrictAndMessageFilterXPath expressionXPathMessageFilterCustomCustom</p> <p>Replaceable atRuntimeProtocol Brdg25.40</p> <p>25</p> <p>Protocol BridgingClientService</p> <p>RoutingServiceBasicHttp</p> <p>Net.TcpSOAP 1.1SOAP 1.2Security26.40</p> <p>26</p> <p>SecurityClientService</p> <p>RoutingService</p> <p>Message sent usingClient IdentityMessage sent usingRouting Service IdentityMessage sent usingClient IdentityImpersonation using WindowsIdentityTokenErr Hndl27.40</p> <p>27</p> <p>Error HandlingClientBackupEcho Service</p> <p>RoutingService</p> <p>EchoService</p> <p>MessageFilterEndpointAlternateEndpointsaction == http://Message/EchoEchoBackupEchoService</p> <p>Rout Srv28.40</p> <p>28</p> <p>Router ServiceFirst-class "router" serviceSimply host the RoutingService classYou host it like any other WCF serviceConfigure with routing filters to do content-based routing</p> <p>Host Rut Srv29.40</p> <p>Hosting the RoutingServiceAdditional routing service capabilitiesProtocol bridging (client sends over HTTP, router sends over TCP, etc)Error handling support (router configured with backup endpoints)Multi-cast routing support (router sends to multiple endpoints)Using Rut Srv30.40</p> <p>Using the Routing ServiceCreate regular WCF Services to be called by the Routing Service.Create a Routing Service:Change the markup in the .svc file to point to the routing Service. </p> <p>Be sure to reference System.ServiceModel.Routing in your project</p> <p>In the web.config:Add endpoints for all the services to which youll connect in the section.</p> <p> Using cnt..31.40</p> <p>Using the Routing Service (contd)In the web.config (contd):Create a namespace filter and set the Xpath filterData </p> <p> Add filterTables to point to the correct end points</p> <p>Set the Routing behavior to identify the filterTables</p> <p>Demo32.40</p> <p>Demo: Simple routing service exampleDEMO</p> <p>WebHttp Srvs33.40</p> <p>33Tech Ed North America 201012/12/2013 3:14 AM 2010 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.</p> <p>WCF WebHttpServicesREST Suprt34.40</p> <p>12/12/2013 3:14 AM2005 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.34</p> <p>Improved REST SupportMany features in the WCF REST Starter Kit are now part of WCF 4.0Auto Help Pg35.40</p> <p>35</p> <p>Automatic help pageWCF 4 provides an automatic help page for REST servicesConfigure the behavior with helpEnabled=true</p> <p>Msg Format Sel36.40</p> <p>Message format selectionWCF 4 also provides automatic format selection for XML/JSONThis feature is built on the HTTP Accept headers</p> <p>WCF &amp; ASP Ruts37.40</p> <p>WCF and ASP.NET routesWCF 4 provides the ability to integrate with the ASP.NET routing engineYou implement RegisterRoutes in Global.asax, add ServiceRoute mappingsServiceRoute allows you to map a URL to a WCF 4 service classUltimately this gives you a URL space that maps to multiple WCF classes</p> <p>private void RegisterRoutes() { WebServiceHostFactory factory = new WebServiceHostFactory(); RouteTable.Routes.Add(new ServiceRoute("Bookmarks", factory, typeof(BookmarkService))); RouteTable.Routes.Add(new ServiceRoute("Users", factory, typeof(UserService))); }38.40REST Prj Tmpl</p> <p>REST project templatesDownload the new REST project templates via the new Visual Studio 2010 Extension Manager (Tools | Extension Manager)</p> <p>39.40Summary</p> <p>SummaryWCF/WF 4.0 offers many improvements:Simplified configurationDiscoveryRouting serviceWebHttp servicesWorkflow servicesThese improvements make WCF simpler and more flexibleTodays common use cases just got easierThanks40.40</p> <p>40</p> <p>ThanksThanks</p>