Your SlideShare is downloading. ×
Internet protocalls & WCF/DReAM
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Internet protocalls & WCF/DReAM

1,363
views

Published on

My deck from the August presentations at LA C# & SoCal .NET user group meetings

My deck from the August presentations at LA C# & SoCal .NET user group meetings

Published in: Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,363
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. RSS, ATOM, JSON, SOAP, RESTWTF?
    Woody Pewitt
    Product Manager
    MindTouch
    woodyp@mindtouch.com
  • 2. What is the alphabet soup?
    RSS
    Really Simple Syndication
    ATOM
    The Atom Syndication Format
    JSON
    JavaScript Object Notation
    SOAP
    Simple Object Access Protocol
    REST
    Representational State Transfer
  • 3. “Services”
    Windows
    Lunix
    Mainframe
    HTTP
    XML
    RSS
    SOAP
  • 4. Proxy Objects
  • 5. Really Simple Syndication
  • 6. Really Simple Syndication (RSS) Feeds
    Format that is used to publish frequently updated information on the Web
    e.g. blog entries
    specific channels on news sites
    ...
    No single standard
    RSS 0.91, RSS 1.0 and RSS 2.0
    RSS feeds are represented as XML documents
  • 7. RSS Example
    <?xmlversion="1.0"encoding="iso-8859-1" ?>
    <rssversion="2.0">
    <channel>
    <title>W3Schools Home Page</title>
    <link>http://www.w3schools.com</link>
    <description>Free web building tutorials</description>
    <item>
    <title>RSS Tutorial</title>
    <link>http://www.w3schools.com/rss</link>
    <description>New RSS tutorial on W3Schools</description>
    </item>
    <item>
    <title>XML Tutorial</title>
    <link>http://www.w3schools.com/xml</link>
    <description>New XML tutorial on W3Schools</description>
    </item>
    ...
    </channel>
    ...
    </rss>
    many other elements
    <language>, <copyright>, <pubDate>, ...
  • 8. ATOM
  • 9. ATOM
    Two related standards
    Atom Syndication Format
    similar to RSS
    supports more content formats (e.g. videos) than RSS
    Atom Publishing Protocol (APP)
    HTTP-based approach for creating and editing Web resources
    similar to the RESTful web service example shown earlier
  • 10. JavaScript Object Notation
  • 11. JavaScript Object Notation (JSON)
    Developed as an XML alternative to represent JavaScript objects as strings
    Easy to produce and faster to parse than XML
    supports different data types
    JSON is based on a subset of JavaScript
    JSON document can be read via the JavaScript eval() function
    security issues: note that this approach can be dangerous if the source is not trusted since any JavaScript code might be executed
    most recent browsers offer a JSON parser
    recognisesonly JSON data types and rejects any scripts
    Many Web 2.0 Applications offer a JSON interface
    Flickr, YouTube, Delicious, ...
  • 12. JSON Data Types
  • 13. JSON Example
    {
    "surname": "Signer",
    “forename": "Beat",
    "address": {
    "street": "Pleinlaan 2",
    "city": "Brussels",
    "postalCode": "1050",
    "country": "Belgium"
    },
    "phoneNumbers": [
    { "type": "office", "number": "123 456 789" },
    { "type": "fax", "number": "987 654 321" }
    ]
    }
  • 14. JSON-RPC
    Simple JSON-encoded remote procedure call protocol that is very similar to XML-RPC
    {
    "version": "1.1",
    "method": "Math.multiply",
    "id": "24034824",
    "params": [128.0, 256.0]
    }
    {
    "version": "1.1",
    "result": 32768.0,
    "error": null,
    "id": "24034824"
    }
    JSON-RPC Request
    JSON-RPC Response
  • 15. Web Services
    Web-based client-server communication over HTTP
    Two main types of Web Services
    Big Web Services
    Universal Description, Discovery and Integration (UDDI)
    Web Services Description Language (WSDL)
    Simple Object Access Protocol (SOAP)
    RESTful Web Services
    Better integrated with HTTP and web browsers
    Making use of PUT, GET and DELETE HTTP methods
  • 16. Big Web Services
  • 17. Big Web Services
    Universal Description, Discovery and Integration (UDDI)
    yellow pages for WSDL
    "global" registry describing available business services
    very complex
    Microsoft and IBM shut down their public UDDI registries in 2006
    Web Service Description Language (WSDL)
    XML application to describe a Web Service's functionality complex
    Simple Object Access Protocol (SOAP)
    defines an envelope for transporting XML messages
    The Web Service Stack contains many other protocols
    BPEL, WS-Security, WS-Reliability, WS-Transaction, ...
  • 18. SOAP
  • 19. SOAP
    Successor of XML-RPC
    Introduced in 1998 as Simple Object Access Protocol
    Dave Winer, Don Box, Bob Atkinson and Mohsen Al-Ghosein
    since version 1.2 the name is no longer treated as an acronym
    XML-based communication protocol
    A SOAP message consists of an Envelope element which contains
    an optional <Header> element
    a <Body> element
    remote procedure call or response information
    SOAP requests are often sent via HTTP POST Request
  • 20. SOAP
    WS-* services
    Common in the enterprise
    Transport neutral
    XML
    SOAP (Meta-data)
    Security, Transactions, Etc.
    Typically implemented with RPC-based toolkits, feels a lot like COM+
  • 21. SOAP Message
    <?xml version="1.0"?>
    <soap:Header>
    <…></…>
    </soap:Header>
    <soap:Envelope>
    <soap:Body>
    <m:GetStockPrice>
    <m:StockName>MSFT</m:StockName>
    </m:GetStockPrice>
    </soap:Body>
    </soap:Envelope>
  • 22. SOAP
    Advantages
    platform and language independent
    SOAP over HTTP results in less problems with proxies and firewalls than other remote procedure call solutions
    There exist a lot of tools and language bindings that automatically create the required client and server-side functionality
    e.g. Java API for XML Web Services, ASMX, WCF
    Disadvantages
    slower than non-verbose protocols
    Big Web Services are not simple
    HTTP is reduced to a simple transport protocol for a large amount of XML metadata payload
    does not make use of the rich functionality offered for HTTP envelopes
    No mechanism for the caching of results
  • 23. Representational State Transfer
  • 24. Representational State Transfer (REST)
    A REST-style architecture has to conform to the following constraints
    Separation of concerns between client and server
    Client and server can be developed and replaced independently
    Uniform interface
    identificationof resources (e.g. URIs on the Web)
    manipulationof resources on the server via representation on the client side
    self-describing messages (e.g. MIME type on the Web)
    hypermediafor application state (e.g. hypertext links for related resources)
    Stateless
    No client state is stored on the server side
    Cacheability
    Responses must explicitly or implicitly define if they are cacheable or not
    Layering
    Intermediary servers (proxies) can be transparently added between the client and the server
    code on demand (optional)
    The server can send application logic (code) to the client (e.g. Java Applets)
    A service that conforms at least to the first five constraints is called a RESTful service
  • 25. REST
    Common in public facing services
    Embraces HTTP
    Services are modeled as “resources” with unique identifiers (URI’s)
    HTTP defines a uniform service contract: GET, POST, DELETE, HEAD
    Resources can be represented as XML, RSS, JSON, etc.
    HTTP provides the necessary features and scalability
    A successful design pattern used throughout the web today
  • 26. RESTful Service
    create or update order #123
    PUT http://demo.com/service/order/123
    REST Service
    retrieve order #123
    GET http://demo.com/service/order/123
    Order #123
    delete order #123
    DELETE http://demo.com/service/order/123
  • 27. RESTful Web Service Example
    POST /users HTTP/1.1
    Host: wise.vub.ac.be
    Content-Type: application/xml
    <?xml version="1.0"?>
    <user>
    <name>Kleinermann</name>
    </user>
    GET /users/Kleinermann HTTP/1.1
    Host: wise.vub.ac.be
    Accept: application/xml
    PUT /users/Kleinermann HTTP/1.1
    Host: wise.vub.ac.be
    Content-Type: application/xml
    <?xml version="1.0"?>
    <user>
    <name>Signer</name>
    </user>
    DELETE /users/Signer HTTP/1.1
    Host: wise.vub.ac.be
    Accept: application/xm
    create
    read
    update
    delete
  • 28. How Did We Get Here?
    Libraries
    Pascal binary API
    COM
    DCOM
    APIs talk
  • 29. Service-orientation
    In computing, service-orientation is a design paradigm that specifies the creation of automation logic in the form of services. It is applied as a strategic goal in developing a service-oriented architecture (SOA). Like other design paradigms, service-orientation provides a means of achieving a separation of concerns.
    http://en.wikipedia.org/wiki/Service-orientation
  • 30. Microsoft’s First XML SOA Tools
    ASP.NET Web Services (ASMX)
    Basic XML Over HTTP (SOAP 1.1/1.2)
    WEB Services Enhancements (WSE)
    Support for WS-Security & TCP services
  • 31. Windows Communication Framework
    Abstract or Model
    Transport
    Message format
    Message protocols
    Extensibility
    Tries to unify all past models and allows for future changes
  • 32. How to do WCF?
    Define your data (.NET class)
    Define service interface (.NET interface)
    Add WCF attributes
    Implement service interface (.NET class)
    Configure endpoints to expose service (.config files)
  • 33. Endpoints?
    Endpoint
    Address
    Where to send messages
    Binding
    How to send messages
    Contract
    What messages must contain
  • 34. How to consume?
    WCF on the client uses channels to talk to an endpoint
    Service
    (waits for messages)
    Client
    Channel
    endpoint
    endpoint
    endpoint
    endpoint
    endpoint
    Metadata
    endpoint
    endpoint
    Metadataimport tool
  • 35. Why use WCF?
    Developer Productivity
    Use the same way to communicate all the time
    Interoperability
    Flexibility
  • 36. An Alternative to WCF
    MindTouch DReAM
    MindTouch DReAM(Distributed REST Application Manager) is a Web-Oriented Architecture Framework (WOAF) for developing lightweight, highly decoupled web-services.  The framework includes of a REST microserver and classes for web communication, XML processing, and writing highly asynchronous code.
    Microsoft .NET and Novell Mono
    http://developer.mindtouch.com/Dream