SOA & WCF

795 views
635 views

Published on

INTRODUCTION TO SERVICE ORIENTED ARCHITECTURE AND WINDOWS COMMUNICATION FOUNDATION PRESENTED IN ASP.NET COMMUNITY

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
795
On SlideShare
0
From Embeds
0
Number of Embeds
167
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

SOA & WCF

  1. 1. SOA AND WCF SERVICE ORIENTED ARCHITECTURE & WINDOWS COMMUNICATION FOUNDATION Dev Raj Gautam Saturday, 18th may, 2013 Asp.NET Community MeetUp
  2. 2. SOA SERVICE ORIENTED ARCHITECTURE
  3. 3. SOA  SOA or Service oriented architecture is an architecture style for building business applications by means of services. Application comprises collection of services which communicate through messages.  Widely used in various programming platforms e.g. Net , Java etc.  Consists set of components which can be invoked, and whose interface descriptions can be published and discovered (W3C).  Services are consumed by software service consumers (also known as clients or service requesters)
  4. 4. SERVICES IN SOA  A service is a self-contained unit of software that performs a specific task  Add a new customer, send an e-mail, register user etc.  It has three components:  Interface defines how a service provider will perform requests from a service consumer  Contract defines how the service provider and the service consumer should interact  implementation is the actual service code itself
  5. 5. MESSAGES IN SOA  Services communicate with each other using messages. Messages are standard formats which everyone (every service) can read and understand.  Services communicate via standard Messages standard messages, which make them platform independent
  6. 6. WHY TO USE SOA? (IN SIMPLE TERMS)  Exposing services ensures clients get data without directly connecting to data source.  Process Reusability among different platforms  Different UI can access for same process and data source  Tackle heterogeneous technology stack
  7. 7. UNDERSTANDING THE REAL CONTEXT
  8. 8. HOW IS COMMUNICATION POSSIBLE AMONG HETEROGONOUS PLATFORM? --SOAP  By using the World Wide Web's Hypertext Transfer Protocol (HTTP) and its Extensible Markup Language (XML) as the mechanisms for information exchange  SOAP specifies exactly how to encode an HTTP header and an XML file so that a program in one computer can call a program in another computer and pass it information. It also specifies how the called program can return a response.
  9. 9. WCF WINDOWS COMMUNICATION FOUNDATION
  10. 10. WCF  The Windows Communication Foundation (or WCF), previously known as "Indigo", is a runtime and a set of APIs (Application Programming Interface) in the .NET Framework for building connected service-oriented applications (Wikipedia).  Using WCF, you can send data as asynchronous messages from one service endpoint to another  Multiple technologies at one place - WCF unites following four technologies.NET remoting  MSMQ  Web Services  COM+  .Net Remoting
  11. 11. Service Interface Service Implementation
  12. 12. UNDERSTANDING THE SERVICE STRUCTURE
  13. 13. SAMPLE REQUEST AND RESPONSE FROM WCF  Request <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header> <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://te mpuri.org/IService1/GetData</Action> </s:Header> <s:Body> <GetData xmlns="http://tempuri.org/"> <value>1</value> </GetData> </s:Body> </s:Envelope>  Response <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header /> <s:Body> <GetDataResponse xmlns="http://tempuri.org/"> <GetDataResult>You entered: 1</GetDataResult> </GetDataResponse> </s:Body> </s:Envelope>
  14. 14. WCF END POINTS
  15. 15. ABC OF WCF ENDPOINTS  Address(Where?): Specifies the location of the service which will be like http://Myserver/MyService.Clients will use this location to communicate with our service.  Binding-Address(How?): Specifies how the two parties will communicate in terms of transport and encoding and protocols.  Contract(What?): Specifies the interface between client and the server. It's a simple interface with some attribute.
  16. 16. FLEXIBILITY OF HOSTING OPTIONS IN WCF  Self-Hosting Your Service :A managed .NET application can host the wcf service itself,  Hosting in Windows Services  Hosting Using Internet Information Services
  17. 17. WSDL IN WCF (DOCUMENTING FOR CLIENTS)  WSDL documentation generation can be specified by [WSDLDocumentation (“”)] tag in service interface.  Service, operations and input/output parameter descriptions are added to WSDL
  18. 18. SAMPLE WSDL <WSDL:message name="EchoStringSoapIn"> <WSDL:part name="parameters" element="tns:EchoString" /> </WSDL:message> ... <WSDL:operation name="EchoString"> <WSDL:input message="tns:EchoStringSoapIn" /> <WSDL:output message="tns:EchoStringSoapOut" /> </WSDL:operation>
  19. 19. thank you

×