SlideShare uma empresa Scribd logo
1 de 61
Windows 8,
Metro apps
and the outside world
SILVERLIGHTSHOW.NET WEBINARS SERIES
GILL CLEEREN, 15th August 2012
www.snowball.be - gill.cleeren@ordina.be - @gillcleeren
Agenda
• Accessing data behind a service
• Working with WCF and ASMX services
• Working with REST services
• Accessing oData services
• Syndication with RSS
• Authenticating with Twitter and Facebook using the
  WebAuthBroker
• Using the Live SDK in your Windows 8 apps
• Using roaming data in your applications
• Working with sockets
    – TCP sockets
    – WebSockets
• Setting the correct capabilities for network communication
ACCESSING DATA BEHIND A SERVICE
Working with services to access data

• Service communication is always done asynchronous
   – In Silverlight, this was done using a callback
   – In C#5, we got the async/await keywords
      • Fully supported in Metro/WinRT development
      • await keyword makes things easier
      • Doesn’t block UI thread
          – Doesn’t require the ugly
            Dispatcher.BeginInvoke(() => …);
• Getting data in a Metro application is a 3-step
  process
   – Calling the service asynchronous
   – Receiving and parsing the data
   – Using the data, for example in a data-binding scenario
Working with services to access data

• Working with services is preferred in most
  cases
  – Relational databases should be behind a service
  – Local app storage
     • App has its own storage directory
     • Can access local file system
     • Not the focus of this talk!
Working with services
• Windows 8 supports all kinds of services
  – ASMX
  – WCF
  – REST (JSON or XML)
  – RSS (later in this talk)
  – Sockets (much later in this talk)
  – oData services (you get the drill, it’s also further in this
    talk…)
  – No WCF RIA Services support out-of-the-box though
    (so yes, that is NOT in this talk )
  –…
WCF AND ASMX SERVICES
ASMX services (aka good old
            webservices)
• ASMX services can be accessed without any
  change
• Communication is done asynchronously
• SOAP messages can be sent and received over
  ASMX services
• From Visual Studio, use the default way of
  connecting with a service
  – Add service reference
  – Generates proxy
     • All Task-based!
  – Use proxy-class with the async/await keywords
DEMO

ACCESSING AN ASMX SERVICE
FROM WINDOWS 8
WCF Services
• What is supported?
   – Bindings:
       •   BasicHttpBinding
       •   NetTcpBinding
       •   NetHttpBinding
       •   CustomBinding
   – Binding elements:
       •   BinaryMessageEncodingBindingElement
       •   TextMessageEncodingBindingElement
       •   ConnectionOrientedTransportBindingElement
       •   SslStreamSecurityBindingElement
       •   WindowsStreamSecurityBindingElement
       •   TcpTransportBindingElement
       •   Http(s)TransportBindingElement
       •   TransportSecurityBindingElement
WCF Services
• What is supported
   – Encoding:
       • Text, Binary
   – Security modes:
       • None, Transport, TransportWithMessageCredential, TransportCredentialOnly
         (for BasicHttpBinding)
   – ClientCredentialType:
       • None, Basic, Digest, Negotiate, Ntlm, Windows
   – Transfer Mode:
       • Buffered, Streamed, StreamedRequest, and StreamedResponse
   – Serializers:
       • DataContractSerializer, DataContractJsonSerializer, XmlSerializer
   – Miscellaneous:
       • ChannelFactory
       • DuplexChannelFactory
       • CallbackBehavior
Things to note when working with
       WCF (also goes for ASMX)
• No XML config file code
  – Code gets generated in the Reference.cs file
     • No config edit possible 
  – Use the partial ConfigureEndpoint method
• Only Task-based methods are available
  – Ensures there are no blocking calls
  – Is done by default
• Specify Internet capability
What about security for service
             communication?
• WinRT supports sending credentials
• When building service that expects
  credentials, generated code in Reference.cs will reflect
  this
  result.Security.Mode =
           System.ServiceModel.BasicHttpSecurityMode.TransportCredentialOnly;

  result.Security.Transport.ClientCredentialType =
           System.ServiceModel.HttpClientCredentialType.Windows;




• https, custom validation are supported to enable
  TransportWithMessageCredential
   – Allows safe passing of username/password to service
     endpoint
REST services

• No more WebClient, replaced with HttpClient
  – Works with async
  – Located in System.Net
• HttpClient defines
  – Get(Async)
     • Returns an HttpResponseMessage
  – Put(Async)
  – Post(Async)
  – Delete(Async)
   RESTful!
Parsing the response

• XML
  – Linq-To-XML
  – XmlReader/XmlWriter
  – XmlSerializer
• JSON:
  – Use the JsonObject and feed it the returned string
     • We can use the Parse() method
          – Throws error if the returned string is faulty or invalid
     • Also defines GetNamedString(), GetNamedNumber()
     • Parsing via indexer
          – Not recommended
  – DataContractJsonSerializer is also available
Credential support with REST services
• If REST service requires authentication , WinRT
  will support it
• Some samples:
    HttpClientHandler handler = new HttpClientHandler();
    handler.UseDefaultCredentials = true;
    HttpClient client = new HttpClient(handler);
        using (var handler = new HttpClientHandler
        {
               Credentials = ...
        })
        using (var client = new HttpClient(handler))
        {
            var result = await client.GetAsync(...);
        }
WORKING WITH ODATA SERVICES
What is oData?
• Open Data Protocol
• Design goals ...
   – Invent as little as possible
   – Very low barrier of entry
• OData is a RESTful protocol
• Builds on HTTP and AtomPub
• Defines ...
   –   XML + JSON data representation
   –   Addressing scheme
   –   Query operators
   –   Metadata
Sample URIs
• http://odata.netflix.com/Catalog/
   – AtomPub service document, list of all collections
• http://odata.netflix.com/Catalog/Genres
   – all entries of a collection
• http://.../Catalog/Genres('Adventures')
   – one entry by PK
• http://.../Catalog/Genres('Adventures')/Name
   – one property as XML
• http://.../Catalog/Genres('Adventures')/Name/$value
   – only the value
Navigation
• http://.../Catalog/Genres('Adventures')/Titles
  – related entities
• http://.../Catalog/Genres('Adventures')/$links
  /Titles
  – only the links
• http://.../Catalog/Genres('Adventures')/Titles/
  $count
  – count
Queries
• ... /Titles?$filter=AverageRating gt 4
  – filters
• ... /Titles?$orderby=AverageRating
  desc, ReleaseYear asc
  – sorting
• .../Titles?$select=ShortName, ReleaseYear
  – projection
• Paging support:
  $top, $skip, $skiptoken, $inlinecount
oData and WinRT

• Currently, there’s an OData client library
  available
• Requires servers that comply with oData v1-
  v3
• Support for Add Reference since RC
  – Previously we had to use the DataSvcUtil tool to
    generate the proxy
  – Still works if you want complete control over
    the proxy generation
SYNDICATION
Syndication in general
• Real Simple Syndication
• RSS feeds expose information from sites mostly through
  XML
• Feed is a list of syndication entries
   –   Post
   –   Author
   –   Data
   –   Links
   –    Fixed set of elements
• Parsing it is possible
   – Manually (if you like to hurt yourself…)
   – Through a third-party library
Syndication in WinRT

   • WinRT has the Windows.Web.Syndication namespace
       –   Contains SyndicationFeed and SyndicationClient classes
       –   Allows downloading feed asynchronously
       –   Can be provided with credentials if source requires them
       –   Supports
            • Atom 0.3 and 1.0
            • RSS 0.91, 0.92, 1.0 and 2.0)
       – Returns items in an object model
       – Async (Task-based)
var client = new SyndicationClient();
SyndicationFeed feed = await client.RetrieveFeedAsync(“<My RSS Feed>”);
AUTHENTICATING USING THE
WEBAUTHBROKER
The WebAuthBroker class
• The web authentication broker provides a set
  of APIs and the infrastructure for apps to use
  Internet authentication and authorization
  protocols such as Oauth
  – When an app calls the web authentication
    broker, the user gets a dialog box in which the
    necessary webpages are rendered to sign in
  – After the user completes those steps, the dialog
    box goes away and the user continues with the
    app
The WebAuthBroker class
Benefits of the WebAuthBroker
• An easy-to-use programming interface that frees
  the app developer from hosting a browser control
  within their own app
• User credentials that are isolated from the app
• Native support for single sign-on with online
  providers
  –   Twitter
  –   Facebook
  –   Flickr
  –   …
How the WebAuthBroker works

• The web authentication broker is the facilitator
  between your app and authentication
• It consists of a set of APIs, a broker, and a web host.
   – Your app uses the APIs to communicate with the broker.
   – The broker creates a new web host process in a separate
     app container
   – The broker communicates with the app, assembles the UI
     and controls the lifecycle of the web authentication host
   – The web authentication host renders the pages from the
     online provider's website
USING THE LIVE SDK IN YOUR
WINDOWS 8 APPS
Live SDK Integration
• Using the Live SDK, we can, from WinRT apps:
   – Leverage SSO functionality
   – Access data in SkyDrive
   – Integrate with Hotmail/Outlook and Messenger
• Requires the Live SDK 5.0 to be installed on your system
• Application needs to be registered with Windows Live
   – http://manage.dev.live.com/build
   – Only need the package name
• Requires that you are signed in with a Live ID/Microsoft
  account
   – We can log in using a live account or a local account
   – It’s possible to switch between the two
Live SDK Integration
• The device has to be trusted
  – In the screenshot below, this hasn’t been done yet
    
To integrate…
     • We can use some of the built-in controls in the SDK
<live:SignInButton Name="MySignInButton" Scopes="wl.signin wl.basic wl.contacts_create"/>

     • Scope
          – A scope grants a permission level
          – Can be:
              • wl.signin
                   – Single sign-in behavior
              • wl.basic
                   – Read access to a user's basic profile info. Also enables read access to a user's list of
                     contacts
              • wl.contacts_create
                   – Creation of new contacts in the user's address book
              • wl.calendars_update
                   – Read access to a user's personal, preferred, and business email addresses
              • …
              • Complete list at http://msdn.microsoft.com/en-
                us/library/live/hh243646.aspx
Accessing SkyDrive from your apps

• Windows 8 integrates with SkyDrive (cloud)
• Metro Apps can use SkyDrive through the Live
  SDK
  – Enables single sign-on using your Microsoft account
     • Don’t bother the user asking to login with every app
     • App automatically knows who you are
     • Called the easy sign-in
• Users can use the machine with their Microsoft
  account
  – Apps can benefit from this as well using Live SDK
  – User needs to grant permission though (once)
USING ROAMING DATA IN YOUR
APPLICATIONS
Roaming data

• Users can personalize their devices and settings
• Windows and the built-in apps create a “connected” experience
   – Configure once, use everywhere
• Roaming application data makes creating this for us very easy
   – App data can be local, roaming or temporary
   – Roaming will make sure that the data is synced to the cloud and other
     devices where the Microsoft account uses the particular app
Roaming data
• What to place in roaming data?
    – Data that is relevant to the app that created it
        •   Settings
        •   Temporary document
        •   Level in a game
        •   App state
        •   Context
• Data that should not be placed in roaming data
    – Data that can be read/shared with other apps
    – Documents, pictures, exported data
    – Data that should be exported to SkyDrive
• Limit is currently 100k
    – Preserve battery and performance
    – Can be checked using the RoamingStorageQuota class
    – If limit is surpassed, no data will be synced at all
        • It’s vital to only sync URIs instead of full pages
Example of roaming data
    • RSS reader app where the user can save how
      many items he wants to see on his screen
Windows.Storage.ApplicationData.Current.RoamingSettings.Values[“ItemsPerPage”] = 10;

    • If you want to save the last article ID and want
      to create a continuous experience, name the
      setting HighPriority

Windows.Storage.ApplicationData.Current.RoamingSettings.Values[“HighPriority”] =
currentFeedId;
Example of roaming data
    • If more than one setting need to be synced
      together, we can use a CompositeSettingValue
Windows.Storage.ApplicationDataCompositeValue currentFeed =
new Windows.Storage.ApplicationDataCompositeValue();
currentFeed.Insert(“CurrentFeedId”, currentFeedId);
currentFeed.Insert(“CurrentFeedPage”, currentFeedPage);
Windows.Storage.ApplicationData.Current.RoamingSettings.Values[“HighPriority”] =
currentFeed;


    • With the app running, the app can register for the
      DataChanged event on the ApplicationData class
        – Will fire when the application data has changed
Some best practices around roaming
                data
• Only works with a Microsoft account
• The device has to be trusted before roaming data
  will work
• Don’t use it for simultaneous use of applications
  on more than one device at a time
  – Last save wins
• Write often-changing only every now and then
  – Don’t use it to constantly write the location within a
    song
  – Writing too often can result in the device being
    locked-out for a certain amount of time
WORKING WITH SOCKETS
Types of socket communication in
                 WinRT
• StreamSocket - Used to support network communication using a
  TCP stream socket
• StreamSocketListener - Used to support listening for an incoming
  network connection using a TCP stream socket
• DatagramSocket - Used to support network communication using a
  UDP datagram socket
• MessageWebSocket - Used to support network communication that
  allows reading and writing whole messages using a WebSocket
• StreamWebSocket - Used to support network communication that
  allows reading and writing streams using a WebSocket

• All live in the Windows.Networking.Sockets namespace
When and when not to use sockets
Requirement                                       Solution

Connects to a network service that uses an        TCP or UDP sockets
existing protocol (SMTP, POP, IMAP, or MAPI
for mail, for example) that is not directly
supported by other networking features

Connects to another machine on the same           TCP or UDP sockets
local network



Requires a simple requestresponse protocol       Representational State Transfer (REST) APIs
that can communicate through HTTP proxies         that are available using C#, VB.NET, and C++



Requires socket-like semantics (asynchronous,     WebSockets
bi-directional transfers) to connect across the
Web, including through HTTP proxies.
TCP SOCKETS
TCP Sockets
• TCP and UDP can be used to send and receive data in
  WinRT apps
• Based on classes from the
  Windows.Networking.Sockets namespace
   – StreamSocket
   – StreamSocketListener
   – DatagramSocket
• Support for
   – Making client connections
   – Listening for connections
   – Operating as a server, or for both client and server
     operations
TCP Sockets
• Steps to get TCP sockets working in your Metro app
   – Use the StreamSocket class to create a TCP socket
   – ConnectAsync on the StreamSocket class allows making
     a network connection to a TCP network server
   – Streams.DataWriter allows sending data to the server
      • Basically allows writing common types on a stream
   – Streams.DataReader allows reading data from a server
      • Basically allows reading common types from a stream
• StreamSocket object can be configured to use
  SSL/TLS for communications between the client and
  the server.
   – This support for SSL/TLS is limited to using the
     StreamSocket object as the client in the SSL/TLS
     negotiation
Using the StreamSocket
• This class enables network communication using a TCP stream
  socket
• What you can do with the StreamSocket
   – After instantiation of the StreamSocket, get a StreamSocketControl
     object using the Control property
        • Allows setting any properties on the StreamSocketControl object before
          calling one of the ConnectAsync methods
   – Use one of the ConnectAsync methods to establish a connection
     with the remote endpoint
        • Can be configured for use with SSL
   –   Get the OutputStream property to write data to the remote host
   –   Get the InputStream property to read data from the remote host
   –   Read and write data as needed
   –   Call the Close method to abort any pending operations
        • Releases all unmanaged resources associated with the StreamSocket
          object
Using the StreamSocketListener
• This class enables listening for an incoming network connection
  using a TCP stream socket and accepting the connection
• What you can do with the StreamSocketListener
   – After instantiation of the StreamSocketListener, use the Control
     property to retrieve a StreamSocketListenerControl object
       • Can be used to set the socket quality of service
   – Assign the ConnectionReceived event to an event handler
   – Call the BindServiceNameAsync or BindEndpointAsync method to
     bind to a local TCP port or service name
   – After an incoming connection is received, use the
     StreamSocketListenerConnectionReceivedEventArgs object to
     retrieve the Socket property with the StreamSocket object created
   – Use the StreamSocket object to send and receive data
   – Call the Close method to stop listening for and accepting incoming
     network connections
       • Releases all unmanaged resources associated with the
         StreamSocketListener object.
WEBSOCKETS
What’s a WebSocket?
• The WebSocket Protocol defines a mechanism
  for two-way communication between a client
  and a server.
  – To establish a WebSocket connection, a
    specific, HTTP-based handshake is exchanged
    between the client and the server.
  – If successful, the application-layer protocol is
    "upgraded" from HTTP to WebSockets, using the
    previously established TCP connection. Once this
    occurs, HTTP is completely out of the picture
     • Data can be sent or received using the WebSocket
       protocol by either endpoint at any time, until the
       WebSocket connection is closed
  – Only works when the server has a WebSocket
Two types of WebSockets exist

MessageWebSocket                       StreamWebSocket
                                       Suitable for scenarios in which large
Suitable for typical scenarios where
                                       files (such as photos or movies) are
messages are not extremely large
                                       being transferred

Enables notification that an entire Allows sections of a message to be
WebSocket message has been received read with each read operation.

Supports both UTF-8 and binary
                                       Supports only binary messages
messages
SETTING THE CORRECT CAPABILITIES
FOR NETWORK COMMUNICATION
Setting the correct capabilities for
       network communication
• When building apps that need accessing services, we
  need to set the correct capabilities
• Checklist
   – Determine the direction of network access needed by the
     app
      • Outbound client-initiated requests
      • Inbound unsolicited requests
      • A combination of the two
   – Determine the type of network resources that that app will
     communicate with
      • Trusted resources on a Home or Work network
      • An app might need to communicate with resources on the Internet
      • An app might need access to both types of network resources
   – Configure the minimum-required networking isolation
     capabilities in the app manifest
Network capabilities
• Not all apps require access to the network!
   – Only enable the network capabilities for the apps that do!
   – Windows 8 exposes several types of network access
• Network access requests are divided into two categories:
   – Outbound client-initiated requests
       • The app acts as the client and initiates network access
       • The client app sends one or more requests to the server and the
         server sends back a response
   – Inbound unsolicited requests
       • The app acts as a network server and listens for inbound network
         requests from a remote computer
       • The remote computer initiates network access by sending an initial
         request to the app, which acts as server
       • The remote computer sends one or more requests to the
         app, which sends back one or more responses to the remote
         computer
       • An app that functions as a media server
Networking isolation capabilities

Capability                                 Description
                                           Provides outbound access to the Internet and
Internet (Client)                          networks in public places, like airports and
(internetClient in manifest)               coffee shop. Most apps that require Internet
                                           access should use this capability.
                                           Gives the app inbound access from the Internet
                                           and networks in public places like airports and
Internet (Client & Server)                 coffee shops. Inbound access to critical ports
(internetClientServer in manifest)         are always blocked.
                                           The internetClient capability will still need be
                                           declared if outbound connectivity is required.
                                           Gives the app inbound and outbound network
Private Networks (Client & Server)         access at the user's trusted places, like home
(privateNetworkClientServer in manifest)   and work. Inbound access to critical ports are
                                           always blocked.
Some typical use cases of capabilities

Application                                                Description
A Web client that only consumes content. This would
include apps that loads HTML from a website and apps       internetClient
that uses RSS syndication or the AtomPub protocol.
A social network app. This includes an app that
consumes and produces content on a social network          internetClient
site.

A peer to peer (p2p) app. This includes an app that
provide access to instant messenger or chat.
                                                           internetClientServer

An app for sharing in a home or work network. This
includes an app that accesses media or network             privateNetworkClientServer
attached storage (NAS) content.
A line of business app at home or work. This includes an
app that acts as an HTTP client or uses sockets or         privateNetworkClientServer
WebSockets.
A productivity app with networking features at home or
work. This includes a productivity app that accesses       privateNetworkClientServer
network features.
Some typical use cases of capabilities (2)
Application                                                 Description
A game app that requires network access.                    internetClient

A multiplayer internet game app that does
matchmaking.
                                                            internetClient

A multiplayer game app that discovers players with
multicast discovery or using multicast.
                                                            internetClientServer

A multiplayer game app that uses the home or work
network. This includes an app that discovers players with   privateNetworkClientServer
multicast discovery or is discovered using multicast.

A broadcasting app. This includes an app that receives
radio broadcasts over the Internet.
                                                            internetClient
Summary
• Windows 8 supports many types of services
• Most common including WCF, ASMX, oData
  work similarly to Silverlight
• Async/await pattern makes development
  easier
• More complex types including oAuth and
  sockets are pretty easy using WinRT API
• Support for security
THANKS!
Windows 8,
Metro apps
and the outside world
SILVERLIGHTSHOW.NET WEBINARS SERIES
GILL CLEEREN, 15th August 2012
www.snowball.be - gill.cleeren@ordina.be - @gillcleeren

Mais conteĂşdo relacionado

Mais procurados

Server-Side Programming Primer
Server-Side Programming PrimerServer-Side Programming Primer
Server-Side Programming PrimerIvano Malavolta
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using PhpSudheer Satyanarayana
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)Jef Claes
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST Ram Awadh Prasad, PMP
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIPankaj Bajaj
 
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)Sam Bowne
 
Web : Request-Response Lifecycle (Ruby on Rails)
Web : Request-Response Lifecycle (Ruby on Rails)Web : Request-Response Lifecycle (Ruby on Rails)
Web : Request-Response Lifecycle (Ruby on Rails)Rakesh Jha
 
REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)Jef Claes
 
Java web services using JAX-WS
Java web services using JAX-WSJava web services using JAX-WS
Java web services using JAX-WSIndicThreads
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingGera Paulos
 
Rails Request & Middlewares
Rails Request & MiddlewaresRails Request & Middlewares
Rails Request & MiddlewaresSantosh Wadghule
 
Servlet sessions
Servlet sessionsServlet sessions
Servlet sessionsvantinhkhuc
 
Excellent rest using asp.net web api
Excellent rest using asp.net web apiExcellent rest using asp.net web api
Excellent rest using asp.net web apiMaurice De Beijer [MVP]
 
Rest APIs Training
Rest APIs TrainingRest APIs Training
Rest APIs TrainingShekhar Kumar
 
The ASP.NET Web API for Beginners
The ASP.NET Web API for BeginnersThe ASP.NET Web API for Beginners
The ASP.NET Web API for BeginnersKevin Hazzard
 
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Masoud Kalali
 
Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)Andrey Oleynik
 

Mais procurados (20)

Server-Side Programming Primer
Server-Side Programming PrimerServer-Side Programming Primer
Server-Side Programming Primer
 
HTML5 Refresher
HTML5 RefresherHTML5 Refresher
HTML5 Refresher
 
Building Restful Applications Using Php
Building Restful Applications Using PhpBuilding Restful Applications Using Php
Building Restful Applications Using Php
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB API
 
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
 
Web : Request-Response Lifecycle (Ruby on Rails)
Web : Request-Response Lifecycle (Ruby on Rails)Web : Request-Response Lifecycle (Ruby on Rails)
Web : Request-Response Lifecycle (Ruby on Rails)
 
REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)
 
Java web services using JAX-WS
Java web services using JAX-WSJava web services using JAX-WS
Java web services using JAX-WS
 
Remote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programmingRemote Method Invocation, Advanced programming
Remote Method Invocation, Advanced programming
 
Web Services
Web ServicesWeb Services
Web Services
 
Rails Request & Middlewares
Rails Request & MiddlewaresRails Request & Middlewares
Rails Request & Middlewares
 
Servlet sessions
Servlet sessionsServlet sessions
Servlet sessions
 
Excellent rest using asp.net web api
Excellent rest using asp.net web apiExcellent rest using asp.net web api
Excellent rest using asp.net web api
 
Rest APIs Training
Rest APIs TrainingRest APIs Training
Rest APIs Training
 
The ASP.NET Web API for Beginners
The ASP.NET Web API for BeginnersThe ASP.NET Web API for Beginners
The ASP.NET Web API for Beginners
 
OUGF OSGi/Flex
OUGF OSGi/FlexOUGF OSGi/Flex
OUGF OSGi/Flex
 
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
Server Sent Events, Async Servlet, Web Sockets and JSON; born to work together!
 
Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)
 

Destaque

Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Paxcel Technologies
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 
00 JavaScript Part 1 Course - Introduction
00 JavaScript Part 1 Course - Introduction00 JavaScript Part 1 Course - Introduction
00 JavaScript Part 1 Course - IntroductionTommy Vercety
 
Binary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine LearningBinary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine LearningPaxcel Technologies
 
Javascript foundations: variables and types
Javascript foundations: variables and typesJavascript foundations: variables and types
Javascript foundations: variables and typesJohn Hunter
 
01 Introduction - JavaScript Development
01 Introduction - JavaScript Development01 Introduction - JavaScript Development
01 Introduction - JavaScript DevelopmentTommy Vercety
 
02. Data Type and Variables
02. Data Type and Variables02. Data Type and Variables
02. Data Type and VariablesTommy Vercety
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web APIhabib_786
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery FundamentalsDoncho Minkov
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorialAbhi Arya
 
High Performance JavaScript - jQuery Conference SF Bay Area 2010
High Performance JavaScript - jQuery Conference SF Bay Area 2010High Performance JavaScript - jQuery Conference SF Bay Area 2010
High Performance JavaScript - jQuery Conference SF Bay Area 2010Nicholas Zakas
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Peter R. Egli
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonAdnan Masood
 

Destaque (20)

Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1
 
C# 3.5 Features
C# 3.5 FeaturesC# 3.5 Features
C# 3.5 Features
 
Chapter 9 q&p
Chapter 9 q&pChapter 9 q&p
Chapter 9 q&p
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
07. Functions
07. Functions07. Functions
07. Functions
 
08. Objects
08. Objects08. Objects
08. Objects
 
05. Loops
05. Loops05. Loops
05. Loops
 
09. Strings
09. Strings09. Strings
09. Strings
 
00 JavaScript Part 1 Course - Introduction
00 JavaScript Part 1 Course - Introduction00 JavaScript Part 1 Course - Introduction
00 JavaScript Part 1 Course - Introduction
 
06. Arrays
06. Arrays06. Arrays
06. Arrays
 
Binary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine LearningBinary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine Learning
 
Javascript foundations: variables and types
Javascript foundations: variables and typesJavascript foundations: variables and types
Javascript foundations: variables and types
 
01 Introduction - JavaScript Development
01 Introduction - JavaScript Development01 Introduction - JavaScript Development
01 Introduction - JavaScript Development
 
02. Data Type and Variables
02. Data Type and Variables02. Data Type and Variables
02. Data Type and Variables
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
 
High Performance JavaScript - jQuery Conference SF Bay Area 2010
High Performance JavaScript - jQuery Conference SF Bay Area 2010High Performance JavaScript - jQuery Conference SF Bay Area 2010
High Performance JavaScript - jQuery Conference SF Bay Area 2010
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 

Semelhante a Windows 8 Metro apps and the outside world

Web Technologies in Java EE 7
Web Technologies in Java EE 7Web Technologies in Java EE 7
Web Technologies in Java EE 7Lukáš Fryč
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.Andrey Oleynik
 
Collector Web Services
Collector Web ServicesCollector Web Services
Collector Web Servicespublisyst
 
ASP.NET MVC 5 and SignalR 2
ASP.NET MVC 5 and SignalR 2ASP.NET MVC 5 and SignalR 2
ASP.NET MVC 5 and SignalR 2Jaliya Udagedara
 
Basics of the Web Platform
Basics of the Web PlatformBasics of the Web Platform
Basics of the Web PlatformSanjeev Verma, PhD
 
AspNetCore.pptx
AspNetCore.pptxAspNetCore.pptx
AspNetCore.pptxssuserf432e71
 
Evolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecurityEvolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecuritySanjeev Verma, PhD
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
web services-May 25.ppt
web services-May 25.pptweb services-May 25.ppt
web services-May 25.pptShivaangiKrish
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesWebStackAcademy
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteTushar B Kute
 
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database ConnectivityIT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database Connectivitypkaviya
 
AWS as platform for scalable applications
AWS as platform for scalable applicationsAWS as platform for scalable applications
AWS as platform for scalable applicationsRoman Gomolko
 
JAVA Servlets
JAVA ServletsJAVA Servlets
JAVA Servletsdeepak kumar
 
DDD Melbourne 2014 security in ASP.Net Web API 2
DDD Melbourne 2014 security in ASP.Net Web API 2DDD Melbourne 2014 security in ASP.Net Web API 2
DDD Melbourne 2014 security in ASP.Net Web API 2Pratik Khasnabis
 
Welcome to Web Services
Welcome to Web ServicesWelcome to Web Services
Welcome to Web ServicesShivinder Kaur
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with FiddlerIdo Flatow
 

Semelhante a Windows 8 Metro apps and the outside world (20)

Web Technologies in Java EE 7
Web Technologies in Java EE 7Web Technologies in Java EE 7
Web Technologies in Java EE 7
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
 
Collector Web Services
Collector Web ServicesCollector Web Services
Collector Web Services
 
ASP.NET MVC 5 and SignalR 2
ASP.NET MVC 5 and SignalR 2ASP.NET MVC 5 and SignalR 2
ASP.NET MVC 5 and SignalR 2
 
App fabric introduction
App fabric introductionApp fabric introduction
App fabric introduction
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
Basics of the Web Platform
Basics of the Web PlatformBasics of the Web Platform
Basics of the Web Platform
 
Servlets
ServletsServlets
Servlets
 
AspNetCore.pptx
AspNetCore.pptxAspNetCore.pptx
AspNetCore.pptx
 
Evolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecurityEvolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser Security
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
web services-May 25.ppt
web services-May 25.pptweb services-May 25.ppt
web services-May 25.ppt
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
 
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database ConnectivityIT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
 
AWS as platform for scalable applications
AWS as platform for scalable applicationsAWS as platform for scalable applications
AWS as platform for scalable applications
 
JAVA Servlets
JAVA ServletsJAVA Servlets
JAVA Servlets
 
DDD Melbourne 2014 security in ASP.Net Web API 2
DDD Melbourne 2014 security in ASP.Net Web API 2DDD Melbourne 2014 security in ASP.Net Web API 2
DDD Melbourne 2014 security in ASP.Net Web API 2
 
Welcome to Web Services
Welcome to Web ServicesWelcome to Web Services
Welcome to Web Services
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with Fiddler
 

Último

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂşjo
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Windows 8 Metro apps and the outside world

  • 1. Windows 8, Metro apps and the outside world SILVERLIGHTSHOW.NET WEBINARS SERIES GILL CLEEREN, 15th August 2012 www.snowball.be - gill.cleeren@ordina.be - @gillcleeren
  • 2. Agenda • Accessing data behind a service • Working with WCF and ASMX services • Working with REST services • Accessing oData services • Syndication with RSS • Authenticating with Twitter and Facebook using the WebAuthBroker • Using the Live SDK in your Windows 8 apps • Using roaming data in your applications • Working with sockets – TCP sockets – WebSockets • Setting the correct capabilities for network communication
  • 4. Working with services to access data • Service communication is always done asynchronous – In Silverlight, this was done using a callback – In C#5, we got the async/await keywords • Fully supported in Metro/WinRT development • await keyword makes things easier • Doesn’t block UI thread – Doesn’t require the ugly Dispatcher.BeginInvoke(() => …); • Getting data in a Metro application is a 3-step process – Calling the service asynchronous – Receiving and parsing the data – Using the data, for example in a data-binding scenario
  • 5. Working with services to access data • Working with services is preferred in most cases – Relational databases should be behind a service – Local app storage • App has its own storage directory • Can access local file system • Not the focus of this talk!
  • 6. Working with services • Windows 8 supports all kinds of services – ASMX – WCF – REST (JSON or XML) – RSS (later in this talk) – Sockets (much later in this talk) – oData services (you get the drill, it’s also further in this talk…) – No WCF RIA Services support out-of-the-box though (so yes, that is NOT in this talk ) –…
  • 7. WCF AND ASMX SERVICES
  • 8. ASMX services (aka good old webservices) • ASMX services can be accessed without any change • Communication is done asynchronously • SOAP messages can be sent and received over ASMX services • From Visual Studio, use the default way of connecting with a service – Add service reference – Generates proxy • All Task-based! – Use proxy-class with the async/await keywords
  • 9. DEMO ACCESSING AN ASMX SERVICE FROM WINDOWS 8
  • 10. WCF Services • What is supported? – Bindings: • BasicHttpBinding • NetTcpBinding • NetHttpBinding • CustomBinding – Binding elements: • BinaryMessageEncodingBindingElement • TextMessageEncodingBindingElement • ConnectionOrientedTransportBindingElement • SslStreamSecurityBindingElement • WindowsStreamSecurityBindingElement • TcpTransportBindingElement • Http(s)TransportBindingElement • TransportSecurityBindingElement
  • 11. WCF Services • What is supported – Encoding: • Text, Binary – Security modes: • None, Transport, TransportWithMessageCredential, TransportCredentialOnly (for BasicHttpBinding) – ClientCredentialType: • None, Basic, Digest, Negotiate, Ntlm, Windows – Transfer Mode: • Buffered, Streamed, StreamedRequest, and StreamedResponse – Serializers: • DataContractSerializer, DataContractJsonSerializer, XmlSerializer – Miscellaneous: • ChannelFactory • DuplexChannelFactory • CallbackBehavior
  • 12. Things to note when working with WCF (also goes for ASMX) • No XML config file code – Code gets generated in the Reference.cs file • No config edit possible  – Use the partial ConfigureEndpoint method • Only Task-based methods are available – Ensures there are no blocking calls – Is done by default • Specify Internet capability
  • 13. What about security for service communication? • WinRT supports sending credentials • When building service that expects credentials, generated code in Reference.cs will reflect this result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.TransportCredentialOnly; result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.Windows; • https, custom validation are supported to enable TransportWithMessageCredential – Allows safe passing of username/password to service endpoint
  • 14. REST services • No more WebClient, replaced with HttpClient – Works with async – Located in System.Net • HttpClient defines – Get(Async) • Returns an HttpResponseMessage – Put(Async) – Post(Async) – Delete(Async)  RESTful!
  • 15. Parsing the response • XML – Linq-To-XML – XmlReader/XmlWriter – XmlSerializer • JSON: – Use the JsonObject and feed it the returned string • We can use the Parse() method – Throws error if the returned string is faulty or invalid • Also defines GetNamedString(), GetNamedNumber() • Parsing via indexer – Not recommended – DataContractJsonSerializer is also available
  • 16. Credential support with REST services • If REST service requires authentication , WinRT will support it • Some samples: HttpClientHandler handler = new HttpClientHandler(); handler.UseDefaultCredentials = true; HttpClient client = new HttpClient(handler); using (var handler = new HttpClientHandler { Credentials = ... }) using (var client = new HttpClient(handler)) { var result = await client.GetAsync(...); }
  • 17. WORKING WITH ODATA SERVICES
  • 18. What is oData? • Open Data Protocol • Design goals ... – Invent as little as possible – Very low barrier of entry • OData is a RESTful protocol • Builds on HTTP and AtomPub • Defines ... – XML + JSON data representation – Addressing scheme – Query operators – Metadata
  • 19. Sample URIs • http://odata.netflix.com/Catalog/ – AtomPub service document, list of all collections • http://odata.netflix.com/Catalog/Genres – all entries of a collection • http://.../Catalog/Genres('Adventures') – one entry by PK • http://.../Catalog/Genres('Adventures')/Name – one property as XML • http://.../Catalog/Genres('Adventures')/Name/$value – only the value
  • 20. Navigation • http://.../Catalog/Genres('Adventures')/Titles – related entities • http://.../Catalog/Genres('Adventures')/$links /Titles – only the links • http://.../Catalog/Genres('Adventures')/Titles/ $count – count
  • 21. Queries • ... /Titles?$filter=AverageRating gt 4 – filters • ... /Titles?$orderby=AverageRating desc, ReleaseYear asc – sorting • .../Titles?$select=ShortName, ReleaseYear – projection • Paging support: $top, $skip, $skiptoken, $inlinecount
  • 22. oData and WinRT • Currently, there’s an OData client library available • Requires servers that comply with oData v1- v3 • Support for Add Reference since RC – Previously we had to use the DataSvcUtil tool to generate the proxy – Still works if you want complete control over the proxy generation
  • 24. Syndication in general • Real Simple Syndication • RSS feeds expose information from sites mostly through XML • Feed is a list of syndication entries – Post – Author – Data – Links –  Fixed set of elements • Parsing it is possible – Manually (if you like to hurt yourself…) – Through a third-party library
  • 25. Syndication in WinRT • WinRT has the Windows.Web.Syndication namespace – Contains SyndicationFeed and SyndicationClient classes – Allows downloading feed asynchronously – Can be provided with credentials if source requires them – Supports • Atom 0.3 and 1.0 • RSS 0.91, 0.92, 1.0 and 2.0) – Returns items in an object model – Async (Task-based) var client = new SyndicationClient(); SyndicationFeed feed = await client.RetrieveFeedAsync(“<My RSS Feed>”);
  • 27. The WebAuthBroker class • The web authentication broker provides a set of APIs and the infrastructure for apps to use Internet authentication and authorization protocols such as Oauth – When an app calls the web authentication broker, the user gets a dialog box in which the necessary webpages are rendered to sign in – After the user completes those steps, the dialog box goes away and the user continues with the app
  • 29. Benefits of the WebAuthBroker • An easy-to-use programming interface that frees the app developer from hosting a browser control within their own app • User credentials that are isolated from the app • Native support for single sign-on with online providers – Twitter – Facebook – Flickr – …
  • 30. How the WebAuthBroker works • The web authentication broker is the facilitator between your app and authentication • It consists of a set of APIs, a broker, and a web host. – Your app uses the APIs to communicate with the broker. – The broker creates a new web host process in a separate app container – The broker communicates with the app, assembles the UI and controls the lifecycle of the web authentication host – The web authentication host renders the pages from the online provider's website
  • 31. USING THE LIVE SDK IN YOUR WINDOWS 8 APPS
  • 32. Live SDK Integration • Using the Live SDK, we can, from WinRT apps: – Leverage SSO functionality – Access data in SkyDrive – Integrate with Hotmail/Outlook and Messenger • Requires the Live SDK 5.0 to be installed on your system • Application needs to be registered with Windows Live – http://manage.dev.live.com/build – Only need the package name • Requires that you are signed in with a Live ID/Microsoft account – We can log in using a live account or a local account – It’s possible to switch between the two
  • 33. Live SDK Integration • The device has to be trusted – In the screenshot below, this hasn’t been done yet 
  • 34. To integrate… • We can use some of the built-in controls in the SDK <live:SignInButton Name="MySignInButton" Scopes="wl.signin wl.basic wl.contacts_create"/> • Scope – A scope grants a permission level – Can be: • wl.signin – Single sign-in behavior • wl.basic – Read access to a user's basic profile info. Also enables read access to a user's list of contacts • wl.contacts_create – Creation of new contacts in the user's address book • wl.calendars_update – Read access to a user's personal, preferred, and business email addresses • … • Complete list at http://msdn.microsoft.com/en- us/library/live/hh243646.aspx
  • 35. Accessing SkyDrive from your apps • Windows 8 integrates with SkyDrive (cloud) • Metro Apps can use SkyDrive through the Live SDK – Enables single sign-on using your Microsoft account • Don’t bother the user asking to login with every app • App automatically knows who you are • Called the easy sign-in • Users can use the machine with their Microsoft account – Apps can benefit from this as well using Live SDK – User needs to grant permission though (once)
  • 36. USING ROAMING DATA IN YOUR APPLICATIONS
  • 37. Roaming data • Users can personalize their devices and settings • Windows and the built-in apps create a “connected” experience – Configure once, use everywhere • Roaming application data makes creating this for us very easy – App data can be local, roaming or temporary – Roaming will make sure that the data is synced to the cloud and other devices where the Microsoft account uses the particular app
  • 38. Roaming data • What to place in roaming data? – Data that is relevant to the app that created it • Settings • Temporary document • Level in a game • App state • Context • Data that should not be placed in roaming data – Data that can be read/shared with other apps – Documents, pictures, exported data – Data that should be exported to SkyDrive • Limit is currently 100k – Preserve battery and performance – Can be checked using the RoamingStorageQuota class – If limit is surpassed, no data will be synced at all • It’s vital to only sync URIs instead of full pages
  • 39. Example of roaming data • RSS reader app where the user can save how many items he wants to see on his screen Windows.Storage.ApplicationData.Current.RoamingSettings.Values[“ItemsPerPage”] = 10; • If you want to save the last article ID and want to create a continuous experience, name the setting HighPriority Windows.Storage.ApplicationData.Current.RoamingSettings.Values[“HighPriority”] = currentFeedId;
  • 40. Example of roaming data • If more than one setting need to be synced together, we can use a CompositeSettingValue Windows.Storage.ApplicationDataCompositeValue currentFeed = new Windows.Storage.ApplicationDataCompositeValue(); currentFeed.Insert(“CurrentFeedId”, currentFeedId); currentFeed.Insert(“CurrentFeedPage”, currentFeedPage); Windows.Storage.ApplicationData.Current.RoamingSettings.Values[“HighPriority”] = currentFeed; • With the app running, the app can register for the DataChanged event on the ApplicationData class – Will fire when the application data has changed
  • 41. Some best practices around roaming data • Only works with a Microsoft account • The device has to be trusted before roaming data will work • Don’t use it for simultaneous use of applications on more than one device at a time – Last save wins • Write often-changing only every now and then – Don’t use it to constantly write the location within a song – Writing too often can result in the device being locked-out for a certain amount of time
  • 43. Types of socket communication in WinRT • StreamSocket - Used to support network communication using a TCP stream socket • StreamSocketListener - Used to support listening for an incoming network connection using a TCP stream socket • DatagramSocket - Used to support network communication using a UDP datagram socket • MessageWebSocket - Used to support network communication that allows reading and writing whole messages using a WebSocket • StreamWebSocket - Used to support network communication that allows reading and writing streams using a WebSocket • All live in the Windows.Networking.Sockets namespace
  • 44. When and when not to use sockets Requirement Solution Connects to a network service that uses an TCP or UDP sockets existing protocol (SMTP, POP, IMAP, or MAPI for mail, for example) that is not directly supported by other networking features Connects to another machine on the same TCP or UDP sockets local network Requires a simple requestresponse protocol Representational State Transfer (REST) APIs that can communicate through HTTP proxies that are available using C#, VB.NET, and C++ Requires socket-like semantics (asynchronous, WebSockets bi-directional transfers) to connect across the Web, including through HTTP proxies.
  • 46. TCP Sockets • TCP and UDP can be used to send and receive data in WinRT apps • Based on classes from the Windows.Networking.Sockets namespace – StreamSocket – StreamSocketListener – DatagramSocket • Support for – Making client connections – Listening for connections – Operating as a server, or for both client and server operations
  • 47. TCP Sockets • Steps to get TCP sockets working in your Metro app – Use the StreamSocket class to create a TCP socket – ConnectAsync on the StreamSocket class allows making a network connection to a TCP network server – Streams.DataWriter allows sending data to the server • Basically allows writing common types on a stream – Streams.DataReader allows reading data from a server • Basically allows reading common types from a stream • StreamSocket object can be configured to use SSL/TLS for communications between the client and the server. – This support for SSL/TLS is limited to using the StreamSocket object as the client in the SSL/TLS negotiation
  • 48. Using the StreamSocket • This class enables network communication using a TCP stream socket • What you can do with the StreamSocket – After instantiation of the StreamSocket, get a StreamSocketControl object using the Control property • Allows setting any properties on the StreamSocketControl object before calling one of the ConnectAsync methods – Use one of the ConnectAsync methods to establish a connection with the remote endpoint • Can be configured for use with SSL – Get the OutputStream property to write data to the remote host – Get the InputStream property to read data from the remote host – Read and write data as needed – Call the Close method to abort any pending operations • Releases all unmanaged resources associated with the StreamSocket object
  • 49. Using the StreamSocketListener • This class enables listening for an incoming network connection using a TCP stream socket and accepting the connection • What you can do with the StreamSocketListener – After instantiation of the StreamSocketListener, use the Control property to retrieve a StreamSocketListenerControl object • Can be used to set the socket quality of service – Assign the ConnectionReceived event to an event handler – Call the BindServiceNameAsync or BindEndpointAsync method to bind to a local TCP port or service name – After an incoming connection is received, use the StreamSocketListenerConnectionReceivedEventArgs object to retrieve the Socket property with the StreamSocket object created – Use the StreamSocket object to send and receive data – Call the Close method to stop listening for and accepting incoming network connections • Releases all unmanaged resources associated with the StreamSocketListener object.
  • 51. What’s a WebSocket? • The WebSocket Protocol defines a mechanism for two-way communication between a client and a server. – To establish a WebSocket connection, a specific, HTTP-based handshake is exchanged between the client and the server. – If successful, the application-layer protocol is "upgraded" from HTTP to WebSockets, using the previously established TCP connection. Once this occurs, HTTP is completely out of the picture • Data can be sent or received using the WebSocket protocol by either endpoint at any time, until the WebSocket connection is closed – Only works when the server has a WebSocket
  • 52. Two types of WebSockets exist MessageWebSocket StreamWebSocket Suitable for scenarios in which large Suitable for typical scenarios where files (such as photos or movies) are messages are not extremely large being transferred Enables notification that an entire Allows sections of a message to be WebSocket message has been received read with each read operation. Supports both UTF-8 and binary Supports only binary messages messages
  • 53. SETTING THE CORRECT CAPABILITIES FOR NETWORK COMMUNICATION
  • 54. Setting the correct capabilities for network communication • When building apps that need accessing services, we need to set the correct capabilities • Checklist – Determine the direction of network access needed by the app • Outbound client-initiated requests • Inbound unsolicited requests • A combination of the two – Determine the type of network resources that that app will communicate with • Trusted resources on a Home or Work network • An app might need to communicate with resources on the Internet • An app might need access to both types of network resources – Configure the minimum-required networking isolation capabilities in the app manifest
  • 55. Network capabilities • Not all apps require access to the network! – Only enable the network capabilities for the apps that do! – Windows 8 exposes several types of network access • Network access requests are divided into two categories: – Outbound client-initiated requests • The app acts as the client and initiates network access • The client app sends one or more requests to the server and the server sends back a response – Inbound unsolicited requests • The app acts as a network server and listens for inbound network requests from a remote computer • The remote computer initiates network access by sending an initial request to the app, which acts as server • The remote computer sends one or more requests to the app, which sends back one or more responses to the remote computer • An app that functions as a media server
  • 56. Networking isolation capabilities Capability Description Provides outbound access to the Internet and Internet (Client) networks in public places, like airports and (internetClient in manifest) coffee shop. Most apps that require Internet access should use this capability. Gives the app inbound access from the Internet and networks in public places like airports and Internet (Client & Server) coffee shops. Inbound access to critical ports (internetClientServer in manifest) are always blocked. The internetClient capability will still need be declared if outbound connectivity is required. Gives the app inbound and outbound network Private Networks (Client & Server) access at the user's trusted places, like home (privateNetworkClientServer in manifest) and work. Inbound access to critical ports are always blocked.
  • 57. Some typical use cases of capabilities Application Description A Web client that only consumes content. This would include apps that loads HTML from a website and apps internetClient that uses RSS syndication or the AtomPub protocol. A social network app. This includes an app that consumes and produces content on a social network internetClient site. A peer to peer (p2p) app. This includes an app that provide access to instant messenger or chat. internetClientServer An app for sharing in a home or work network. This includes an app that accesses media or network privateNetworkClientServer attached storage (NAS) content. A line of business app at home or work. This includes an app that acts as an HTTP client or uses sockets or privateNetworkClientServer WebSockets. A productivity app with networking features at home or work. This includes a productivity app that accesses privateNetworkClientServer network features.
  • 58. Some typical use cases of capabilities (2) Application Description A game app that requires network access. internetClient A multiplayer internet game app that does matchmaking. internetClient A multiplayer game app that discovers players with multicast discovery or using multicast. internetClientServer A multiplayer game app that uses the home or work network. This includes an app that discovers players with privateNetworkClientServer multicast discovery or is discovered using multicast. A broadcasting app. This includes an app that receives radio broadcasts over the Internet. internetClient
  • 59. Summary • Windows 8 supports many types of services • Most common including WCF, ASMX, oData work similarly to Silverlight • Async/await pattern makes development easier • More complex types including oAuth and sockets are pretty easy using WinRT API • Support for security
  • 61. Windows 8, Metro apps and the outside world SILVERLIGHTSHOW.NET WEBINARS SERIES GILL CLEEREN, 15th August 2012 www.snowball.be - gill.cleeren@ordina.be - @gillcleeren