Web Service Programming with WCF 3.5 Eyal Vardi CEO E4D Solutions LTD Microsoft MVP Visual C# blog: www.eVardi.com
Agenda <ul><li>Web Services Future (Cloud Computing) </li></ul><ul><li>Web Services Customizations with .NET 3.5 </li></ul...
About Me <ul><li>Consulting </li></ul><ul><li>Mentoring </li></ul><ul><li>Projects </li></ul>
Web Services Everywhere…
You know how it starts, But you don’t know how it ends !!!
Web Services Customizations
HTTP Communication POST  SimpleService.asmx/EchoString HTTP/1.1 Host:    localhost:1489 User-Agent:  Mozilla/5.0  Accept: ...
JSON vs. SOAP POST SimpleService.asmx/EchoString HTTP/1.1 Host: localhost:1489 User-Agent: Mozilla/5.0  Accept: text/html,...
Before WCF ( ASMX )
DEMO <ul><li>Web Service ( ASMX ) Customization </li></ul>
ASMX HTTP Options Options ASMX Data SOAP,  XML,  JSON ,  {arg}={value} Verbs POST,  GET Headers Help Page Description  Web...
ASMX HTTP Options <ul><li>ScriptMethod – Create on the fly JS Proxy. </li></ul><ul><li>WebMethod  – Cache, Description & S...
WCF Solutions  ( WebGet , WebInvoke )
DEMO <ul><li>Web Service ( WCF ) Customization </li></ul>
ASMX vs. WCF Options ASMX WCF Data XML , JSON XML , JSON Verbs POST,  GET GET, POST, HEAD… Headers Help Page NO Descriptio...
DEMO <ul><li>WCF Dynamic Format ( XML or JSON ) </li></ul>
Client Caching <ul><li>The request doesn’t get to the server, unless the data is expires. </li></ul>Browser <ul><li>GET  E...
Server Caching Request 304 Status Browser <ul><li>GET  E4D/Demos/Test.svc  HTTP/1.1 </li></ul><ul><ul><li>If-Modified-Sinc...
DEMO <ul><li>Server Caching </li></ul>
ASP.NET Server Caching Request Response Browser <ul><li>SQL Dependency </li></ul><ul><li>Duration </li></ul><ul><li>Vary B...
DEMO <ul><li>ASP.NET Server Caching </li></ul>
ADO.NET Data Services
LINQ to URL LINQ to URL AtomPub Win App or Browser <ul><li>Data Service </li></ul><ul><li>IQuerable<T> </li></ul>from x in...
Services Platform System.Net WCF Data Services Application / Service
DEMO <ul><li>Data Services Hello World </li></ul>
Summary <ul><li>Get the MAX from the HTTP 1.1 </li></ul><ul><li>Caching </li></ul><ul><li>SOAP vs. JSON </li></ul><ul><li>...
Additional Resources <ul><li>http://www.eVardi.com  , My blog. </li></ul><ul><li>WCF REST Starter Kit </li></ul><ul><li>HT...
Related Sessions DEV401: ASP.NET Ajax Internals Dan Amiga 09:00 – 10:30 DEV309: Building Web Sites with ASP.NET MVC  Noam ...
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be...
Upcoming SlideShare
Loading in …5
×

DEV301- Web Service Programming with WCF 3.5

2,137 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,137
On SlideShare
0
From Embeds
0
Number of Embeds
16
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • DEV301- Web Service Programming with WCF 3.5

    1. 1. Web Service Programming with WCF 3.5 Eyal Vardi CEO E4D Solutions LTD Microsoft MVP Visual C# blog: www.eVardi.com
    2. 2. Agenda <ul><li>Web Services Future (Cloud Computing) </li></ul><ul><li>Web Services Customizations with .NET 3.5 </li></ul><ul><ul><li>JSON vs. SOAP </li></ul></ul><ul><ul><li>GET vs. POST </li></ul></ul><ul><ul><li>Cache </li></ul></ul><ul><ul><li>URI Template </li></ul></ul><ul><li>ADO.NET Data Services ( LINQ to URL ) </li></ul>
    3. 3. About Me <ul><li>Consulting </li></ul><ul><li>Mentoring </li></ul><ul><li>Projects </li></ul>
    4. 4. Web Services Everywhere…
    5. 5. You know how it starts, But you don’t know how it ends !!!
    6. 6. Web Services Customizations
    7. 7. HTTP Communication 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 ... Headers Data Verb URL
    8. 8. JSON vs. SOAP 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 ... { &quot;Age&quot;:37, &quot;FirstName&quot;:&quot;Eyal&quot;, &quot;ID&quot;:&quot;123&quot;, &quot;LastName&quot;:&quot;Vardi“ } <Envelope> <Header> <!–- Headers --> <!-- Protocol's & Polices --> </Header> <Body> <!– XML Data --> </Body> </Envelope> Headers Data Verb URL
    9. 9. Before WCF ( ASMX )
    10. 10. DEMO <ul><li>Web Service ( ASMX ) Customization </li></ul>
    11. 11. ASMX HTTP Options Options ASMX Data SOAP, XML, JSON , {arg}={value} Verbs POST, GET Headers Help Page Description WebMethod Cache WebMethod JS Proxy ScriptMethod URI Template NO Config NO
    12. 12. ASMX HTTP Options <ul><li>ScriptMethod – Create on the fly JS Proxy. </li></ul><ul><li>WebMethod – Cache, Description & Session </li></ul>Data Verb Headers URL <ul><ul><li>XML </li></ul></ul><ul><ul><li>JSOM </li></ul></ul><ul><ul><li>GET </li></ul></ul><ul><ul><li>POST </li></ul></ul>X
    13. 13. WCF Solutions ( WebGet , WebInvoke )
    14. 14. DEMO <ul><li>Web Service ( WCF ) Customization </li></ul>
    15. 15. ASMX vs. WCF Options ASMX WCF Data XML , JSON XML , JSON Verbs POST, GET GET, POST, HEAD… Headers Help Page NO Description WebMethod NO Cache WebMethod Headers JS Proxy ScriptMethod Yes / NO URI Template NO Yes Config NO NO / Yes
    16. 16. DEMO <ul><li>WCF Dynamic Format ( XML or JSON ) </li></ul>
    17. 17. Client Caching <ul><li>The request doesn’t get to the server, unless the data is expires. </li></ul>Browser <ul><li>GET E4D/Demos/Test.svc HTTP/1.1 </li></ul><ul><ul><li>Cache-Control : private | max-age=5 | no-cache </li></ul></ul><ul><ul><li>Expires : Sun, 16 Nov 2008 11:58:18 GT11 </li></ul></ul>HTTP Response
    18. 18. Server Caching Request 304 Status Browser <ul><li>GET E4D/Demos/Test.svc HTTP/1.1 </li></ul><ul><ul><li>If-Modified-Since: 16/11/2008 23:58:13 </li></ul></ul><ul><ul><li>Etag : d06606c5-7fab-46f0-a5cd-6f911e3e51eb </li></ul></ul>HTTP/1.1 304 Not Modified Cache-Control: no-cache Connection: Close HTTP Response <ul><li>GET E4D/Demos/Test.svc HTTP/1.1 </li></ul><ul><ul><li>Cache-Control : no-cache </li></ul></ul><ul><ul><li>Expires : Sun, 16 Nov 2008 11:58:18 GT11 </li></ul></ul>
    19. 19. DEMO <ul><li>Server Caching </li></ul>
    20. 20. ASP.NET Server Caching Request Response Browser <ul><li>SQL Dependency </li></ul><ul><li>Duration </li></ul><ul><li>Vary By Param </li></ul>
    21. 21. DEMO <ul><li>ASP.NET Server Caching </li></ul>
    22. 22. ADO.NET Data Services
    23. 23. LINQ to URL LINQ to URL AtomPub Win App or Browser <ul><li>Data Service </li></ul><ul><li>IQuerable<T> </li></ul>from x in Products where x.ID > 555 select x.Name
    24. 24. Services Platform System.Net WCF Data Services Application / Service
    25. 25. DEMO <ul><li>Data Services Hello World </li></ul>
    26. 26. Summary <ul><li>Get the MAX from the HTTP 1.1 </li></ul><ul><li>Caching </li></ul><ul><li>SOAP vs. JSON </li></ul><ul><li>ADO.NET Data Services </li></ul>
    27. 27. Additional Resources <ul><li>http://www.eVardi.com , My blog. </li></ul><ul><li>WCF REST Starter Kit </li></ul><ul><li>HTTP Protocol (RFC2616) </li></ul><ul><li>WCF Web Programming Model Overview </li></ul>
    28. 28. 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 16:00 – 17:10
    29. 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.

    ×