![Page 1: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/1.jpg)
Desenvolvimento com Windows Communication Foundation (WCF)
Henrry Pires
http://netponto.org21ª Reunião Lisboa – 18/06/2011
![Page 2: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/2.jpg)
Patrocinadores desta reunião
![Page 3: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/3.jpg)
Henrry Pires
11 anos de experiência profissional em TI
Há 9 anos a programar na plataforma .NET
![Page 4: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/4.jpg)
Agenda
• Tracing
• Segurança
• Tratamento de Erros
![Page 5: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/5.jpg)
Também disponível em vídeo...
Assista!http://vimeo.com/25902708
![Page 6: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/6.jpg)
Tracing
![Page 7: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/7.jpg)
TracingBasicamente queremos fazer tracing serve-nos para obter informações do estado daaplicação. Quando a app arranca, quandodeterminados processos são executados,erros entre outros. Seja qual for a informaçãodisponibilizada, o interesse é sempre omesmo: a app tem informação importantepara disponibilizar
![Page 8: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/8.jpg)
Tracing
Tracing LevelsTrace level Description
Off Does not allow any events through.
Critical Allows only Critical events through.
Error Allows Critical and Error events through.
Warning Allows Critical, Error, and Warning events through.
Information Allows Critical, Error, Warning, and Information events through.
Verbose Allows Critical, Error, Warning, Information, and Verbose events through.
ActivityTracing Allows the Stop, Start, Suspend, Transfer, and Resume events through.
All Allows all events through.
![Page 9: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/9.jpg)
Tracing
Tracing Assembly Assembly Name Description
System.ServiceModel
The most active (from a tracing perspective) of the assemblies. All the stages in the WCF message process are logged, including reading configuration information, performing transport-level actions, and processing
security requests.
System.ServiceModel .MessageLogging
Generates tracing information for all the messages that flow through the system.
System.ServiceModel .IdentityModel
Generates trace data related to the authentication and authorization mechanism used within WCF.
System.Runtime
.Serialization
Provides tracing information when objects are serialized or deserialized. Because this activity occurs quite often in WCF, this set of tracing
information is useful for seeing some of the raw content associated with
messages.
System.IO.Log Generates trace messages associated with accessing the interface to the Common Log File System (CLFS).
CardSpace Generates trace messages related to any CardSpace identity processing
that occurs within the context of a WCF application. System.ServiceModel
.Activation Creates traces related to the activation of the service portion of a WCF
communication channel.
![Page 10: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/10.jpg)
Tracing
![Page 11: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/11.jpg)
Segurança
![Page 12: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/12.jpg)
Segurança
• Infra-estrutura
• A nível de utilizador
![Page 13: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/13.jpg)
Segurança
• Infra-estrutura
– Transporte
– Mensagem
– Transporte com Credencias de Mensagem
![Page 14: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/14.jpg)
Segurança
• A nível de utilizador–Windows Authentication
–Utilizador e password
–Certificados digitais
![Page 15: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/15.jpg)
Segurança
• Transporte
– HTTPS
– TCP/IP
– MSMQ
![Page 16: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/16.jpg)
Segurança
• Mensagem
– Certificados
– IssuedToken
– Utilizador
– Windows
![Page 17: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/17.jpg)
Segurança
• DiferençasMensaguem Transporte
Leva consigo as credenciais Usa o sistema handshaking ou recursos externos para validar a Mensagem
A Mensagem está sempre encriptada Só está encriptada entre os end points
Encriptação parcial, total ou mesmo vários tipos de encriptação dentro da mesmaMensagem
A Mensagem é encriptada na sua totalidade com um único sistema
![Page 18: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/18.jpg)
Segurança
A nível de utilizador
Nem todos os tipos de autenticação sãoválidos para todos os Bindings, exemplodisso é o basicHTTPBinding que só suportacertificados e Utilizador e Password
![Page 19: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/19.jpg)
Segurança
• Certificado
Este método permite através de umcertificado digital autenticar tanto ocliente como o servidor. Todos osoutros métodos usam certificadospara fazer a comunicação
![Page 20: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/20.jpg)
Segurança
Passos necessários para usar o certificado
![Page 21: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/21.jpg)
Segurança
1. Identificar a store (storeName)AddressBook AuthRoot CertificateAuthority Disallowed
My Root TrustedPeople TrustedPublisher
![Page 22: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/22.jpg)
Segurança
2. Localização da store (storeLocation)
CurrentUser
LocalMachine
![Page 23: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/23.jpg)
Segurança
3. Tipo de pesquisa (x509FindType)
FindByThumbprint FindBySubjectName FindBySubjectDistinguishedName
FindByIssuerName
FindBySerialNumber FindByTimeNotYetValid FindByIssuerDistinguishedName
FindByTimeValid
FindByTemplateName FindByCertificatePolicy FindByApplicationPolicy FindByTimeExpired
FindByExtension FindByKeyUsage FindBySubjectKeyIdentifier
![Page 24: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/24.jpg)
Segurança
3. Valor a pesquisar (findValue)
<certificateReferencefindValue="545c9b8e97d91fc75c74eb52c6908320088b4f39"x509FindType="FindByThumbprint"storeLocation="LocalMachine"storeName="My" />
![Page 25: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/25.jpg)
Segurança
![Page 26: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/26.jpg)
Questões?
![Page 27: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/27.jpg)
Patrocinadores desta reunião
![Page 28: Desenvolvimento com Windows Communication Foundation (WCF)](https://reader035.vdocuments.pub/reader035/viewer/2022081801/559c1d2d1a28abc7298b457e/html5/thumbnails/28.jpg)
Próximas reuniões presenciais
• 18/06/2011 – Junho
• 09/07/2011 – Julho (Coimbra)
• 23/07/2011 – Julho
• 27/08/2011 – Agosto
Reserva estes dias na agenda! :)