SlideShare a Scribd company logo
   There are things applications need very often. So why make
    these over and over again?

   Web services can offer application-components like:
    currency conversion, weather reports, or even language
    translation as services.

   Unlike traditional client/server models, such as a Web
    server/Web page system, Web services do not provide the
    user with a GUI.

   Web services instead share business logic, data and
    processes through a programmatic interface across a
    network.

   Developers can then add the Web service to a GUI (such as a
    Web page or an executable program) to offer specific
    functionality to users.
There are two primary ways to create services
in ASP.NET.

   Web services based on the ASP.NET (.asmx)
    model.
   Microsoft Windows Communication
    Foundation (WCF) model
This is a familiar ASP.NET programming
experience for services that are meant to be
exclusively bound to Hypertext Transfer
Protocol (HTTP) and hosted by Microsoft
Internet Information Services (IIS) and
ASP.NET.
   The term Web services describes a standardized way of
    integrating Web-based applications using the
    XML, SOAP, WSDL and UDDI open standards over an
    Internet protocol backbone.

   XML is used to tag the data, SOAP is used to transfer
    the data, WSDL is used for describing the services
    available and UDDI is used for listing what services are
    available.

   Used primarily as a means for businesses to
    communicate with each other and with clients, Web
    services allow organizations to communicate data
    without intimate knowledge of each other's IT systems
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 Extensible Markup Language (XML) for its
message format, and usually relies on other
Application Layer protocols, most notably Hypertext
Transfer Protocol (HTTP) and Simple Mail Transfer
Protocol (SMTP), for message negotiation and
transmission.
   WSDL stands for Web Services Description
    Language
   WSDL is an XML-based language for locating
    and describing Web services.
   An XML-formatted language used to describe a
    Web service's capabilities as collections of
    communication endpoints capable of
    exchanging messages.
   WSDL is an integral part of UDDI, an XML-
    based worldwide business registry.
ASP.NET wrap the web service code as a proxy object. This object will
know how to expose your Web service. This includes deserializing SOAP
requests, executing your .NET Framework code, and serializing your
response to be sent back to the requesting client as a SOAP message.
   An ASP.NET XML Web service is a class you
    write that inherits from the class System.Web
    .Services.WebService.

   Create a Web service project through the Add
    New Project ->ASP.NET Web Service application.

   This generates a separate project for your Web
    service application that has a structure similar to
    a Web site. This includes a folder for App_Data, a
    Web.config file, and related elements.
   Like a Web page, Web services are exposed through
    Uniform Resource Locators (URLs).

   This means your domain name followed by a page
    name, as in http://MyDomain/MyService.asmx.

   Web service like a class that only exposes methods. Each
    Web service can expose multiple methods.

   The page for an XML Web service is defined by the .asmx
    file. This file is nothing more than a simple text file that is
    used as a pointer to the code of your Web service.

   @ WebService directive points to the actual code for the Web
    service.
   This class can be used to provide information about
    your Web service. This information is used by clients
    that wish to reference the Web service.

   You can provide both a namespace and a description
    of your Web service by applying the WebService
    attribute and parameters to your class.

   The description parameter is simply text you write to
    identify the high-level intent of your Web service.

   The namespace parameter sets the namespace of your
    Web service. This should be a domain name under
    your control. Visual Studio uses the tempuri.org
    namespace as filler until you define your actual namespace.
   You apply this attribute to any public method in your
    Web service class you wish to expose as part of your
    service.
   The WebMethod attribute class has a number of
    constructors used for various groups of parameter
    values.
    1.  enableSessionState
    2.  transactionOption
    3.  cacheDuration
    4.  bufferResponse
   You can also use the Serializable attribute class to tag
    class outside your Web service. This ensures any public
    members of the class can be serialized by ASP.NET.
   The first step is setting a Web reference from your
    Web site to the given service. You do this by
    right-clicking your project file and choosing Set
    Web Reference.

   This opens the Add Web Reference dialog box.
    Here, you define the URL of your service, select
    the given service (.asmx file), and set a name for
    the reference. This name will be used by the
    generated proxy class to define the namespace for
    accessing your service.
   This model allows developers to write services
    that can be configured to work with a variety of
    hosts, protocols, and clients. For example, you
    might want to write a service that is accessed
    over Transmission Control Protocol (TCP)
    instead of HTTP.

   If that same service code needed to be called
    over both HTTP and TCP, you had to write and
    host it twice. This is one of the many problems
    WCF is meant to solve.
   WCF is a unifying programming model.

   It is meant to define a singular way for writing
    services and thereby unify things like Web services
    (.asmx), .NET Remoting, Message Queue
    (MSMQ), Enterprise Services (COM+), and Web
    Services Enhancements (WSE).

   It does not replace these technologies on an
    individual basis. Instead, it provides a single
    programming model that you can use to take
    advantage of all of these items at once.

   With WCF, you can create a single service that can be
    exposed as HTTP, TCP, named pipes, and so on.

   You also have multiple hosting options.
   WCF Service is a program that exposes a
    collection of Endpoints.
   Each Endpoint is a portal for communicating
    with the world.
   All the WCF communications are take place
    through end point. End point consists of three
    components.
   Address
   Binding
   Contract
   Basically URL, specifies where this WCF
    service is hosted .

   Client will use this url to connect to the service.

   http://localhost:8090/MyService/SimpleCalcu
    lator.svc
   Binding will describes how client will communicate
    with service. There are different protocols available for
    the WCF to communicate to the Client. You can
    mention the protocol type based on your requirements.

   The following table gives some list of protocols
    supported by WCF binding.
   Collection of operation that specifies what the
    endpoint will communicate with outside world.

   Usually name of the Interface will be mentioned in
    the Contract, so the client application will be aware
    of the operations which are exposed to the client.

   There are multiple contract types in
    WCF, including service contract, operation
    contract, message contract, fault contract (for error
    handling), and data contract.

   These contracts work together to indicate to the
    client code consuming the WCF service how it
    should define communication messages
   Creating and consuming WCF services follow a
    standard set of programming tasks. You follow
    these steps every time you wish to create and
    consume a new WCF service:

    1. Define the service contract.
    2. Implement (or write) the service contract.
    3. Configure a service endpoint(s).
    4. Host the service in an application.
    5. Reference and call the service from a client
       application.
   In WCF programming, you first define an
    interface and decorate that interface with a
    number of attributes.

   These WCF attribute classes are found in the
    System.ServiceModel namespace.

   These attribute classes are used to define the
    details of the contract that your service will
    have with calling clients.
   ServiceContract : The ServiceContract attribute class has
    parameters for setting things like whether the service
    requires a session (SessionMode), the namespace, the
    name of the contract, the return contract on a two-way
    contract (CallbackContract), and more.
   OperationContract : attribute class to set things like
    whether the contract does not return a reply
    (IsOneWay), the message-level security (ProtectionLevel), or
    whether the method supports asynchronous calls
    (AsyncPattern).
   DataContract : The DataContract attribute class is used to
    mark types you write (classes, enumerations, structures)
   DataMembers : The DataMember attribute class is used to
    mark individual fields and properties that you want to
    serialize. You use this class in conjunction with the
    Data-Contract class.
   Visual Studio and ASP.NET define the WCF Service
    Application project template. This template defines a
    Web project that serves to host the WCF service. This
    project contains a reference to
    System.ServiceModel.dll, which contains the WCF classes.
    Creating a new instance of this project template will also
    generate a default service (Service1.svc) and a related
    contract file IService1.vb or .cs).
Finally, a WCF Service application is automatically configured
to be hosted in IIS and expose a standard HTTP endpoint. This
information can be found inside the <system.servicemodel>
section of the Web.config file.

<system.serviceModel>
<services>
    <service name="NorthwindServices.Service1"
    behaviorConfiguration="NorthwindServices.Service1Behavior">
    <endpoint address="" binding="wsHttpBinding"
    contract="NorthwindServices.IService1">
    <identity>
    <dns value="localhost"/>
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding"
      contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
  <serviceBehaviors>
      <behavior name="NorthwindServices.Service1Behavior">
      <!-- to avoid disclosing metadata information, set the value below
        to false
      and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging
        purposes, set the
      value below to true. Set to false before deployment to avoid
        disclosing
      exception information -->
      <serviceDebug includeExceptionDetailInFaults="false"/>
      </behavior>
  </serviceBehaviors>
</behaviors>
</system.serviceModel>

More Related Content

What's hot

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
Rob Windsor
 
Web Service Basics and NWS Setup
Web Service  Basics and NWS SetupWeb Service  Basics and NWS Setup
Web Service Basics and NWS Setup
Northeastern University
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
Peter R. Egli
 
Beginning with wcf service
Beginning with wcf serviceBeginning with wcf service
Beginning with wcf serviceBinu Bhasuran
 
SOAP, WSDL and UDDI
SOAP, WSDL and UDDISOAP, WSDL and UDDI
SOAP, WSDL and UDDI
Shahid Shaik
 
Xml web services
Xml web servicesXml web services
Xml web servicesRaghu nath
 
Java Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIJava Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDI
IMC Institute
 
Web services
Web servicesWeb services
Web services
Akshay Ballarpure
 
Description of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDIDescription of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDI
TUSHAR VARSHNEY
 
Webservices
WebservicesWebservices
Webservices
Gerard Sylvester
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentation
guest0df6b0
 
SOAP, UDDI, WSDL. XML definitions
SOAP, UDDI, WSDL. XML definitions SOAP, UDDI, WSDL. XML definitions
SOAP, UDDI, WSDL. XML definitions
Wish Mrt'xa
 
Web Services
Web ServicesWeb Services
Web Services
F K
 
Introduction to webservices
Introduction to webservicesIntroduction to webservices
Introduction to webservices
Gagandeep Singh
 
Web Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETWeb Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETPonraj
 
web service technologies
web service technologiesweb service technologies
web service technologies
Yash Darak
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Services
ecosio GmbH
 

What's hot (20)

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
 
Web Service Basics and NWS Setup
Web Service  Basics and NWS SetupWeb Service  Basics and NWS Setup
Web Service Basics and NWS Setup
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
 
Beginning with wcf service
Beginning with wcf serviceBeginning with wcf service
Beginning with wcf service
 
SOAP, WSDL and UDDI
SOAP, WSDL and UDDISOAP, WSDL and UDDI
SOAP, WSDL and UDDI
 
Xml web services
Xml web servicesXml web services
Xml web services
 
Java Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIJava Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDI
 
Web services
Web servicesWeb services
Web services
 
Wcf development
Wcf developmentWcf development
Wcf development
 
Description of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDIDescription of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDI
 
Webservices
WebservicesWebservices
Webservices
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentation
 
SOAP, UDDI, WSDL. XML definitions
SOAP, UDDI, WSDL. XML definitions SOAP, UDDI, WSDL. XML definitions
SOAP, UDDI, WSDL. XML definitions
 
Web Services
Web ServicesWeb Services
Web Services
 
Introduction to webservices
Introduction to webservicesIntroduction to webservices
Introduction to webservices
 
Web Services
Web ServicesWeb Services
Web Services
 
Web Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETWeb Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NET
 
web service technologies
web service technologiesweb service technologies
web service technologies
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Services
 
Web services
Web servicesWeb services
Web services
 

Viewers also liked

HTML & JAVA Script
HTML & JAVA ScriptHTML & JAVA Script
HTML & JAVA Script
Nitesh Gupta
 
Chapter 5 notes
Chapter 5 notesChapter 5 notes
Chapter 5 notesmstraile
 
Introduction to Cascading Style Sheets
Introduction to Cascading Style SheetsIntroduction to Cascading Style Sheets
Introduction to Cascading Style Sheets
Tushar Joshi
 
02 sm3 xml_xp_03
02 sm3 xml_xp_0302 sm3 xml_xp_03
02 sm3 xml_xp_03Niit Care
 
Working with xml data
Working with xml dataWorking with xml data
Working with xml dataaspnet123
 
Java Script Introduction
Java Script IntroductionJava Script Introduction
Java Script Introduction
university of education,Lahore
 
Vb script
Vb scriptVb script
Vb script
mcatahir947
 
8 introduction to_java_script
8 introduction to_java_script8 introduction to_java_script
8 introduction to_java_script
Vijay Kalyan
 

Viewers also liked (8)

HTML & JAVA Script
HTML & JAVA ScriptHTML & JAVA Script
HTML & JAVA Script
 
Chapter 5 notes
Chapter 5 notesChapter 5 notes
Chapter 5 notes
 
Introduction to Cascading Style Sheets
Introduction to Cascading Style SheetsIntroduction to Cascading Style Sheets
Introduction to Cascading Style Sheets
 
02 sm3 xml_xp_03
02 sm3 xml_xp_0302 sm3 xml_xp_03
02 sm3 xml_xp_03
 
Working with xml data
Working with xml dataWorking with xml data
Working with xml data
 
Java Script Introduction
Java Script IntroductionJava Script Introduction
Java Script Introduction
 
Vb script
Vb scriptVb script
Vb script
 
8 introduction to_java_script
8 introduction to_java_script8 introduction to_java_script
8 introduction to_java_script
 

Similar to Web services

Application integration framework & Adaptor ppt
Application integration framework & Adaptor pptApplication integration framework & Adaptor ppt
Application integration framework & Adaptor ppt
Aditya Negi
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
Abhi Arya
 
Java web services
Java web servicesJava web services
Java web services
kumar gaurav
 
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
Advancio
 
SOA & WCF
SOA & WCFSOA & WCF
SOA & WCF
Dev Raj Gautam
 
Web programming
Web programmingWeb programming
Web programming
sowfi
 
Moving from webservices to wcf services
Moving from webservices to wcf servicesMoving from webservices to wcf services
Moving from webservices to wcf services
Binu Bhasuran
 
dotNETfinal.ppt
dotNETfinal.pptdotNETfinal.ppt
dotNETfinal.ppt
ssuser041880
 
dotNETfinal.ppt
dotNETfinal.pptdotNETfinal.ppt
dotNETfinal.ppt
almkjdfhjjfa
 
Dot net training-navimumbai
Dot net training-navimumbaiDot net training-navimumbai
Dot net training-navimumbai
vibrantuser
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)ipower softwares
 
WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)
Prashanth Shivakumar
 
Build Message-Based Web Services for SOA
Build Message-Based Web Services for SOABuild Message-Based Web Services for SOA
Build Message-Based Web Services for SOA
Jeffrey Hasan
 
webservices overview
webservices overviewwebservices overview
webservices overviewelliando dias
 
Web services concepts, protocols and development
Web services concepts, protocols and developmentWeb services concepts, protocols and development
Web services concepts, protocols and development
ishmecse13
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487Bat Programmer
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
VijayapriyaP1
 
UNIT 3 web iiiBCA.pptx
UNIT 3 web iiiBCA.pptxUNIT 3 web iiiBCA.pptx
UNIT 3 web iiiBCA.pptx
VijayKumarLokanadam
 

Similar to Web services (20)

Application integration framework & Adaptor ppt
Application integration framework & Adaptor pptApplication integration framework & Adaptor ppt
Application integration framework & Adaptor ppt
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
 
Java web services
Java web servicesJava web services
Java web services
 
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
 
SOA & WCF
SOA & WCFSOA & WCF
SOA & WCF
 
Web programming
Web programmingWeb programming
Web programming
 
KO on Web Services
KO on Web ServicesKO on Web Services
KO on Web Services
 
Moving from webservices to wcf services
Moving from webservices to wcf servicesMoving from webservices to wcf services
Moving from webservices to wcf services
 
dotNETfinal.ppt
dotNETfinal.pptdotNETfinal.ppt
dotNETfinal.ppt
 
dotNETfinal.ppt
dotNETfinal.pptdotNETfinal.ppt
dotNETfinal.ppt
 
Dot net training-navimumbai
Dot net training-navimumbaiDot net training-navimumbai
Dot net training-navimumbai
 
Web Services
Web Services Web Services
Web Services
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)
 
WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)
 
Build Message-Based Web Services for SOA
Build Message-Based Web Services for SOABuild Message-Based Web Services for SOA
Build Message-Based Web Services for SOA
 
webservices overview
webservices overviewwebservices overview
webservices overview
 
Web services concepts, protocols and development
Web services concepts, protocols and developmentWeb services concepts, protocols and development
Web services concepts, protocols and development
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
UNIT 3 web iiiBCA.pptx
UNIT 3 web iiiBCA.pptxUNIT 3 web iiiBCA.pptx
UNIT 3 web iiiBCA.pptx
 

More from aspnet123

Deploying configuring caching
Deploying configuring cachingDeploying configuring caching
Deploying configuring cachingaspnet123
 
Mobile application
Mobile applicationMobile application
Mobile applicationaspnet123
 
Globalization and accessibility
Globalization and accessibilityGlobalization and accessibility
Globalization and accessibilityaspnet123
 
Monitoring, troubleshooting,
Monitoring, troubleshooting,Monitoring, troubleshooting,
Monitoring, troubleshooting,aspnet123
 
Programming web application
Programming web applicationProgramming web application
Programming web applicationaspnet123
 
User controls
User controlsUser controls
User controlsaspnet123
 
Custom controls
Custom controlsCustom controls
Custom controlsaspnet123
 
Connected data classes
Connected data classesConnected data classes
Connected data classesaspnet123
 
Disconnected data
Disconnected dataDisconnected data
Disconnected dataaspnet123
 
Introducing asp
Introducing aspIntroducing asp
Introducing aspaspnet123
 

More from aspnet123 (11)

Deploying configuring caching
Deploying configuring cachingDeploying configuring caching
Deploying configuring caching
 
Mobile application
Mobile applicationMobile application
Mobile application
 
Profile
ProfileProfile
Profile
 
Globalization and accessibility
Globalization and accessibilityGlobalization and accessibility
Globalization and accessibility
 
Monitoring, troubleshooting,
Monitoring, troubleshooting,Monitoring, troubleshooting,
Monitoring, troubleshooting,
 
Programming web application
Programming web applicationProgramming web application
Programming web application
 
User controls
User controlsUser controls
User controls
 
Custom controls
Custom controlsCustom controls
Custom controls
 
Connected data classes
Connected data classesConnected data classes
Connected data classes
 
Disconnected data
Disconnected dataDisconnected data
Disconnected data
 
Introducing asp
Introducing aspIntroducing asp
Introducing asp
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 

Web services

  • 1.
  • 2. There are things applications need very often. So why make these over and over again?  Web services can offer application-components like: currency conversion, weather reports, or even language translation as services.  Unlike traditional client/server models, such as a Web server/Web page system, Web services do not provide the user with a GUI.  Web services instead share business logic, data and processes through a programmatic interface across a network.  Developers can then add the Web service to a GUI (such as a Web page or an executable program) to offer specific functionality to users.
  • 3. There are two primary ways to create services in ASP.NET.  Web services based on the ASP.NET (.asmx) model.  Microsoft Windows Communication Foundation (WCF) model
  • 4. This is a familiar ASP.NET programming experience for services that are meant to be exclusively bound to Hypertext Transfer Protocol (HTTP) and hosted by Microsoft Internet Information Services (IIS) and ASP.NET.
  • 5. The term Web services describes a standardized way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone.  XML is used to tag the data, SOAP is used to transfer the data, WSDL is used for describing the services available and UDDI is used for listing what services are available.  Used primarily as a means for businesses to communicate with each other and with clients, Web services allow organizations to communicate data without intimate knowledge of each other's IT systems
  • 6. 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 Extensible Markup Language (XML) for its message format, and usually relies on other Application Layer protocols, most notably Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission.
  • 7. WSDL stands for Web Services Description Language  WSDL is an XML-based language for locating and describing Web services.  An XML-formatted language used to describe a Web service's capabilities as collections of communication endpoints capable of exchanging messages.  WSDL is an integral part of UDDI, an XML- based worldwide business registry.
  • 8. ASP.NET wrap the web service code as a proxy object. This object will know how to expose your Web service. This includes deserializing SOAP requests, executing your .NET Framework code, and serializing your response to be sent back to the requesting client as a SOAP message.
  • 9. An ASP.NET XML Web service is a class you write that inherits from the class System.Web .Services.WebService.  Create a Web service project through the Add New Project ->ASP.NET Web Service application.  This generates a separate project for your Web service application that has a structure similar to a Web site. This includes a folder for App_Data, a Web.config file, and related elements.
  • 10. Like a Web page, Web services are exposed through Uniform Resource Locators (URLs).  This means your domain name followed by a page name, as in http://MyDomain/MyService.asmx.  Web service like a class that only exposes methods. Each Web service can expose multiple methods.  The page for an XML Web service is defined by the .asmx file. This file is nothing more than a simple text file that is used as a pointer to the code of your Web service.  @ WebService directive points to the actual code for the Web service.
  • 11. This class can be used to provide information about your Web service. This information is used by clients that wish to reference the Web service.  You can provide both a namespace and a description of your Web service by applying the WebService attribute and parameters to your class.  The description parameter is simply text you write to identify the high-level intent of your Web service.  The namespace parameter sets the namespace of your Web service. This should be a domain name under your control. Visual Studio uses the tempuri.org namespace as filler until you define your actual namespace.
  • 12. You apply this attribute to any public method in your Web service class you wish to expose as part of your service.  The WebMethod attribute class has a number of constructors used for various groups of parameter values. 1. enableSessionState 2. transactionOption 3. cacheDuration 4. bufferResponse  You can also use the Serializable attribute class to tag class outside your Web service. This ensures any public members of the class can be serialized by ASP.NET.
  • 13. The first step is setting a Web reference from your Web site to the given service. You do this by right-clicking your project file and choosing Set Web Reference.  This opens the Add Web Reference dialog box. Here, you define the URL of your service, select the given service (.asmx file), and set a name for the reference. This name will be used by the generated proxy class to define the namespace for accessing your service.
  • 14. This model allows developers to write services that can be configured to work with a variety of hosts, protocols, and clients. For example, you might want to write a service that is accessed over Transmission Control Protocol (TCP) instead of HTTP.  If that same service code needed to be called over both HTTP and TCP, you had to write and host it twice. This is one of the many problems WCF is meant to solve.
  • 15. WCF is a unifying programming model.  It is meant to define a singular way for writing services and thereby unify things like Web services (.asmx), .NET Remoting, Message Queue (MSMQ), Enterprise Services (COM+), and Web Services Enhancements (WSE).  It does not replace these technologies on an individual basis. Instead, it provides a single programming model that you can use to take advantage of all of these items at once.  With WCF, you can create a single service that can be exposed as HTTP, TCP, named pipes, and so on.  You also have multiple hosting options.
  • 16.
  • 17. WCF Service is a program that exposes a collection of Endpoints.  Each Endpoint is a portal for communicating with the world.  All the WCF communications are take place through end point. End point consists of three components.  Address  Binding  Contract
  • 18. Basically URL, specifies where this WCF service is hosted .  Client will use this url to connect to the service.  http://localhost:8090/MyService/SimpleCalcu lator.svc
  • 19. Binding will describes how client will communicate with service. There are different protocols available for the WCF to communicate to the Client. You can mention the protocol type based on your requirements.  The following table gives some list of protocols supported by WCF binding.
  • 20. Collection of operation that specifies what the endpoint will communicate with outside world.  Usually name of the Interface will be mentioned in the Contract, so the client application will be aware of the operations which are exposed to the client.  There are multiple contract types in WCF, including service contract, operation contract, message contract, fault contract (for error handling), and data contract.  These contracts work together to indicate to the client code consuming the WCF service how it should define communication messages
  • 21.
  • 22.
  • 23. Creating and consuming WCF services follow a standard set of programming tasks. You follow these steps every time you wish to create and consume a new WCF service: 1. Define the service contract. 2. Implement (or write) the service contract. 3. Configure a service endpoint(s). 4. Host the service in an application. 5. Reference and call the service from a client application.
  • 24. In WCF programming, you first define an interface and decorate that interface with a number of attributes.  These WCF attribute classes are found in the System.ServiceModel namespace.  These attribute classes are used to define the details of the contract that your service will have with calling clients.
  • 25. ServiceContract : The ServiceContract attribute class has parameters for setting things like whether the service requires a session (SessionMode), the namespace, the name of the contract, the return contract on a two-way contract (CallbackContract), and more.  OperationContract : attribute class to set things like whether the contract does not return a reply (IsOneWay), the message-level security (ProtectionLevel), or whether the method supports asynchronous calls (AsyncPattern).  DataContract : The DataContract attribute class is used to mark types you write (classes, enumerations, structures)  DataMembers : The DataMember attribute class is used to mark individual fields and properties that you want to serialize. You use this class in conjunction with the Data-Contract class.
  • 26. Visual Studio and ASP.NET define the WCF Service Application project template. This template defines a Web project that serves to host the WCF service. This project contains a reference to System.ServiceModel.dll, which contains the WCF classes. Creating a new instance of this project template will also generate a default service (Service1.svc) and a related contract file IService1.vb or .cs).
  • 27. Finally, a WCF Service application is automatically configured to be hosted in IIS and expose a standard HTTP endpoint. This information can be found inside the <system.servicemodel> section of the Web.config file. <system.serviceModel> <services> <service name="NorthwindServices.Service1" behaviorConfiguration="NorthwindServices.Service1Behavior"> <endpoint address="" binding="wsHttpBinding" contract="NorthwindServices.IService1"> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services>
  • 28. <behaviors> <serviceBehaviors> <behavior name="NorthwindServices.Service1Behavior"> <!-- to avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>