SlideShare a Scribd company logo
1 of 29
Mariano O. Rodriguez
Agenda
 Introducción
 Contratos
 Binding
 Behaviors
 REST
 Nuevo en WCF4
ABC de WCF
 Address (Donde)
 Binding (Como)
 Contract (Que)
WCF Channel Layer
       Cliente              Servicio

  Protocol Channel 1   Protocol Channel 1

  Protocol Channel 2   Protocol Channel 2

  Protocol Channel N   Protocol Channel N

       Encoder              Encoder

      Transport            Transport
Contratos
Contratos
                  Describe las operaciones que el servicio
    Servicio
                    realiza. Mapea tipos CLR (WSDL).


               Describe la estructura de datos. Mapea tipos
     Datos
                                CLR (XSD).


               Define la estructura del mensaje. Mapea tipos
    Mensaje
                            CLR (SOAP message)
Service Contract
[ServiceContract]
public interface ICalculator
{
    [OperationContract]
    ComplexProblem Do(ComplexProblem p);
}
Service Contract: OneWay
[ServiceContract]
public interface IOneWayCalculator
{
    [OperationContract(IsOneWay=true)]
    void Do(ComplexProblem p);
}
Service Contract: Duplex
[ServiceContract(
      CallbackContract=typeof(ICalculatorResults)]
public interface ICalculatorProblems
{
    [OperationContract(IsOneWay=true)]
    void SolveProblem (ComplexProblem p);
}

public interface ICalculatorResults
{
    [OperationContract(IsOneWay=true)]
    void Results(ComplexProblem p);
}
Service Contracts: Faults
[ServiceContract]
public interface ICalculator
{
    [OperationContract]
    [FaultContract(typeof(DivideByZeroException))]
    ComplexProblem Do(ComplexProblem p);
}

try {
    return n1 / n2;
}
catch (DivideByZeroException e) {
    var f = new DivideByZeroException(“Calc Failure”);
    throw new FaultException<DivideByZeroException>(f);
}
Data Contract
[DataContract]
public class ComplexNumber
{
    [DataMember]
    public double Real;

    [DataMember]
    public double Imaginary { get; set; }
}
Message Contract
[MessageContract]
public class ComplexProblem
{
    [MessageHeader]
    public string Operation { get; set;}
    [MessageBody]
    public ComplexNumber Op1 { get; set; }
    [MessageBody]
    public ComplexNumber Op2 { get; set; }
}
Bindings
Standard Bindings
Name                      Transport    Encoding
BasicHttpBinding          HTTP/HTTPS   Text/MTOM
NetTcpBinding             TCP          Binary
NetPeerTcpBinding         P2P          Binary
NetNamedPipeBinding       IPC          Binary
WSHttpBinding             HTTP/HTTPS   Text/MTOM
WSFederationHttpBinding   HTTP/HTTPS   Text/MTOM
WSDualHttpBinding         HTTP/HTTPS   Text/MTOM
NetMsmqBinding            MSMQ         Binary
MsmqIntegrationBinding    MSMQ         Binary
WebHttpBinding            HTTP/HTTPS   Text/Binary
Binding en Configuracion
<system.serviceModel>
  <services>
    <service name="CalculatorService">
      <endpoint address=“http://localhost/calculator"
                  binding="basicHttpBinding"
                  contractType="ICalculator" />
    </service>
  </services>
</system.serviceModel>
Custom Bindings
<bindings>
    <customBinding>
        <binding configurationName="Binding1">
            <reliableSession bufferedMessagesQuota="32"
                   inactivityTimeout="00:10:00"
                   maxRetryCount="8"
                   ordered="true" />
            <httpsTransport manualAddressing="false"
                   maxMessageSize="65536"
                   hostNameComparisonMode="StrongWildcard"/>
            <textMessageEncoding maxReadPoolSize="64"
                   maxWritePoolSize="16"
                   messageVersion="Default"
                   writeEncoding="utf-8" />
        </binding>
    </customBinding>
</bindings>
Behaviors
Behaviors Overview
 Implementan semántica del sistema
    Para el desarrollador
       Concurrencia
       Instanciación
       Transacciones
       Impersonation
   Para operaciones
       Throttling
       Metadata
Instanciación
 Per Call
 Singleton
 Session
Throttling
<behaviors>
  <behavior configurationName="CalculatorBehavior" >
    <serviceThrottling maxConcurrentCalls="10"
                maxConnections="10"
                maxInstances="10"
                maxPendingOperations="10" />
  </behavior>
</behaviors>
REST
 Acrónimo de REpresentational State Transfer
 Es un estilo de arquitectura
    Mejor uso de HTTP
    Menor complejidad
    Interoperable
Principios de REST
 Identificar recursos por medio de URIs
 Uso de verbos HTTP
 Link resources
 Presentación en múltiples formatos (JSON/POX)
 Comunicación Stateless
Identifica recursos con URIs

http://myservice/rooms
http://myservice/rooms(3)
http://myservice/Colors(red)
http://myservice/Transactions(1145001)
Verbos HTTP usados
 Get: obtiene la representación de un recurso
 Put: actualiza un recurso
 Post: crea un nuevo recurso
 Delete: elimina un recurso
Link Resources
<order self=’http://example.com/orders(1234)’>
  <amount>23</amount>
  <product
  ref=’http://example.com/products(4554)’ />
  <customer
  ref=’http://example.com/customers(1234)’ />
</order>
REST en WCF
REST en WCF
 Basado en nuevos atributos
    WebGet (Get)
    WebInvoke (Post/Put/Delete)
 Permite definir el tipo de Serializacion
    JSON
    XML
 Soporte de streaming retornando un Stream
Nuevo en WCF 4
   Simplificación de configuración
   Activación en IIS (.svc opcional)
   Soporte de WS-Discovery (udp based)
   Soporte de Router
     Bridging
     Routing por contenido
 Mejoras para REST
   Pagina de ayuda
   Integración con rutas de MVC
   Caching
Referencias
 A Guide to Designing and Building RESTful Web
  Services with WCF 3.5
    http://msdn.microsoft.com/en-us/library/dd203052.aspx
 WCF REST Starter Kit
    http://aspnet.codeplex.com/releases/view/24644
 Windows Server AppFabric Training Kit
    http://www.microsoft.com/download/en/details.aspx?id=7956
 OData
    http://www.odata.org/

More Related Content

Similar to WCF 4 Overview

A presentation on WCF & REST
A presentation on WCF & RESTA presentation on WCF & REST
A presentation on WCF & RESTSanthu Rao
 
10 Tricks and Tips for WCF
10 Tricks and Tips for WCF10 Tricks and Tips for WCF
10 Tricks and Tips for WCFBarry Dorrans
 
introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationredaxe12
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorialAbhi Arya
 
Web service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National WokshopWeb service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National WokshopNishikant Taksande
 
Web services in java
Web services in javaWeb services in java
Web services in javamaabujji
 
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...Chris Richardson
 
Windows Communication Foundation
Windows Communication FoundationWindows Communication Foundation
Windows Communication FoundationMahmoud Tolba
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaJignesh Aakoliya
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)ipower softwares
 
WCF from the web developer
WCF from the web developerWCF from the web developer
WCF from the web developerFlorin Cardasim
 

Similar to WCF 4 Overview (20)

A presentation on WCF & REST
A presentation on WCF & RESTA presentation on WCF & REST
A presentation on WCF & REST
 
WCF
WCFWCF
WCF
 
Web services
Web servicesWeb services
Web services
 
10 Tricks and Tips for WCF
10 Tricks and Tips for WCF10 Tricks and Tips for WCF
10 Tricks and Tips for WCF
 
introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundation
 
Steps india technologies
Steps india technologiesSteps india technologies
Steps india technologies
 
Steps india technologies .com
Steps india technologies .comSteps india technologies .com
Steps india technologies .com
 
WCF Fundamentals
WCF Fundamentals WCF Fundamentals
WCF Fundamentals
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
 
WCF for begineers
WCF  for begineersWCF  for begineers
WCF for begineers
 
WebSockets in JEE 7
WebSockets in JEE 7WebSockets in JEE 7
WebSockets in JEE 7
 
Web service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National WokshopWeb service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National Wokshop
 
Web services in java
Web services in javaWeb services in java
Web services in java
 
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
Decompose That WAR! Architecting for Adaptability, Scalability, and Deployabi...
 
Windows Communication Foundation
Windows Communication FoundationWindows Communication Foundation
Windows Communication Foundation
 
Wcf faq
Wcf faqWcf faq
Wcf faq
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company india
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)
 
WCF from the web developer
WCF from the web developerWCF from the web developer
WCF from the web developer
 
Wcf for the web developer
Wcf for the web developerWcf for the web developer
Wcf for the web developer
 

Recently uploaded

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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

WCF 4 Overview

  • 2. Agenda  Introducción  Contratos  Binding  Behaviors  REST  Nuevo en WCF4
  • 3. ABC de WCF  Address (Donde)  Binding (Como)  Contract (Que)
  • 4. WCF Channel Layer Cliente Servicio Protocol Channel 1 Protocol Channel 1 Protocol Channel 2 Protocol Channel 2 Protocol Channel N Protocol Channel N Encoder Encoder Transport Transport
  • 6. Contratos Describe las operaciones que el servicio Servicio realiza. Mapea tipos CLR (WSDL). Describe la estructura de datos. Mapea tipos Datos CLR (XSD). Define la estructura del mensaje. Mapea tipos Mensaje CLR (SOAP message)
  • 7. Service Contract [ServiceContract] public interface ICalculator { [OperationContract] ComplexProblem Do(ComplexProblem p); }
  • 8. Service Contract: OneWay [ServiceContract] public interface IOneWayCalculator { [OperationContract(IsOneWay=true)] void Do(ComplexProblem p); }
  • 9. Service Contract: Duplex [ServiceContract( CallbackContract=typeof(ICalculatorResults)] public interface ICalculatorProblems { [OperationContract(IsOneWay=true)] void SolveProblem (ComplexProblem p); } public interface ICalculatorResults { [OperationContract(IsOneWay=true)] void Results(ComplexProblem p); }
  • 10. Service Contracts: Faults [ServiceContract] public interface ICalculator { [OperationContract] [FaultContract(typeof(DivideByZeroException))] ComplexProblem Do(ComplexProblem p); } try { return n1 / n2; } catch (DivideByZeroException e) { var f = new DivideByZeroException(“Calc Failure”); throw new FaultException<DivideByZeroException>(f); }
  • 11. Data Contract [DataContract] public class ComplexNumber { [DataMember] public double Real; [DataMember] public double Imaginary { get; set; } }
  • 12. Message Contract [MessageContract] public class ComplexProblem { [MessageHeader] public string Operation { get; set;} [MessageBody] public ComplexNumber Op1 { get; set; } [MessageBody] public ComplexNumber Op2 { get; set; } }
  • 14. Standard Bindings Name Transport Encoding BasicHttpBinding HTTP/HTTPS Text/MTOM NetTcpBinding TCP Binary NetPeerTcpBinding P2P Binary NetNamedPipeBinding IPC Binary WSHttpBinding HTTP/HTTPS Text/MTOM WSFederationHttpBinding HTTP/HTTPS Text/MTOM WSDualHttpBinding HTTP/HTTPS Text/MTOM NetMsmqBinding MSMQ Binary MsmqIntegrationBinding MSMQ Binary WebHttpBinding HTTP/HTTPS Text/Binary
  • 15. Binding en Configuracion <system.serviceModel> <services> <service name="CalculatorService"> <endpoint address=“http://localhost/calculator" binding="basicHttpBinding" contractType="ICalculator" /> </service> </services> </system.serviceModel>
  • 16. Custom Bindings <bindings> <customBinding> <binding configurationName="Binding1"> <reliableSession bufferedMessagesQuota="32" inactivityTimeout="00:10:00" maxRetryCount="8" ordered="true" /> <httpsTransport manualAddressing="false" maxMessageSize="65536" hostNameComparisonMode="StrongWildcard"/> <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Default" writeEncoding="utf-8" /> </binding> </customBinding> </bindings>
  • 18. Behaviors Overview  Implementan semántica del sistema  Para el desarrollador  Concurrencia  Instanciación  Transacciones  Impersonation  Para operaciones  Throttling  Metadata
  • 19. Instanciación  Per Call  Singleton  Session
  • 20. Throttling <behaviors> <behavior configurationName="CalculatorBehavior" > <serviceThrottling maxConcurrentCalls="10" maxConnections="10" maxInstances="10" maxPendingOperations="10" /> </behavior> </behaviors>
  • 21. REST  Acrónimo de REpresentational State Transfer  Es un estilo de arquitectura  Mejor uso de HTTP  Menor complejidad  Interoperable
  • 22. Principios de REST  Identificar recursos por medio de URIs  Uso de verbos HTTP  Link resources  Presentación en múltiples formatos (JSON/POX)  Comunicación Stateless
  • 23. Identifica recursos con URIs http://myservice/rooms http://myservice/rooms(3) http://myservice/Colors(red) http://myservice/Transactions(1145001)
  • 24. Verbos HTTP usados  Get: obtiene la representación de un recurso  Put: actualiza un recurso  Post: crea un nuevo recurso  Delete: elimina un recurso
  • 25. Link Resources <order self=’http://example.com/orders(1234)’> <amount>23</amount> <product ref=’http://example.com/products(4554)’ /> <customer ref=’http://example.com/customers(1234)’ /> </order>
  • 27. REST en WCF  Basado en nuevos atributos  WebGet (Get)  WebInvoke (Post/Put/Delete)  Permite definir el tipo de Serializacion  JSON  XML  Soporte de streaming retornando un Stream
  • 28. Nuevo en WCF 4  Simplificación de configuración  Activación en IIS (.svc opcional)  Soporte de WS-Discovery (udp based)  Soporte de Router  Bridging  Routing por contenido  Mejoras para REST  Pagina de ayuda  Integración con rutas de MVC  Caching
  • 29. Referencias  A Guide to Designing and Building RESTful Web Services with WCF 3.5  http://msdn.microsoft.com/en-us/library/dd203052.aspx  WCF REST Starter Kit  http://aspnet.codeplex.com/releases/view/24644  Windows Server AppFabric Training Kit  http://www.microsoft.com/download/en/details.aspx?id=7956  OData  http://www.odata.org/