SlideShare a Scribd company logo
1 of 28
iFour ConsultancyWeb Services
 Introduction to Web Service
 SOAP (Simple Object Access Protocol)
 WSDL (Web Service Description Language)
 WSDL Components
 WCF (Windows Communication Foundation)
 Advantages of WCF
 Difference between WCF and Web service
 WCF Service Components
 Address
 Binding
 Contract
 REST
 WEB API
INDEX
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 An application that is designed to interact directly with other applications over the
internet
 In simple sense, Web Services are means for interacting with objects over the Internet
 The Web service consumers are able to invoke method calls on remote objects by using
SOAP and HTTP over the Web
 It is language independent and Web Services communicate by using standard web
protocols and data formats, such as
 HTTP
 XML
 SOAP
Introduction to Web Service
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Flow
Introduction to Web Service (Cont.)
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 Advantage:
 Web Service messages are formatted as XML, a standard way for communication
between two incompatible system. And this message is sent via HTTP, so that they can
reach to any machine on the internet without being blocked by firewall
Introduction to Web Service (Cont.)
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 SOAP - Simple Object Access Protocol
 REST - Representation State Transfer
Three ways we can develop web service
 ASMX Web Service (SOAP)
 WCF (SOAP /REST)
 ASP.NET Web API ( REST)
Types of Web service
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
SOAP-REST Web service Communication Flow
Web service request and response flow
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Web service Communication Flow
Web service request and response flow Cont.
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 Remote function calls that invokes method and executes them on Remote machine and
translate the object communication into XML format
 In short, SOAP are way by which method calls are translate into XML format and sent via
HTTP
SOAP (Simple Object Access Protocol)
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 SOAP and XML created the solution for the problem that developers were facing before
 Standard XML based protocol that communicated over HTTP
 SOAP is message format for sending messaged between applications using XML. It is
independent of technology, platform and is extensible too
 SOAP and XML to give us connectivity between applications
SOAP (Cont.)
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 A Standard by which a web service can tell clients what messages it accepts and which
results it will return
 Contains every detail regarding using web service and Method and Properties provided by
web service and URLs from which those methods can be accessed and Data Types used
 The operations and messages are described abstractly, and then bound to a concrete
network protocol and message format to define an endpoint
 Related concrete endpoints are combined into abstract endpoints (services)
 It is extensible to allow description of endpoints and their messages regardless of what
message formats or network protocols are used to communicate, however, the only
bindings described in this document describe how to use WSDL in conjunction with SOAP
WSDL (Web Service Description Language)
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
WSDL Components
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
WSDL 1.1 Term WSDL 2.0 Term Description
Service Service
Contains a set of system functions
that have been exposed to the
Web-based protocols
Port Endpoint
Defines the address or connection
point to a Web service. It is
typically represented by a simple
HTTP URL string
Binding Binding
Specifies the interface and defines
the SOAP binding style
(RPC/Document) and transport
(SOAP Protocol). The binding
section also defines the operations
WSDL Components (Cont.)
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
PortType
Interfa
ce
Defines a Web service, the operations that can be performed, and the messages that are
used to perform the operation
Operation
Operat
ion
Defines the SOAP actions and the way the message is encoded, for example, "literal." An
operation is like a method or function call in a traditional programming language
Message n/a
Typically, a message corresponds to an operation. The message contains the information
needed to perform the operation. Each message is made up of one or more logical parts.
Each part is associated with a message-typing attribute
The message name attribute provides a unique name among all messages. The part
name attribute provides a unique name among all the parts of the enclosing message.
Parts are a description of the logical content of a message. In RPC binding, a binding may
reference the name of a part in order to specify binding-specific information about the
part
Types Types
Describes the data. The XML Schema language (also known as XSD) is used (inline or
referenced) for this purpose
WSDL Components (Cont.)
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 Programming platform and runtime system for building, configuring and deploying
network-distributed services
 Latest service oriented technology, Interoperability is the fundamental characteristics of
WCF
 Unified programming model provided in .NET Framework 3.0
 Combined feature of Web Service, Remoting, MSMQ and COM+
 Provides a common platform for all .NET communication
WCF (Windows Communication Foundation)
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 Interoperable with other services when compared to .NET Remoting where the client and
service have to be .NET
 Provide better reliability and security in compared to ASMX web services.
 No need to make much change in code for implementing the security model and changing
the binding. Small changes in the configuration will make our requirements
 Integrated logging mechanism, changing the configuration file settings will provide this
functionality
Advantages of WCF
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Features Web Service WCF
Hosting It can be hosted in IIS
It can be hosted in IIS, windows activation service, Self-hosting, Windows
service
Programming
[WebService] attribute has to be added to
the class
[ServiceContract] attribute has to be added to the class
Model
[WebMethod] attribute represents the
method exposed to client
[OperationContract] attribute represents the method exposed to client
Operation
One-way, Request- Response are the
different operations supported in web
service
One-Way, Request-Response, Duplex are different type of operations
supported in WCF
XML
System.Xml.serialization name space is
used for serialization
System.Runtime.Serialization namespace is used for serialization
Encoding
XML 1.0, MTOM(Message Transmission
Optimization Mechanism), DIME, Custom
XML 1.0, MTOM, Binary, Custom
Transports
Can be accessed through HTTP, TCP,
Custom
Can be accessed through HTTP, TCP, Named pipes, MSMQ,P2P, Custom
Protocols Security Security, Reliable messaging, Transactions
Difference between WCF and Web service
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 A WCF Service is composed of three components :
 Service Class - It implements some service as a set of methods
 Host Environment - It can be a Console application or a Windows Service or a Windows Forms
application or IIS as in case of the normal .asmx web service in .NET
 Endpoints - All communications with the WCF service will happen via the endpoints. The
endpoint is composed of 3 parts (collectively called as ABC's of endpoint) as defines below:
 Address
 Binding
 Contract
WCF Service Components
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 The endpoints specify an Address that defines where the endpoint is hosted
 It’s basically url
 Example:
http://localhost/WCFServiceSample/Service.svc
Address
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 The endpoints also define a binding that specifies how a client will communicate with the
service and the address where the endpoint is hosted
 Different Bindings supported by WCF:
Binding
Binding Description
BasicHttpBinding
Basic Web service communication. No security by
default
WSHttpBinding
Web services with WS-* support. Supports
transactions
WSDualHttpBinding
Web services with duplex contract and transaction
support
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
WSFederationHttpBinding Web services with federated security. Supports transactions
MsmqIntegrationBinding Communication directly with MSMQ applications. Supports transactions
NetMsmqBinding
Communication between WCF applications by using queuing. Supports
transactions
NetNamedPipeBinding
Communication between WCF applications on same computer. Supports
duplex contracts and transactions
NetPeerTcpBinding
Communication between computers across peer-to-peer services.
Supports duplex contracts
NetTcpBinding
Communication between WCF applications across computers. Supports
duplex contracts and transactions
BasicHttpBinding Basic Web service communication. No security by default
WSHttpBinding Web services with WS-* support. Supports transactions
Binding (Cont.)
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 The endpoints specify a Contract that defines which methods of the Service class will be
accessible via the endpoint; each endpoint may expose a different set of methods
 Different contracts in WCF:
 Service Contract
 It describe the operation that service can provide. For E.g., A Service provide to know the temperature of
the city based on the zip code, this service is called as Service contract
 It will be created using Service and Operational Contract attribute
 Message Contract
 Default SOAP message format is provided by the WCF runtime for communication between Client and
service
 If it is not meeting requirements then we can create our own message format. This can be achieved by
using Message Contract attribute
Contract
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Data Contract
 It describes the custom data type which is exposed to the client. This defines the data types,
which are passed to and from service
 Data types like int, string are identified by the client because it is already mention in XML
schema definition language document, but custom created class or data types cannot be
identified by the client e.g. Employee data type
 By using Data Contract we can make client to be aware of Employee data type that are
returning or passing parameter to the method
Fault Contract
 Suppose the service we consumed is not working in the client application. we want to know the
real cause of the problem. How we can know the error? For this we are having Fault Contract
 Fault Contract provides documented view for error occurred in the service to client. This helps
us to easy identity, what error has occurred
Contract (Cont.)
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 REST stands for ‘Representational State Transfer’ and it is an architectural pattern for
creating an API that uses HTTP as its underlying communication method
 Almost every device that is connected to the internet already uses HTTP, it is the base protocol
that the internet is built on which is why it makes such a great platform for an API
 HTTP is a request and response system, a calling client sends a request to an endpoint and the
endpoint responds
 The client and endpoint can be anything but a typical example is a browser accessing a web server
or an app accessing and API
REST
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 There are several key implementation details with HTTP that you should be aware of:
 Resources - REST uses addressable resources to define the structure of the API. These are the
URLs you use to get to pages on the web
 Example: ‘http://www.microsoft.com/Surface-Pro-3’ is a resource
 Request Verbs - A browser typically issues a GET verb to instruct the endpoint it wants to get
data, however there are many other verbs available including things like POST, PUT and DELETE
 Request Headers - Additional instructions that are sent with the request. These might define
what type of response is required or authorization details
 Request Body - Data that is sent with the request
 Example: A POST (creation of a new item) will required some data which is typically sent as the
request body in the format of JSON or XML
 Response Body - Main body of the response. If the request was to a web server, this might be a
full HTML page, if it was to an API, this might be a JSON or XML document
 Response Status codes - These codes are issues with the response and give the client details on
the status of the request
REST (Cont.)
ASP.NET Software Development Companies India
 The term API stands for ‘Application Programming Interface’
 In the world of web development the term ‘API’ is synonymous with online web services
which client apps can use to retrieve and update data
 These online services have had several names/formats over the years such as SOAP,
however the current popular choice is to create a REST (or RESTful) API
WEB API
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
 http://www.tutorialspoint.com/webservices/
 http://www.w3schools.com/xml/xml_services.asp
 http://www.c-sharpcorner.com/uploadfile/00a8b7/web-service/
 https://www.tutorialspoint.com/asp.net/asp.net_web_services.htm
References
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
Questions?
http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India

More Related Content

Viewers also liked (12)

Web service introduction
Web service introductionWeb service introduction
Web service introduction
 
Introduction to XML and Databases
Introduction to XML and DatabasesIntroduction to XML and Databases
Introduction to XML and Databases
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Network topology
Network topologyNetwork topology
Network topology
 
Intro xml
Intro xmlIntro xml
Intro xml
 
Xml Publisher And Reporting To Excel
Xml Publisher And Reporting To ExcelXml Publisher And Reporting To Excel
Xml Publisher And Reporting To Excel
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
 
Introduction to Web Service
Introduction to Web Service Introduction to Web Service
Introduction to Web Service
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 

More from iFour Institute - Sustainable Learning

More from iFour Institute - Sustainable Learning (13)

Project Management : Project Planning by iFour Technolab Pvt. Ltd.
Project Management : Project Planning by iFour Technolab Pvt. Ltd.Project Management : Project Planning by iFour Technolab Pvt. Ltd.
Project Management : Project Planning by iFour Technolab Pvt. Ltd.
 
Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.
Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.
Project management : Project Monitoring and Control by iFour Technolab Pvt. Ltd.
 
Project management : Causal analysis and Resolution by iFour Technolab Pvt. ...
Project management :  Causal analysis and Resolution by iFour Technolab Pvt. ...Project management :  Causal analysis and Resolution by iFour Technolab Pvt. ...
Project management : Causal analysis and Resolution by iFour Technolab Pvt. ...
 
Here are proven techniques to Organizing effective training by iFour Technola...
Here are proven techniques to Organizing effective training by iFour Technola...Here are proven techniques to Organizing effective training by iFour Technola...
Here are proven techniques to Organizing effective training by iFour Technola...
 
ADO.NET by ASP.NET Development Company in india
ADO.NET by ASP.NET  Development Company in indiaADO.NET by ASP.NET  Development Company in india
ADO.NET by ASP.NET Development Company in india
 
Web API with ASP.NET MVC by Software development company in india
Web API with ASP.NET  MVC  by Software development company in indiaWeb API with ASP.NET  MVC  by Software development company in india
Web API with ASP.NET MVC by Software development company in india
 
jQuery plugins & JSON
jQuery plugins & JSONjQuery plugins & JSON
jQuery plugins & JSON
 
Mvc by asp.net development company in india - part 2
Mvc by asp.net development company in india  - part 2Mvc by asp.net development company in india  - part 2
Mvc by asp.net development company in india - part 2
 
MVC by asp.net development company in india
MVC by asp.net development company in indiaMVC by asp.net development company in india
MVC by asp.net development company in india
 
C# fundamentals Part 2
C# fundamentals Part 2C# fundamentals Part 2
C# fundamentals Part 2
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
 
HTML Basics by software development company india
HTML Basics by software development company indiaHTML Basics by software development company india
HTML Basics by software development company india
 

Recently uploaded

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 

Web Services by iFour Technolab Pvt. Ltd.

  • 2.  Introduction to Web Service  SOAP (Simple Object Access Protocol)  WSDL (Web Service Description Language)  WSDL Components  WCF (Windows Communication Foundation)  Advantages of WCF  Difference between WCF and Web service  WCF Service Components  Address  Binding  Contract  REST  WEB API INDEX http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 3.  An application that is designed to interact directly with other applications over the internet  In simple sense, Web Services are means for interacting with objects over the Internet  The Web service consumers are able to invoke method calls on remote objects by using SOAP and HTTP over the Web  It is language independent and Web Services communicate by using standard web protocols and data formats, such as  HTTP  XML  SOAP Introduction to Web Service http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 4. Flow Introduction to Web Service (Cont.) http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 5.  Advantage:  Web Service messages are formatted as XML, a standard way for communication between two incompatible system. And this message is sent via HTTP, so that they can reach to any machine on the internet without being blocked by firewall Introduction to Web Service (Cont.) http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 6.  SOAP - Simple Object Access Protocol  REST - Representation State Transfer Three ways we can develop web service  ASMX Web Service (SOAP)  WCF (SOAP /REST)  ASP.NET Web API ( REST) Types of Web service http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 7. SOAP-REST Web service Communication Flow Web service request and response flow http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 8. Web service Communication Flow Web service request and response flow Cont. http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 9.  Remote function calls that invokes method and executes them on Remote machine and translate the object communication into XML format  In short, SOAP are way by which method calls are translate into XML format and sent via HTTP SOAP (Simple Object Access Protocol) http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 10.  SOAP and XML created the solution for the problem that developers were facing before  Standard XML based protocol that communicated over HTTP  SOAP is message format for sending messaged between applications using XML. It is independent of technology, platform and is extensible too  SOAP and XML to give us connectivity between applications SOAP (Cont.) http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 11.  A Standard by which a web service can tell clients what messages it accepts and which results it will return  Contains every detail regarding using web service and Method and Properties provided by web service and URLs from which those methods can be accessed and Data Types used  The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint  Related concrete endpoints are combined into abstract endpoints (services)  It is extensible to allow description of endpoints and their messages regardless of what message formats or network protocols are used to communicate, however, the only bindings described in this document describe how to use WSDL in conjunction with SOAP WSDL (Web Service Description Language) http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 12. WSDL Components http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 13. WSDL 1.1 Term WSDL 2.0 Term Description Service Service Contains a set of system functions that have been exposed to the Web-based protocols Port Endpoint Defines the address or connection point to a Web service. It is typically represented by a simple HTTP URL string Binding Binding Specifies the interface and defines the SOAP binding style (RPC/Document) and transport (SOAP Protocol). The binding section also defines the operations WSDL Components (Cont.) http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 14. PortType Interfa ce Defines a Web service, the operations that can be performed, and the messages that are used to perform the operation Operation Operat ion Defines the SOAP actions and the way the message is encoded, for example, "literal." An operation is like a method or function call in a traditional programming language Message n/a Typically, a message corresponds to an operation. The message contains the information needed to perform the operation. Each message is made up of one or more logical parts. Each part is associated with a message-typing attribute The message name attribute provides a unique name among all messages. The part name attribute provides a unique name among all the parts of the enclosing message. Parts are a description of the logical content of a message. In RPC binding, a binding may reference the name of a part in order to specify binding-specific information about the part Types Types Describes the data. The XML Schema language (also known as XSD) is used (inline or referenced) for this purpose WSDL Components (Cont.) http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 15.  Programming platform and runtime system for building, configuring and deploying network-distributed services  Latest service oriented technology, Interoperability is the fundamental characteristics of WCF  Unified programming model provided in .NET Framework 3.0  Combined feature of Web Service, Remoting, MSMQ and COM+  Provides a common platform for all .NET communication WCF (Windows Communication Foundation) http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 16.  Interoperable with other services when compared to .NET Remoting where the client and service have to be .NET  Provide better reliability and security in compared to ASMX web services.  No need to make much change in code for implementing the security model and changing the binding. Small changes in the configuration will make our requirements  Integrated logging mechanism, changing the configuration file settings will provide this functionality Advantages of WCF http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 17. Features Web Service WCF Hosting It can be hosted in IIS It can be hosted in IIS, windows activation service, Self-hosting, Windows service Programming [WebService] attribute has to be added to the class [ServiceContract] attribute has to be added to the class Model [WebMethod] attribute represents the method exposed to client [OperationContract] attribute represents the method exposed to client Operation One-way, Request- Response are the different operations supported in web service One-Way, Request-Response, Duplex are different type of operations supported in WCF XML System.Xml.serialization name space is used for serialization System.Runtime.Serialization namespace is used for serialization Encoding XML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME, Custom XML 1.0, MTOM, Binary, Custom Transports Can be accessed through HTTP, TCP, Custom Can be accessed through HTTP, TCP, Named pipes, MSMQ,P2P, Custom Protocols Security Security, Reliable messaging, Transactions Difference between WCF and Web service http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 18.  A WCF Service is composed of three components :  Service Class - It implements some service as a set of methods  Host Environment - It can be a Console application or a Windows Service or a Windows Forms application or IIS as in case of the normal .asmx web service in .NET  Endpoints - All communications with the WCF service will happen via the endpoints. The endpoint is composed of 3 parts (collectively called as ABC's of endpoint) as defines below:  Address  Binding  Contract WCF Service Components http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 19.  The endpoints specify an Address that defines where the endpoint is hosted  It’s basically url  Example: http://localhost/WCFServiceSample/Service.svc Address http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 20.  The endpoints also define a binding that specifies how a client will communicate with the service and the address where the endpoint is hosted  Different Bindings supported by WCF: Binding Binding Description BasicHttpBinding Basic Web service communication. No security by default WSHttpBinding Web services with WS-* support. Supports transactions WSDualHttpBinding Web services with duplex contract and transaction support http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 21. WSFederationHttpBinding Web services with federated security. Supports transactions MsmqIntegrationBinding Communication directly with MSMQ applications. Supports transactions NetMsmqBinding Communication between WCF applications by using queuing. Supports transactions NetNamedPipeBinding Communication between WCF applications on same computer. Supports duplex contracts and transactions NetPeerTcpBinding Communication between computers across peer-to-peer services. Supports duplex contracts NetTcpBinding Communication between WCF applications across computers. Supports duplex contracts and transactions BasicHttpBinding Basic Web service communication. No security by default WSHttpBinding Web services with WS-* support. Supports transactions Binding (Cont.) http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 22.  The endpoints specify a Contract that defines which methods of the Service class will be accessible via the endpoint; each endpoint may expose a different set of methods  Different contracts in WCF:  Service Contract  It describe the operation that service can provide. For E.g., A Service provide to know the temperature of the city based on the zip code, this service is called as Service contract  It will be created using Service and Operational Contract attribute  Message Contract  Default SOAP message format is provided by the WCF runtime for communication between Client and service  If it is not meeting requirements then we can create our own message format. This can be achieved by using Message Contract attribute Contract http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 23. Data Contract  It describes the custom data type which is exposed to the client. This defines the data types, which are passed to and from service  Data types like int, string are identified by the client because it is already mention in XML schema definition language document, but custom created class or data types cannot be identified by the client e.g. Employee data type  By using Data Contract we can make client to be aware of Employee data type that are returning or passing parameter to the method Fault Contract  Suppose the service we consumed is not working in the client application. we want to know the real cause of the problem. How we can know the error? For this we are having Fault Contract  Fault Contract provides documented view for error occurred in the service to client. This helps us to easy identity, what error has occurred Contract (Cont.) http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 24.  REST stands for ‘Representational State Transfer’ and it is an architectural pattern for creating an API that uses HTTP as its underlying communication method  Almost every device that is connected to the internet already uses HTTP, it is the base protocol that the internet is built on which is why it makes such a great platform for an API  HTTP is a request and response system, a calling client sends a request to an endpoint and the endpoint responds  The client and endpoint can be anything but a typical example is a browser accessing a web server or an app accessing and API REST http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 25.  There are several key implementation details with HTTP that you should be aware of:  Resources - REST uses addressable resources to define the structure of the API. These are the URLs you use to get to pages on the web  Example: ‘http://www.microsoft.com/Surface-Pro-3’ is a resource  Request Verbs - A browser typically issues a GET verb to instruct the endpoint it wants to get data, however there are many other verbs available including things like POST, PUT and DELETE  Request Headers - Additional instructions that are sent with the request. These might define what type of response is required or authorization details  Request Body - Data that is sent with the request  Example: A POST (creation of a new item) will required some data which is typically sent as the request body in the format of JSON or XML  Response Body - Main body of the response. If the request was to a web server, this might be a full HTML page, if it was to an API, this might be a JSON or XML document  Response Status codes - These codes are issues with the response and give the client details on the status of the request REST (Cont.) ASP.NET Software Development Companies India
  • 26.  The term API stands for ‘Application Programming Interface’  In the world of web development the term ‘API’ is synonymous with online web services which client apps can use to retrieve and update data  These online services have had several names/formats over the years such as SOAP, however the current popular choice is to create a REST (or RESTful) API WEB API http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India
  • 27.  http://www.tutorialspoint.com/webservices/  http://www.w3schools.com/xml/xml_services.asp  http://www.c-sharpcorner.com/uploadfile/00a8b7/web-service/  https://www.tutorialspoint.com/asp.net/asp.net_web_services.htm References http://www.ifourtechnolab.com/ ASP.NET Software Development Companies India

Editor's Notes

  1. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  2. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  3. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  4. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  5. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  6. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  7. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  8. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  9. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  10. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  11. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  12. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  13. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  14. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  15. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  16. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  17. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  18. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  19. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  20. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  21. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  22. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  23. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  24. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  25. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  26. Software Outsourcing Company India - http://www.ifourtechnolab.com/
  27. Software Outsourcing Company India - http://www.ifourtechnolab.com/