SlideShare a Scribd company logo
1 of 51
Bruno Terkaly | Technical Evangelist 
Bret Stateham | Technical Evangelist
Meet Bruno Terkaly | @BrunoTerkaly 
• Monthly Columnist MSDN Magazine 
• Expertise in Windows Azure / Windows 8 
• Principal Technical Evangelist – Silicon Valley 
• Find him on the web at blogs.msdn.com/brunoterkaly
Meet BretStateham | @BretStateham 
• Find me on the Web at BretStateham.com 
• Working with the web since before IIS 
• Working with .NET since before .NET 
• In love with SQL Server (don’t tell my wife)
Course Topics 
Developing SharePoint Server Core Solutions Jump Start 
01 | WCF Services 05 | Entity Framework 
02 | Hosting Services in Windows Azure 06 | Web API 
03 | Data Storage 07 | Advanced WCF Topics 
04 | Data Access Technologies
Setting Expectations 
• Target Audience 
– Developers looking to host WCF or Web API services in Windows 
Azure, with data stored in Azure Storage or Azure SQL Database 
– Considering taking the 70-487 Exam 
• Additional Material 
– Microsoft Official Course 20487 
• Developing Windows Azure and Web Services
Join the MVA Community! 
• Microsoft Virtual Academy 
– Free online learning tailored for IT Pros and Developers 
– Over 1M registered users 
– Up-to-date, relevant training on variety of Microsoft products 
• “Earn while you learn!” 
– Get 50 MVA Points for this event! 
– Visit http://aka.ms/MVA-Voucher 
– Enter this code: AzWebSvc (expires 12/13/2013)
01 | WCF Services 
Bret Stateham | Technical Evangelist 
Bruno Terkaly | Technical Evangelist
Course Introduction
Module Overview 
• WCF Overview 
• Configuring Services 
• Consuming Services 
• Hosting WCF Services
WCF Overview
Windows Communication Foundation (WCF) 
The Windows Communication Foundation 
(or WCF) is a runtime and a set of APIs in 
the .NET Framework for building 
connected, service-oriented applications.
Windows Communication Foundation (WCF) 
Common Tasks For A Web Service
Windows Communication Foundation (WCF) 
Customer Web Service 
Customer Databases 
Customer Web Service 
Demo Scenarios 
Other Web Service 
Incident Client UX
Windows Communication Foundation (WCF) 
Messages are typically sent in text 
encoded SOAP messages using is the 
HyperText Transfer Protocol (HTTP) 
SOAP, originally defined as Simple Object Access Protocol, is a 
protocol specification for exchanging structured information in 
the implementation of Web Services in computer networks. 
It relies on XML Information Set for its message format.
Windows Communication Foundation (WCF) 
SOAP calls REST calls 
REST is an abbreviation for: 
Representational State Transfer
Windows Communication Foundation (WCF) 
But REST is coming along….
Windows Communication Foundation (WCF) 
Advantages of REST 
Automatic support - native http 
Lightweight, Efficient 
Secure - Supports https 
Modern - Twitter, Yahoo, etc 
No toolkits needed, XML format
Windows Communication Foundation (WCF) 
Advantages of WCF + SOAP: Provides a lot of support for many bindings 
BasicHttpBinding 
Interoperability with Web services and clients supporting the WS-BasicProfile 
1.1 and Basic Security Profile 1.0. 
WSHttpBinding 
Interoperability with Web services and clients that support the WS-* 
protocols over HTTP. 
WSDualHttpBinding 
Duplex HTTP communication, by which the receiver of an initial message 
does not reply directly to the initial sender, but may transmit any number of 
responses over a period of time by using HTTP in conformity with WS-* 
protocols. 
WSFederationBinding 
HTTP communication, in which access to the resources of a service can be 
controlled based on credentials issued by an explicitly-identified credential 
provider. 
NetTcpBinding 
Secure, reliable, high-performance communication between WCF software 
entities across a network. 
NetNamedPipeBinding 
Secure, reliable, high-performance communication between WCF software 
entities on the same
DEMO 
Creating a New WCF Service Library
Configuring A WCF Service 
Data Contracts
Defining the Data Contracts 
A data contract is a formal agreement between a service and a 
client. 
It describes the data to be exchanged. 
To communicate, the client and the service do not have to share 
the same types, only the same data contracts. 
A data contract precisely defines, for each parameter or return 
type, what data is serialized (turned into XML) to be exchanged.
Defining the Data Contracts
Configuring A WCF Service 
Using Interfaces
Why use Interfaces?
Why use Interfaces? 
Interface-based programming is popular among many developers 
It makes code better, by increasing reusability, maintainability, and 
extensibility 
An interface defines what must a client know about a class in order 
to benefit from using it 
Developers often put the interfaces into a separate assembly 
This is useful because the interface can be used by any piece of 
code that needs to know about the interface, but not necessarily 
about the implementation 
It is common practice to have one class implement more than one 
interface
Why use Interfaces? 
The benefit is that you can expose the same implemented class in 
different ways using different interfaces in the WCF endpoints. 
WCF Service 
Customer 
Manager
Why use Interfaces? 
In Windows Communication Foundation (WCF) applications, you 
define the operations by creating a class and marking it with the 
[ServiceContract] attribute in the interface file. 
For each method in the class you can mark each method with 
OperationAttribute.
Configuring A WCF Service 
Endpoints
WCF and Endpoints 
All communication with a Windows Communication Foundation 
(WCF) service occurs through the endpoints of the service 
Client WCF Service 
Endpoints provide clients access to the functionality offered by a 
WCF service
Each endpoint consists of four properties: 
An address that indicates where the endpoint can be found 
A binding that specifies how a client can communicate with 
the endpoint 
A contract that identifies the operations available 
A set of behaviors that specify local implementation details 
of the endpoint.
FlipCaseService has 3 endpoints 
Client 
FlipCaseService 
Endpoint 1 
Address http://localhost:8080/flipcase/ws 
Binding wsHttpBinding 
Contract FlipCaseService.FlipCaseService 
Endpoint 2 
Address http://localhost:8080/flipcase/basic 
Binding basicHttpBinding 
Contract FlipCaseService.FlipCaseService 
Endpoint 3 
Address Net.tcp://localhost:8081/flipcase 
Binding netTcpBinding 
Contract FlipCaseService.FlipCaseService
Bindings – Q & A 
What should you 
know about 
Bindings? 
Transport 
Encoding 
Protocol details 
What does the 
client need to 
know about the 
endpoint, beside 
the bindings? 
When connecting to endpoints, 
the client not only needs to know 
the address and contract, not just 
the binding specified by the 
endpoint.
Configuring A WCF Service 
Bindings
Your ABCs 
Understanding 
Endpoints 
Hosting 
Environment 
WCF Service 
Address 
Binding 
Contract 
What you should know 
about Bindings 
Transport 
Encoding 
Protocol details
Your ABCs 
Address 
Binding 
Contract 
What you should know 
about Bindings 
Transport 
Encoding 
Protocol details 
Transport protocol 
A transport protocol defines 
how information travels from 
endpoint to endpoint 
There are 4 options: 
Hypertext Transfer Protocol (HTTP) 
Transmission Control Protocol (TCP) 
Message Queuing (also known as 
MSMQ) 
Named pipes
Binding - Transport Protocols 
Hypertext Transfer Protocol (HTTP) 
HTTP leverages the traditional request/response pattern. 
HTTP is stateless, so if there is any multi page transactions, the application (server and client) needs to 
maintain state. 
The main value of HTTP is interoperability with non-WCF clients. 
Transmission Control Protocol (TCP) 
A duplex service 
contract is a 
message exchange 
pattern in which 
both endpoints can 
send messages to 
the other 
independently 
TCP is connection based and provides end-to-end error detection and correction. 
TCP is a great choice because it provides reliable data delivery. 
It handles lost packets and duplicate packets. 
The TCP transport is optimized for scenarios where both ends are using WCF. 
It is the fastest of all the bindings. 
TCP provides duplex communication and so can be used to implement duplex contracts, even if the client is 
behind network address translation (NAT).
Binding - Transport Protocols – continued from http and tcp 
Named Pipes 
Named Pipes is ideal for two or more WCF applications on a single computer, and you want to prevent any 
communication from another machine. 
Named pipes are efficient because they tie into the Windows operating system kernel, leveraging a section 
of shared memory that processes can use for communication. 
MSMQ 
MSMQ is allows applications to communicate in a failsafe manner. 
A queue is a temporary storage location from which messages can be sent and received reliably. 
This enables communication across networks and between computers, running Windows, which may not 
always be connected
Your ABCs 
Address 
Binding 
Contract 
What you should know 
about Bindings 
Transport 
Encoding 
Protocol details 
Encoding 
Encoding types represents how 
the data is structured across the 
wire 
There are 3 options: 
Text 
Binary 
MTOM
Bindings - Encoding 
Text 
Uses base64 encoding, which can make messages up to 30% bigger. 
If you are sending binary data, this can introduce a large amount of overhead. 
Binary 
This is the fastest encoding. 
Unless you are sending very large messages, the binary format is ideal (with the assumption that text isn’t 
needed for interoperability) 
MTOM 
Is for large objects 
MTOM is the W3C Message Transmission Optimization Mechanism, a method of efficiently sending binary 
data to and from Web services. 
MTOM doesn't use base64 encoding for binary attachments keeping the overall size small. 
MTOM is based on open specifications & hence is largely interoperable.
Your ABCs 
Address 
Binding 
Contract 
What you should know 
about Bindings 
Transport 
Encoding 
Protocol details 
Protocol Details 
WCF leverages SOAP for its network 
messaging protocol. 
SOAP, aka Simple Object Access 
Protocol, specifies how structured 
information is exchanged in the 
implementation of Web Services in 
computer networks. 
It relies on XML for its message format. 
One big advantage is that SOAP can 
tunnel easily over existing firewalls and 
proxies, without modification. 
The disadvantage of SOAP is that it has a 
verbose XML format and can be slow.
Bindings – Protocol Details – WS-* Specifications 
Messaging Specifications WS-Addressing, WS-Enumeration, WS-Eventing, WS-Transfer 
Security Specifications 
WS-Security, SOAP Message Security, WS-Security: UsernameToken Profile, WS-Security: 
X.509 Certificate Token Profile, WS-SecureConversation, WS-SecurityPolicy, 
With respect to SOAP, there are a 
number of WS-* specifications. 
These WS-* specifications can be 
broken into various categories. 
WS-Trust, WS-Federation, WS-Federation Active Requestor Profile, WS-Federation 
Passive Requestor Profile, WS-Security: Kerberos Binding 
Reliable Messaging 
Specifications 
WS-ReliableMessaging 
Transaction Specifications WS-Coordination, WS-AtomicTransaction, WS-BusinessActivity 
Metadata Specifications 
WS-Policy, WS-PolicyAssertions, WS-PolicyAttachment, WS-Discover, WS-MetadataExchange, 
WS-MTOMPolicy 
Management Specifications WS-Management, WS-Management Catalog, WS-ResourceTransfer 
Specification Profiles WS-I Basic Profile
Consuming A WCF Service 
A console client
Writing the client app 
Understanding 
Endpoints 
Hosting 
Environment 
WCF Service 
Client App 
Console App 
Windows Presentation 
Foundation 
Winforms 
Web Page 
Windows 8 
Cloud App
DEMO 
Consuming a WCF Service Library
Hosting a WCF Service 
Data Contracts
Hosting WCF 
Option 1 
IIS 
WCF Service 
Option 2 
Windows 
Service 
WCF Service 
Option 3 
Managed 
.NET App 
WCF Service
Hosting WCF 
Option 1 
IIS 
WCF Service 
WCF service that runs in the IIS 
environment takes full advantage 
of IIS features: 
Process recycling 
Idle shutdown 
Process health monitoring 
Message-based activation 
Based on Http
Hosting WCF 
Option 2 
Windows 
Service 
WCF Service 
The lifetime of the service is controlled instead 
by the operating system as a Windows Service 
This hosting option is available in all server-based 
versions of Windows 
Can be configured to start up automatically 
when the system boots up 
Process lifetime of the service is controlled by 
the Service Control Manager (SCM)
Hosting WCF 
Option 3 
Managed 
.NET App 
WCF Service 
Hosting a service in a managed 
application is the most flexible option 
It requires the least infrastructure to 
deploy 
It is also the least robust hosting option 
Managed applications do not provide the 
advanced hosting and management 
features of other hosting options in WCF
DEMO 
Hosting a WCF Service Library
©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in 
the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because 
Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information 
provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

What's hot

WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)
ipower softwares
 
Beginning with wcf service
Beginning with wcf serviceBeginning with wcf service
Beginning with wcf service
Binu Bhasuran
 

What's hot (20)

Advanced WCF Workshop
Advanced WCF WorkshopAdvanced WCF Workshop
Advanced WCF Workshop
 
Wcf architecture overview
Wcf architecture overviewWcf architecture overview
Wcf architecture overview
 
10 Tricks and Tips for WCF
10 Tricks and Tips for WCF10 Tricks and Tips for WCF
10 Tricks and Tips for WCF
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
WCF
WCFWCF
WCF
 
Wcf development
Wcf developmentWcf development
Wcf development
 
REST, JSON and RSS with WCF 3.5
REST, JSON and RSS with WCF 3.5REST, JSON and RSS with WCF 3.5
REST, JSON and RSS with WCF 3.5
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)
 
WCF And ASMX Web Services
WCF And ASMX Web ServicesWCF And ASMX Web Services
WCF And ASMX Web Services
 
Building RESTful Services with WCF 4.0
Building RESTful Services with WCF 4.0Building RESTful Services with WCF 4.0
Building RESTful Services with WCF 4.0
 
Wcf
WcfWcf
Wcf
 
WCF for begineers
WCF  for begineersWCF  for begineers
WCF for begineers
 
Beginning with wcf service
Beginning with wcf serviceBeginning with wcf service
Beginning with wcf service
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web API
 
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
 
introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundation
 
Wcf Transaction Handling
Wcf Transaction HandlingWcf Transaction Handling
Wcf Transaction Handling
 
Introduction to WCF
Introduction to WCFIntroduction to WCF
Introduction to WCF
 
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUIAdvancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
 
WCF Introduction
WCF IntroductionWCF Introduction
WCF Introduction
 

Similar to 1. WCF Services - Exam 70-487

Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35
Subodh Pushpak
 
Windows Communication Foundation
Windows Communication FoundationWindows Communication Foundation
Windows Communication Foundation
Mahmoud Tolba
 
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
Jason Townsend, MBA
 
Web services
Web servicesWeb services
Web services
aspnet123
 

Similar to 1. WCF Services - Exam 70-487 (20)

Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its Security
 
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
 
Advantage of WCF Over Web Services
Advantage of WCF Over Web ServicesAdvantage of WCF Over Web Services
Advantage of WCF Over Web Services
 
Session 1 Shanon Richards-Exposing Data Using WCF
Session 1 Shanon Richards-Exposing Data Using WCFSession 1 Shanon Richards-Exposing Data Using WCF
Session 1 Shanon Richards-Exposing Data Using WCF
 
Windows Communication Foundation
Windows Communication FoundationWindows Communication Foundation
Windows Communication Foundation
 
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
 
Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...
 
web programming
web programmingweb programming
web programming
 
07 advanced topics
07 advanced topics07 advanced topics
07 advanced topics
 
Top wcf interview questions
Top wcf interview questionsTop wcf interview questions
Top wcf interview questions
 
WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)
 
Web programming
Web programmingWeb programming
Web programming
 
Service Oriented Development With Windows Communication Foundation Tulsa Dnug
Service Oriented Development With Windows Communication Foundation   Tulsa DnugService Oriented Development With Windows Communication Foundation   Tulsa Dnug
Service Oriented Development With Windows Communication Foundation Tulsa Dnug
 
Web services
Web servicesWeb services
Web services
 
SOA & WCF
SOA & WCFSOA & WCF
SOA & WCF
 
Service Oriented Development With Windows Communication Foundation 2003
Service Oriented Development With Windows Communication Foundation 2003Service Oriented Development With Windows Communication Foundation 2003
Service Oriented Development With Windows Communication Foundation 2003
 
Overview of web services
Overview of web servicesOverview of web services
Overview of web services
 
Unit 3-SOA Technologies
Unit 3-SOA TechnologiesUnit 3-SOA Technologies
Unit 3-SOA Technologies
 
Java web services
Java web servicesJava web services
Java web services
 

More from Bat Programmer (6)

06 web api
06 web api06 web api
06 web api
 
05 entity framework
05 entity framework05 entity framework
05 entity framework
 
04 data accesstechnologies
04 data accesstechnologies04 data accesstechnologies
04 data accesstechnologies
 
03 data storage
03 data storage03 data storage
03 data storage
 
02 hosting servicesinwindowsazure
02 hosting servicesinwindowsazure02 hosting servicesinwindowsazure
02 hosting servicesinwindowsazure
 
Guide to MCPD - Web Developer 4
Guide to MCPD - Web Developer 4Guide to MCPD - Web Developer 4
Guide to MCPD - Web Developer 4
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

1. WCF Services - Exam 70-487

  • 1. Bruno Terkaly | Technical Evangelist Bret Stateham | Technical Evangelist
  • 2. Meet Bruno Terkaly | @BrunoTerkaly • Monthly Columnist MSDN Magazine • Expertise in Windows Azure / Windows 8 • Principal Technical Evangelist – Silicon Valley • Find him on the web at blogs.msdn.com/brunoterkaly
  • 3. Meet BretStateham | @BretStateham • Find me on the Web at BretStateham.com • Working with the web since before IIS • Working with .NET since before .NET • In love with SQL Server (don’t tell my wife)
  • 4. Course Topics Developing SharePoint Server Core Solutions Jump Start 01 | WCF Services 05 | Entity Framework 02 | Hosting Services in Windows Azure 06 | Web API 03 | Data Storage 07 | Advanced WCF Topics 04 | Data Access Technologies
  • 5. Setting Expectations • Target Audience – Developers looking to host WCF or Web API services in Windows Azure, with data stored in Azure Storage or Azure SQL Database – Considering taking the 70-487 Exam • Additional Material – Microsoft Official Course 20487 • Developing Windows Azure and Web Services
  • 6. Join the MVA Community! • Microsoft Virtual Academy – Free online learning tailored for IT Pros and Developers – Over 1M registered users – Up-to-date, relevant training on variety of Microsoft products • “Earn while you learn!” – Get 50 MVA Points for this event! – Visit http://aka.ms/MVA-Voucher – Enter this code: AzWebSvc (expires 12/13/2013)
  • 7. 01 | WCF Services Bret Stateham | Technical Evangelist Bruno Terkaly | Technical Evangelist
  • 9. Module Overview • WCF Overview • Configuring Services • Consuming Services • Hosting WCF Services
  • 11. Windows Communication Foundation (WCF) The Windows Communication Foundation (or WCF) is a runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications.
  • 12. Windows Communication Foundation (WCF) Common Tasks For A Web Service
  • 13. Windows Communication Foundation (WCF) Customer Web Service Customer Databases Customer Web Service Demo Scenarios Other Web Service Incident Client UX
  • 14. Windows Communication Foundation (WCF) Messages are typically sent in text encoded SOAP messages using is the HyperText Transfer Protocol (HTTP) SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. It relies on XML Information Set for its message format.
  • 15. Windows Communication Foundation (WCF) SOAP calls REST calls REST is an abbreviation for: Representational State Transfer
  • 16. Windows Communication Foundation (WCF) But REST is coming along….
  • 17. Windows Communication Foundation (WCF) Advantages of REST Automatic support - native http Lightweight, Efficient Secure - Supports https Modern - Twitter, Yahoo, etc No toolkits needed, XML format
  • 18. Windows Communication Foundation (WCF) Advantages of WCF + SOAP: Provides a lot of support for many bindings BasicHttpBinding Interoperability with Web services and clients supporting the WS-BasicProfile 1.1 and Basic Security Profile 1.0. WSHttpBinding Interoperability with Web services and clients that support the WS-* protocols over HTTP. WSDualHttpBinding Duplex HTTP communication, by which the receiver of an initial message does not reply directly to the initial sender, but may transmit any number of responses over a period of time by using HTTP in conformity with WS-* protocols. WSFederationBinding HTTP communication, in which access to the resources of a service can be controlled based on credentials issued by an explicitly-identified credential provider. NetTcpBinding Secure, reliable, high-performance communication between WCF software entities across a network. NetNamedPipeBinding Secure, reliable, high-performance communication between WCF software entities on the same
  • 19. DEMO Creating a New WCF Service Library
  • 20. Configuring A WCF Service Data Contracts
  • 21. Defining the Data Contracts A data contract is a formal agreement between a service and a client. It describes the data to be exchanged. To communicate, the client and the service do not have to share the same types, only the same data contracts. A data contract precisely defines, for each parameter or return type, what data is serialized (turned into XML) to be exchanged.
  • 22. Defining the Data Contracts
  • 23. Configuring A WCF Service Using Interfaces
  • 25. Why use Interfaces? Interface-based programming is popular among many developers It makes code better, by increasing reusability, maintainability, and extensibility An interface defines what must a client know about a class in order to benefit from using it Developers often put the interfaces into a separate assembly This is useful because the interface can be used by any piece of code that needs to know about the interface, but not necessarily about the implementation It is common practice to have one class implement more than one interface
  • 26. Why use Interfaces? The benefit is that you can expose the same implemented class in different ways using different interfaces in the WCF endpoints. WCF Service Customer Manager
  • 27. Why use Interfaces? In Windows Communication Foundation (WCF) applications, you define the operations by creating a class and marking it with the [ServiceContract] attribute in the interface file. For each method in the class you can mark each method with OperationAttribute.
  • 28. Configuring A WCF Service Endpoints
  • 29. WCF and Endpoints All communication with a Windows Communication Foundation (WCF) service occurs through the endpoints of the service Client WCF Service Endpoints provide clients access to the functionality offered by a WCF service
  • 30. Each endpoint consists of four properties: An address that indicates where the endpoint can be found A binding that specifies how a client can communicate with the endpoint A contract that identifies the operations available A set of behaviors that specify local implementation details of the endpoint.
  • 31. FlipCaseService has 3 endpoints Client FlipCaseService Endpoint 1 Address http://localhost:8080/flipcase/ws Binding wsHttpBinding Contract FlipCaseService.FlipCaseService Endpoint 2 Address http://localhost:8080/flipcase/basic Binding basicHttpBinding Contract FlipCaseService.FlipCaseService Endpoint 3 Address Net.tcp://localhost:8081/flipcase Binding netTcpBinding Contract FlipCaseService.FlipCaseService
  • 32. Bindings – Q & A What should you know about Bindings? Transport Encoding Protocol details What does the client need to know about the endpoint, beside the bindings? When connecting to endpoints, the client not only needs to know the address and contract, not just the binding specified by the endpoint.
  • 33. Configuring A WCF Service Bindings
  • 34. Your ABCs Understanding Endpoints Hosting Environment WCF Service Address Binding Contract What you should know about Bindings Transport Encoding Protocol details
  • 35. Your ABCs Address Binding Contract What you should know about Bindings Transport Encoding Protocol details Transport protocol A transport protocol defines how information travels from endpoint to endpoint There are 4 options: Hypertext Transfer Protocol (HTTP) Transmission Control Protocol (TCP) Message Queuing (also known as MSMQ) Named pipes
  • 36. Binding - Transport Protocols Hypertext Transfer Protocol (HTTP) HTTP leverages the traditional request/response pattern. HTTP is stateless, so if there is any multi page transactions, the application (server and client) needs to maintain state. The main value of HTTP is interoperability with non-WCF clients. Transmission Control Protocol (TCP) A duplex service contract is a message exchange pattern in which both endpoints can send messages to the other independently TCP is connection based and provides end-to-end error detection and correction. TCP is a great choice because it provides reliable data delivery. It handles lost packets and duplicate packets. The TCP transport is optimized for scenarios where both ends are using WCF. It is the fastest of all the bindings. TCP provides duplex communication and so can be used to implement duplex contracts, even if the client is behind network address translation (NAT).
  • 37. Binding - Transport Protocols – continued from http and tcp Named Pipes Named Pipes is ideal for two or more WCF applications on a single computer, and you want to prevent any communication from another machine. Named pipes are efficient because they tie into the Windows operating system kernel, leveraging a section of shared memory that processes can use for communication. MSMQ MSMQ is allows applications to communicate in a failsafe manner. A queue is a temporary storage location from which messages can be sent and received reliably. This enables communication across networks and between computers, running Windows, which may not always be connected
  • 38. Your ABCs Address Binding Contract What you should know about Bindings Transport Encoding Protocol details Encoding Encoding types represents how the data is structured across the wire There are 3 options: Text Binary MTOM
  • 39. Bindings - Encoding Text Uses base64 encoding, which can make messages up to 30% bigger. If you are sending binary data, this can introduce a large amount of overhead. Binary This is the fastest encoding. Unless you are sending very large messages, the binary format is ideal (with the assumption that text isn’t needed for interoperability) MTOM Is for large objects MTOM is the W3C Message Transmission Optimization Mechanism, a method of efficiently sending binary data to and from Web services. MTOM doesn't use base64 encoding for binary attachments keeping the overall size small. MTOM is based on open specifications & hence is largely interoperable.
  • 40. Your ABCs Address Binding Contract What you should know about Bindings Transport Encoding Protocol details Protocol Details WCF leverages SOAP for its network messaging protocol. SOAP, aka Simple Object Access Protocol, specifies how structured information is exchanged in the implementation of Web Services in computer networks. It relies on XML for its message format. One big advantage is that SOAP can tunnel easily over existing firewalls and proxies, without modification. The disadvantage of SOAP is that it has a verbose XML format and can be slow.
  • 41. Bindings – Protocol Details – WS-* Specifications Messaging Specifications WS-Addressing, WS-Enumeration, WS-Eventing, WS-Transfer Security Specifications WS-Security, SOAP Message Security, WS-Security: UsernameToken Profile, WS-Security: X.509 Certificate Token Profile, WS-SecureConversation, WS-SecurityPolicy, With respect to SOAP, there are a number of WS-* specifications. These WS-* specifications can be broken into various categories. WS-Trust, WS-Federation, WS-Federation Active Requestor Profile, WS-Federation Passive Requestor Profile, WS-Security: Kerberos Binding Reliable Messaging Specifications WS-ReliableMessaging Transaction Specifications WS-Coordination, WS-AtomicTransaction, WS-BusinessActivity Metadata Specifications WS-Policy, WS-PolicyAssertions, WS-PolicyAttachment, WS-Discover, WS-MetadataExchange, WS-MTOMPolicy Management Specifications WS-Management, WS-Management Catalog, WS-ResourceTransfer Specification Profiles WS-I Basic Profile
  • 42. Consuming A WCF Service A console client
  • 43. Writing the client app Understanding Endpoints Hosting Environment WCF Service Client App Console App Windows Presentation Foundation Winforms Web Page Windows 8 Cloud App
  • 44. DEMO Consuming a WCF Service Library
  • 45. Hosting a WCF Service Data Contracts
  • 46. Hosting WCF Option 1 IIS WCF Service Option 2 Windows Service WCF Service Option 3 Managed .NET App WCF Service
  • 47. Hosting WCF Option 1 IIS WCF Service WCF service that runs in the IIS environment takes full advantage of IIS features: Process recycling Idle shutdown Process health monitoring Message-based activation Based on Http
  • 48. Hosting WCF Option 2 Windows Service WCF Service The lifetime of the service is controlled instead by the operating system as a Windows Service This hosting option is available in all server-based versions of Windows Can be configured to start up automatically when the system boots up Process lifetime of the service is controlled by the Service Control Manager (SCM)
  • 49. Hosting WCF Option 3 Managed .NET App WCF Service Hosting a service in a managed application is the most flexible option It requires the least infrastructure to deploy It is also the least robust hosting option Managed applications do not provide the advanced hosting and management features of other hosting options in WCF
  • 50. DEMO Hosting a WCF Service Library
  • 51. ©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Editor's Notes

  1. 1
  2. 7