SlideShare uma empresa Scribd logo
1 de 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/

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Ú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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
#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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Ú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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
#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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

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/