Download presentation
Presentation is loading. Please wait.
Published byThomas McCarthy Modified over 8 years ago
1
Web Service Programming with WCF 3.5 Eyal Vardi CEO E4D Solutions LTD Microsoft MVP Visual C# blog: www.eVardi.com
2
Agenda Web Services Future (Cloud Computing) Web Services Customizations with.NET 3.5 – JSON / POX vs. SOAP – GET vs. POST, PUT & DELETE – Cache – URI Template ADO.NET Data Services ( LINQ to URL )
3
About Consulting Mentoring Projects
4
Web Services Everywhere…
5
You know how it starts, But you don’t know how it ends !!! You know how it starts, But you don’t know how it ends !!!
6
Web Services Customizations
7
POST SimpleService.asmx/EchoString HTTP/1.1 Host: localhost:1489 User-Agent: Mozilla/5.0 Accept: text/html Content-Type: application/json; Content-Length: 27... XML, JSON, SOAP, AtomPub... HTTP Communication Headers Data VerbURL
8
POST SimpleService.asmx/EchoString HTTP/1.1 Host: localhost:1489 User-Agent: Mozilla/5.0 Accept: text/html,application/xhtml+xml Content-Type: application/json; Content-Length: 27... JSON vs. SOAP { "Age":37, "FirstName":"Eyal", "ID":"123", "LastName":"Vardi“ } Headers Data VerbURL
9
Before WCF ( ASMX )
10
DEMO Web Service ( ASMX ) Customization
11
ASMX HTTP Options OptionsASMX Data SOAP, XML, JSON, {arg}={value} SOAP, XML, JSON, {arg}={value} Verbs POST, GET POST, GET Headers Help Page Description WebMethod WebMethod Cache JS Proxy ScriptMethod ScriptMethod URI Template NO NO Config
12
WCF Solutions ( WebGet, WebInvoke )
13
DEMO Web Service ( WCF ) Customization
14
ASMX vs. WCF OptionsASMXWCF Data XML, JSON XML, JSON Verbs POST, GET POST, GET GET, POST, HEAD… GET, POST, HEAD… Headers Help Page NO NO Description WebMethod WebMethod NO NO Cache WebMethod WebMethod Headers Headers JS Proxy ScriptMethod ScriptMethod Yes / NO Yes / NO URI Template NO NO Yes Yes Config NO NO NO / Yes NO / Yes
15
DEMO WCF Dynamic Format ( XML or JSON )
16
Client Caching The request doesn’t get to the server, unless the data is expires. Browser GET E4D/Demos/Test.svc HTTP/1.1 Cache-Control : private | max-age=5 | no-cache Expires : Sun, 16 Nov 2008 11:58:18 GT11 GET E4D/Demos/Test.svc HTTP/1.1 Cache-Control : private | max-age=5 | no-cache Expires : Sun, 16 Nov 2008 11:58:18 GT11 HTTP Response
17
GET E4D/Demos/Test.svc HTTP/1.1 If-Modified-Since: 16/11/2008 23:58:13 Etag : d06606c5-7fab-46f0-a5cd-6f911e3e51eb GET E4D/Demos/Test.svc HTTP/1.1 If-Modified-Since: 16/11/2008 23:58:13 Etag : d06606c5-7fab-46f0-a5cd-6f911e3e51eb HTTP/1.1 304 Not Modified Cache-Control: no-cache Connection: Close HTTP/1.1 304 Not Modified Cache-Control: no-cache Connection: Close Server Caching Request 304 Status Browser HTTP Response GET E4D/Demos/Test.svc HTTP/1.1 Cache-Control : no-cache Expires : Sun, 16 Nov 2008 11:58:18 GT11 GET E4D/Demos/Test.svc HTTP/1.1 Cache-Control : no-cache Expires : Sun, 16 Nov 2008 11:58:18 GT11
18
DEMO Server Caching
19
ASP.NET Server Caching Request Response Browser SQL Dependency Duration Vary By Param
20
DEMO ASP.NET Server Caching
21
ADO.NET Data Services
22
LINQ to URL AtomPub Win App orBrowser Data Service IQuerable from x in Products where x.ID > 555 select x.Name
23
Services Platform System.NetSystem.Net WCFWCF Data Services Application / Service
24
DEMO Data Services Hello World
25
Summary Get the MAX from the HTTP 1.1 Caching SOAP vs. JSON ADO.NET Data Services
26
Additional Resources http://www.eVardi.com, My blog. http://www.eVardi.com WCF REST Starter Kit HTTP Protocol (RFC2616) WCF Web Programming Model Overview
27
Related Sessions DEV401: ASP.NET Ajax Internals Dan Amiga 09:00 – 10:30 DEV309: Building Web Sites with ASP.NET MVC Noam King 16:00 – 17:10 ARC301: “Velocity” Yair Siwek 16:00 – 17:10
29
© 2008 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.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.