SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
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/

Contenu connexe

Similaire à 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
 

Similaire à 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
 

Dernier

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 

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/