SlideShare una empresa de Scribd logo
1 de 28
   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>

Más contenido relacionado

La actualidad más candente

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.5Rob Windsor
 
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 UDDIShahid 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 UDDIIMC Institute
 
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 & UDDITUSHAR VARSHNEY
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentationguest0df6b0
 
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 ServicesF K
 
Introduction to webservices
Introduction to webservicesIntroduction to webservices
Introduction to webservicesGagandeep 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 technologiesYash 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 Servicesecosio GmbH
 

La actualidad más candente (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
 

Destacado

HTML & JAVA Script
HTML & JAVA ScriptHTML & JAVA Script
HTML & JAVA ScriptNitesh 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 SheetsTushar 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
 
8 introduction to_java_script
8 introduction to_java_script8 introduction to_java_script
8 introduction to_java_scriptVijay Kalyan
 

Destacado (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 a Web services

Application integration framework & Adaptor ppt
Application integration framework & Adaptor pptApplication integration framework & Adaptor ppt
Application integration framework & Adaptor pptAditya Negi
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorialAbhi Arya
 
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 & SOAPUIAdvancio
 
Web programming
Web programmingWeb programming
Web programmingsowfi
 
Moving from webservices to wcf services
Moving from webservices to wcf servicesMoving from webservices to wcf services
Moving from webservices to wcf servicesBinu Bhasuran
 
Dot net training-navimumbai
Dot net training-navimumbaiDot net training-navimumbai
Dot net training-navimumbaivibrantuser
 
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 SOAJeffrey 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 developmentishmecse13
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487Bat Programmer
 

Similar a 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
 

Más de 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
 

Más de 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
 

Último

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 

Último (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

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>