SlideShare une entreprise Scribd logo
1  sur  32
Web Services (NSWI145)
Lecture 04: Web Services Description Language

  Martin Nečaský, Ph.D.
  Faculty of Mathematics and Physics
  Charles University in Prague, Czech Republic




                Winter 2011
WSDL Foundations
   Web Services Description Language
   language for describing web service interfaces
    in machine-readable notation
   XML format
   current version: 2.0
     http://www.w3.org/TR/wsdl20
   currently mostly supported version: 1.1
     http://www.w3.org/TR/wsdl
WSDL Foundations

                                     Interface

                                       Port 1
                                Location: URL_1
                                                       Client
                                Transport: SOAP/HTTP
                                                          A
Implementation




                                       Port 2
                                Location: URL_2
                                                       Client
                                Transport: SOAP/JMS
                                                          B



                                       Port 3
                                Location: URL_3
                                                       Client
                                Transport: XML/HTTP
                                                          C




                  Winter 2011
WSDL Document
   types
      XML schema describing XML elements and attributes
   messages
      representation of data exchanged between clients and service
      based on types
   operations
      service capabilities offered to clients
      input and output messages
   port types
      collection of operations
   bindings
      specification of concrete protocol for exchanging messages between service
       and clients which call operations from particular port type
   ports
      single endpoint combining particular binding and network address
   services
      collection of related ports


                         Winter 2011
WSDL Document

Service Description
                             Types

    Abstract               Messages
    Description   =
                           Operations
                           Port Types

                            Bindings
    Concrete
                  =          Ports
    Description
                            Service
WSDL Document Structure
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <documentation> ... </documentation>

  <!-- types (0,1) -->
  <types> ... </types>

  <!-- messages (0,*) -->
  <message> ... </message>

  <!-- port types (0,*) -->
  <portType> ... </portType>

  <!-- bindings (0,*) -->
  <binding> ... </binding>

  <!-- services (0,*) -->
  <service> ... </service>

</definitions>




                    Winter 2011
Types Definitions
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/">
   <documentation> ... </documentation>

  <!-- types (0,1) -->
  <types> ... </types>

  <!-- messages (0,*) -->
  <message> ... </message>

  <!-- port types (0,*) -->
  <portType> ... </portType>

  <!-- bindings (0,*) -->
  <binding> ... </binding>

  <!-- services (0,*) -->
  <service> ... </service>

</definitions>




                    Winter 2011
Types Definition
   describes building blocks of XML messages
    exchanged with service
   any XML schema language with XML syntax
    can be applied inside
     XML Schema (XSD), Relax NG, Schematron, etc.
     XSD preferred and used in practice
   non-XML type system can be applied as well

                                    ? Do you know XSD ?


                Winter 2011
Message Definition
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/">
   <documentation> ... </documentation>

  <!-- types (0,1) -->
  <types> ... </types>

  <!-- messages (0,*) -->
  <message> ... </message>

  <!-- port types (0,*) -->
  <portType> ... </portType>

  <!-- bindings (0,*) -->
  <binding> ... </binding>

  <!-- services (0,*) -->
  <service> ... </service>

</definitions>




                    Winter 2011
Message Definition
   zero or more message definitions
   element message
     defines single message type which can be
      exchanged with the service
     has unique name among all message types
       • attribute name

<message name="[name]">

</message>




                    Winter 2011
Message Definition
   message consists of one or more logical units called
    message parts
   element part
      defines single message part
      has unique name among all parts of the same message
         • attribute name
      is associated with element from the types definition ...
         • attribute element
      ... or with simple or complex type from the types definition
         • attribute type

<message name="[name]">

    <!-- message part (1,*) -->
    <part name="[part-name]" element="[element-ref]" type="[type-ref]" />

</message>



                       Winter 2011
Port Type Definition
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/">
   <documentation> ... </documentation>

  <!-- types (0,1) -->
  <types> ... </types>

  <!-- messages (0,*) -->
  <message> ... </message>

  <!-- port types (0,*) -->
  <portType> ... </portType>

  <!-- bindings (0,*) -->
  <binding> ... </binding>

  <!-- services (0,*) -->
  <service> ... </service>

</definitions>




                    Winter 2011
Port Type Definition
   zero or more port type definitions
   port type encapsulates one or more
    operations
   element portType
     defines single port type
     has unique name among all port types types
       • attribute name
<portType name="[name]">

</portType>




                    Winter 2011
Port Type Definition
   element operation
      defines single operation
      has unique name among all operations in the port type
          • attribute name
   operation consumes input message and produces output
    message, four supported message exchange patterns:
        one-way (in)
        request-response (in-out)
        solicit-response (out-in)
        notification (out)
<portType name="[name]">

    <!-- operation (1,*) -->
    <operation name="[operation-name]" />

</portType>



                      Winter 2011
Port Type Definition
    element input (output, fault)
       specifies input (output, fault) message type
       has unique name among all inputs, outputs and faults within the
        operation (attribute name )
       reference to message type definition (attribute message)
                one-way                                notification
<operation name="[operation-name]">      <operation name="[operation-name]">
  <input name="[param-name]"               <output name="[param-name]"
         message="[message-ref]" />               message="[message-ref]" />
</operation>                             </operation>

           request-response                           solicit-response
<operation name="[operation-name]">      <operation name="[operation-name]">
  <input name="[param-name]"               <output name="[param-name]"
         message="[message-ref]" />               message="[message-ref]" />
  <output name="[param-name]"              <input name="[param-name]"
         message="[message-ref]" />               message="[message-ref]" />
  <fault name="[param-name]"               <fault name="[param-name]"
         message="[message-ref]" />               message="[message-ref]" />
</operation>                             </operation>


                       Winter 2011
Binding Definition
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/">
   <documentation> ... </documentation>

  <!-- types (0,1) -->
  <types> ... </types>

  <!-- messages (0,*) -->
  <message> ... </message>

  <!-- port types (0,*) -->
  <portType> ... </portType>

  <!-- bindings (0,*) -->
  <binding> ... </binding>

  <!-- services (0,*) -->
  <service> ... </service>

</definitions>




                    Winter 2011
Binding Definition
   zero or more binding definitions
   defines message format and protocol details for
    operations and messages in particular port type
   element binding
     defines single binding
     has unique name among all bindings
        • attribute name
     refers to particular port type
        • attribute type

<binding name="[name]" type="[portType-ref]">

</binding>




                    Winter 2011
Binding Definition
   specifies binding for each operation defined in port type
      input and output messages, faults
   element operation
      binding of particular operation
         • referred by attribute name
   element input (output, fault)
      binding of particular input (output, fault) message type
<binding name="[name]" type="[portType-ref]">
  <!-- protocol specific binding information -->

    <operation name="[operation-ref]">
      <!-- protocol specific binding information -->
      <input><!-- protocol specific binding information --></input>
      <output><!-- protocol specific binding information --></output>
      <fault><!-- protocol specific binding information --></fault>
    </operation>

</binding>

                      Winter 2011
Service Definition
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns="http://www.w3.org/ns/wsdl">
   <documentation> ... </documentation>

  <!-- types (0,1) -->
  <types> ... </types>

  <!-- messages (0,*) -->
  <message> ... </message>

  <!-- port types (0,*) -->
  <portType> ... </portType>

  <!-- bindings (0,*) -->
  <binding> ... </binding>

  <!-- services (0,*) -->
  <service> ... </service>

</definitions>




                    Winter 2011
Service Definition
   zero or more service definitions
     i.e. one WSDL document can eventually define more
      interfaces to one or more services
   element service
     defines single service interface + binding to particular
      protocol and physical address
     has unique name among all services
       • attribute name

<service name="[name]">

</service>




                    Winter 2011
Service Definition
   service consists of ports
   element port
      defines service port
      has unique name among all ports of the service
         • attribute name
      refers to particular port type which defines port
       operations and their input and output messages
         • attribute binding
<service name="[name]">

    <port name="[name]" binding="[binding-ref]">
      <!-- protocol specific information -->
    </port>

</service>



                      Winter 2011
Service Definition

                      Message             of                     defined by
                                               Message                        Types
                      Binding


                     input fault output        input fault output



                     Operation            of
     Service                                   Operation
                      Binding


comprises                    comprises               comprises



               has                        of
      Port             Binding                 PortType



                     Winter 2011
More on Bindings
   HTTP
   SOAP 1.1 over HTTP
   SOAP 1.2 over HTTP
   SOAP 1.1 over Java Messaging Service (JMS)
   SOAP 1.2 over Java Messaging Service (JMS)
   SOAP 1.1 over SMTP
   ...


               Winter 2011
SOAP 1.2 Binding
   namespace with SOAP 1.2 specific binding
    extensions
      http://schemas.xmlsoap.org/wsdl/soap12/
      we will use prefix wsoap12
   binding to SOAP 1.2 must start with element
    wsoap12:binding
<binding name="[name]">

    <wsoap12:binding />

</binding>




                      Winter 2011
SOAP 1.2 Binding
   optional default operation style
      specifies default style of each operation (RPC-oriented or document-
       oriented operations)
      attribute style
         • values rpc or document, respectively
         • document is default
   mandatory transport protocol
      URI of particular protocol
      HTTP has http://schemas.xmlsoap.org/soap/http
      attribute transport

<binding name="[name]">

    <wsoap12:binding style="[style]" transport="[protocol-URI]"/>

</binding>




                       Winter 2011
SOAP 1.2 Binding
   RPC-oriented operations
     SOAP body contains only one part – element
      whose name is the name of remote procedure to
      be called
       • contains element for each procedure parameter
   document-oriented operations
     SOAP body contains one or more child elements
      called parts
     part can be anything


                 Winter 2011
SOAP 1.2 Binding
   each operation is further specified by wsoap:operation
    element
      may optionally have own style (rpc or document)
         • attribute style
      if the operation is not determined by its request message we can
       determine it by SOAPAction HTTP header
         • the value of the SOAPAction HTTP header for the operation can be specified in
           attribute soapAction
         • if you want SOAPAction HTTP header to be mandatory for this operation, use
           attribute soapActionRequired

<binding name="[name]">

    <operation name="[operation-ref]">
      <wsoap12:operation style="[style]" soapAction="[action-URI]“
                         soapActionRequired="[boolean]" />
    </operation>

</binding>




                        Winter 2011
SOAP 1.2 Binding
   for each operation input/output we map one or more
    message parts to SOAP body
      element wsoap12:body
      message parts specified by attribute parts
      attribute use indicates whether parts specify schema for messages or
       some other encoding of data to messages is used
         • values literal or encoded, respectively

<binding name="[name]">

    <operation name="[operation-ref]">
      <input>
        <wsoap12:body parts="[part-refs-list]" use="[use]" />
      </input>
    </operation>

</binding>




                      Winter 2011
SOAP 1.2 Binding
   for each operation input/output we can map particular
    message part to SOAP header
      element wsoap12:header
      mandatory attribute message
      message part specified by attribute part
      attribute use indicates whether part specifies schema for messages or
       some other encoding of data to messages is used
         • values literal or encoded, respectively
<binding name="[name]">

    <operation name="[operation-ref]">
      <input>
        <wsoap12:header message="[message-ref]" part="[part-ref]"
                        use="[use]" />
      </input>
    </operation>

</binding>




                       Winter 2011
SOAP 1.2 Binding
   for each operation input/output we can map
    particular faults to SOAP fault
     element wsoap12:fault




               Winter 2011
SOAP 1.2 Binding
   port is extended with physical location of
    SOAP 1.2 endpoint
      element wsoap12:address
         • attribute location

<service name="[name]">

    <port name="[operation-ref]">
      <wsoap12:address location="[URI]" />
    </port>

</binding>




                      Winter 2011
Examples
   PublicContractWS.wsdl
   TripleStoreWS.wsdl




              Winter 2011

Contenu connexe

Tendances

Simple Object Access Protocol
Simple Object Access ProtocolSimple Object Access Protocol
Simple Object Access Protocol
Saatviga Sudhahar
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
Sudharsan S
 

Tendances (20)

Xml parsers
Xml parsersXml parsers
Xml parsers
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentation
 
XSLT
XSLTXSLT
XSLT
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
 
DTD
DTDDTD
DTD
 
web server
web serverweb server
web server
 
Simple Object Access Protocol
Simple Object Access ProtocolSimple Object Access Protocol
Simple Object Access Protocol
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
 
Json
JsonJson
Json
 
Document Object Model (DOM)
Document Object Model (DOM)Document Object Model (DOM)
Document Object Model (DOM)
 
SOAP - Simple Object Access Protocol
SOAP - Simple Object Access ProtocolSOAP - Simple Object Access Protocol
SOAP - Simple Object Access Protocol
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
 
Xslt
XsltXslt
Xslt
 
LDAP
LDAPLDAP
LDAP
 
Intro to JSON
Intro to JSONIntro to JSON
Intro to JSON
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Transforming xml with XSLT
Transforming  xml with XSLTTransforming  xml with XSLT
Transforming xml with XSLT
 
Json
JsonJson
Json
 
Xml
XmlXml
Xml
 

En vedette (6)

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 SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDI
 
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
 
Xml
XmlXml
Xml
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml ppt
Xml pptXml ppt
Xml ppt
 

Similaire à Web Services - WSDL

Soazczxczxzxczxzxvvxvvzvefxcsczxczxcsxczxczxcxzc
SoazczxczxzxczxzxvvxvvzvefxcsczxczxcsxczxczxcxzcSoazczxczxzxczxzxvvxvvzvefxcsczxczxcsxczxczxcxzc
Soazczxczxzxczxzxvvxvvzvefxcsczxczxcsxczxczxcxzc
Imran Gadi
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
sanjoysanyal
 

Similaire à Web Services - WSDL (20)

Wsdl
WsdlWsdl
Wsdl
 
Web services
Web servicesWeb services
Web services
 
WS-Addressing: Enabling Transport-Neutral Message Addressing and Correlation
WS-Addressing: Enabling Transport-Neutral Message Addressing and CorrelationWS-Addressing: Enabling Transport-Neutral Message Addressing and Correlation
WS-Addressing: Enabling Transport-Neutral Message Addressing and Correlation
 
Lecture 16 - Web Services
Lecture 16 - Web ServicesLecture 16 - Web Services
Lecture 16 - 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 overview
Web services overviewWeb services overview
Web services overview
 
Web services
Web servicesWeb services
Web services
 
Webservices
WebservicesWebservices
Webservices
 
SOA and web services
SOA and web servicesSOA and web services
SOA and web services
 
Webservices
WebservicesWebservices
Webservices
 
Web services
Web servicesWeb services
Web services
 
Web service introduction
Web service introductionWeb service introduction
Web service introduction
 
Web Services
Web ServicesWeb Services
Web Services
 
Web Services
Web ServicesWeb Services
Web Services
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 
Soazczxczxzxczxzxvvxvvzvefxcsczxczxcsxczxczxcxzc
SoazczxczxzxczxzxvvxvvzvefxcsczxczxcsxczxczxcxzcSoazczxczxzxczxzxvvxvvzvefxcsczxczxcsxczxczxcxzc
Soazczxczxzxczxzxvvxvvzvefxcsczxczxcsxczxczxcxzc
 
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!.pptx
Web-Services!.pptxWeb-Services!.pptx
Web-Services!.pptx
 
Web Services
Web Services Web Services
Web Services
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
 

Plus de Martin Necasky

Web Services - Business Process Execution Language
Web Services - Business Process Execution LanguageWeb Services - Business Process Execution Language
Web Services - Business Process Execution Language
Martin Necasky
 
Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)
Martin Necasky
 
Web Services - SOAP (part 2)
Web Services - SOAP (part 2)Web Services - SOAP (part 2)
Web Services - SOAP (part 2)
Martin Necasky
 
Otevrene problemy architektury elektronickeho zdravotnictvi
Otevrene problemy architektury elektronickeho zdravotnictviOtevrene problemy architektury elektronickeho zdravotnictvi
Otevrene problemy architektury elektronickeho zdravotnictvi
Martin Necasky
 
Web Services - Introduction
Web Services - IntroductionWeb Services - Introduction
Web Services - Introduction
Martin Necasky
 
Linked Data pro Evropský sociální fond
Linked Data pro Evropský sociální fondLinked Data pro Evropský sociální fond
Linked Data pro Evropský sociální fond
Martin Necasky
 

Plus de Martin Necasky (16)

Linked Open Data - Masaryk University in Brno 8.11.2016
Linked Open Data - Masaryk University in Brno 8.11.2016Linked Open Data - Masaryk University in Brno 8.11.2016
Linked Open Data - Masaryk University in Brno 8.11.2016
 
Tutoriál : Otevřená a propojitelná data veřejné správy
Tutoriál : Otevřená a propojitelná data veřejné správyTutoriál : Otevřená a propojitelná data veřejné správy
Tutoriál : Otevřená a propojitelná data veřejné správy
 
Linked Data for Czech Legislation - 2nd year of our project
Linked Data for Czech Legislation - 2nd year of our projectLinked Data for Czech Legislation - 2nd year of our project
Linked Data for Czech Legislation - 2nd year of our project
 
Linked Open Data for Public Contracts
Linked Open Data for Public ContractsLinked Open Data for Public Contracts
Linked Open Data for Public Contracts
 
Linked Data for Czech Legislation
Linked Data for Czech LegislationLinked Data for Czech Legislation
Linked Data for Czech Legislation
 
Web Services - Business Process Execution Language
Web Services - Business Process Execution LanguageWeb Services - Business Process Execution Language
Web Services - Business Process Execution Language
 
WS-Addressing
WS-AddressingWS-Addressing
WS-Addressing
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Otevrena data v CR - aktualni stav (brezen 2013)
Otevrena data v CR - aktualni stav (brezen 2013)Otevrena data v CR - aktualni stav (brezen 2013)
Otevrena data v CR - aktualni stav (brezen 2013)
 
Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)
 
Web Services - SOAP (part 2)
Web Services - SOAP (part 2)Web Services - SOAP (part 2)
Web Services - SOAP (part 2)
 
Otevrene problemy architektury elektronickeho zdravotnictvi
Otevrene problemy architektury elektronickeho zdravotnictviOtevrene problemy architektury elektronickeho zdravotnictvi
Otevrene problemy architektury elektronickeho zdravotnictvi
 
Vysledek souteze o navrh hospodarneho a funkcniho elektronickeho zdravotnictvi
Vysledek souteze o navrh hospodarneho a funkcniho elektronickeho zdravotnictviVysledek souteze o navrh hospodarneho a funkcniho elektronickeho zdravotnictvi
Vysledek souteze o navrh hospodarneho a funkcniho elektronickeho zdravotnictvi
 
Web Services - Introduction
Web Services - IntroductionWeb Services - Introduction
Web Services - Introduction
 
Techniky a nástroje pro propojená data (Linked Data)
Techniky a nástroje pro propojená data (Linked Data)Techniky a nástroje pro propojená data (Linked Data)
Techniky a nástroje pro propojená data (Linked Data)
 
Linked Data pro Evropský sociální fond
Linked Data pro Evropský sociální fondLinked Data pro Evropský sociální fond
Linked Data pro Evropský sociální fond
 

Dernier

+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...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+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...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Web Services - WSDL

  • 1. Web Services (NSWI145) Lecture 04: Web Services Description Language Martin Nečaský, Ph.D. Faculty of Mathematics and Physics Charles University in Prague, Czech Republic Winter 2011
  • 2. WSDL Foundations  Web Services Description Language  language for describing web service interfaces in machine-readable notation  XML format  current version: 2.0  http://www.w3.org/TR/wsdl20  currently mostly supported version: 1.1  http://www.w3.org/TR/wsdl
  • 3. WSDL Foundations Interface Port 1 Location: URL_1 Client Transport: SOAP/HTTP A Implementation Port 2 Location: URL_2 Client Transport: SOAP/JMS B Port 3 Location: URL_3 Client Transport: XML/HTTP C Winter 2011
  • 4. WSDL Document  types  XML schema describing XML elements and attributes  messages  representation of data exchanged between clients and service  based on types  operations  service capabilities offered to clients  input and output messages  port types  collection of operations  bindings  specification of concrete protocol for exchanging messages between service and clients which call operations from particular port type  ports  single endpoint combining particular binding and network address  services  collection of related ports Winter 2011
  • 5. WSDL Document Service Description Types Abstract Messages Description = Operations Port Types Bindings Concrete = Ports Description Service
  • 6. WSDL Document Structure <?xml version="1.0" encoding="utf-8" ?> <definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <documentation> ... </documentation> <!-- types (0,1) --> <types> ... </types> <!-- messages (0,*) --> <message> ... </message> <!-- port types (0,*) --> <portType> ... </portType> <!-- bindings (0,*) --> <binding> ... </binding> <!-- services (0,*) --> <service> ... </service> </definitions> Winter 2011
  • 7. Types Definitions <?xml version="1.0" encoding="utf-8" ?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"> <documentation> ... </documentation> <!-- types (0,1) --> <types> ... </types> <!-- messages (0,*) --> <message> ... </message> <!-- port types (0,*) --> <portType> ... </portType> <!-- bindings (0,*) --> <binding> ... </binding> <!-- services (0,*) --> <service> ... </service> </definitions> Winter 2011
  • 8. Types Definition  describes building blocks of XML messages exchanged with service  any XML schema language with XML syntax can be applied inside  XML Schema (XSD), Relax NG, Schematron, etc.  XSD preferred and used in practice  non-XML type system can be applied as well ? Do you know XSD ? Winter 2011
  • 9. Message Definition <?xml version="1.0" encoding="utf-8" ?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"> <documentation> ... </documentation> <!-- types (0,1) --> <types> ... </types> <!-- messages (0,*) --> <message> ... </message> <!-- port types (0,*) --> <portType> ... </portType> <!-- bindings (0,*) --> <binding> ... </binding> <!-- services (0,*) --> <service> ... </service> </definitions> Winter 2011
  • 10. Message Definition  zero or more message definitions  element message  defines single message type which can be exchanged with the service  has unique name among all message types • attribute name <message name="[name]"> </message> Winter 2011
  • 11. Message Definition  message consists of one or more logical units called message parts  element part  defines single message part  has unique name among all parts of the same message • attribute name  is associated with element from the types definition ... • attribute element  ... or with simple or complex type from the types definition • attribute type <message name="[name]"> <!-- message part (1,*) --> <part name="[part-name]" element="[element-ref]" type="[type-ref]" /> </message> Winter 2011
  • 12. Port Type Definition <?xml version="1.0" encoding="utf-8" ?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"> <documentation> ... </documentation> <!-- types (0,1) --> <types> ... </types> <!-- messages (0,*) --> <message> ... </message> <!-- port types (0,*) --> <portType> ... </portType> <!-- bindings (0,*) --> <binding> ... </binding> <!-- services (0,*) --> <service> ... </service> </definitions> Winter 2011
  • 13. Port Type Definition  zero or more port type definitions  port type encapsulates one or more operations  element portType  defines single port type  has unique name among all port types types • attribute name <portType name="[name]"> </portType> Winter 2011
  • 14. Port Type Definition  element operation  defines single operation  has unique name among all operations in the port type • attribute name  operation consumes input message and produces output message, four supported message exchange patterns:  one-way (in)  request-response (in-out)  solicit-response (out-in)  notification (out) <portType name="[name]"> <!-- operation (1,*) --> <operation name="[operation-name]" /> </portType> Winter 2011
  • 15. Port Type Definition  element input (output, fault)  specifies input (output, fault) message type  has unique name among all inputs, outputs and faults within the operation (attribute name )  reference to message type definition (attribute message) one-way notification <operation name="[operation-name]"> <operation name="[operation-name]"> <input name="[param-name]" <output name="[param-name]" message="[message-ref]" /> message="[message-ref]" /> </operation> </operation> request-response solicit-response <operation name="[operation-name]"> <operation name="[operation-name]"> <input name="[param-name]" <output name="[param-name]" message="[message-ref]" /> message="[message-ref]" /> <output name="[param-name]" <input name="[param-name]" message="[message-ref]" /> message="[message-ref]" /> <fault name="[param-name]" <fault name="[param-name]" message="[message-ref]" /> message="[message-ref]" /> </operation> </operation> Winter 2011
  • 16. Binding Definition <?xml version="1.0" encoding="utf-8" ?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"> <documentation> ... </documentation> <!-- types (0,1) --> <types> ... </types> <!-- messages (0,*) --> <message> ... </message> <!-- port types (0,*) --> <portType> ... </portType> <!-- bindings (0,*) --> <binding> ... </binding> <!-- services (0,*) --> <service> ... </service> </definitions> Winter 2011
  • 17. Binding Definition  zero or more binding definitions  defines message format and protocol details for operations and messages in particular port type  element binding  defines single binding  has unique name among all bindings • attribute name  refers to particular port type • attribute type <binding name="[name]" type="[portType-ref]"> </binding> Winter 2011
  • 18. Binding Definition  specifies binding for each operation defined in port type  input and output messages, faults  element operation  binding of particular operation • referred by attribute name  element input (output, fault)  binding of particular input (output, fault) message type <binding name="[name]" type="[portType-ref]"> <!-- protocol specific binding information --> <operation name="[operation-ref]"> <!-- protocol specific binding information --> <input><!-- protocol specific binding information --></input> <output><!-- protocol specific binding information --></output> <fault><!-- protocol specific binding information --></fault> </operation> </binding> Winter 2011
  • 19. Service Definition <?xml version="1.0" encoding="utf-8" ?> <definitions xmlns="http://www.w3.org/ns/wsdl"> <documentation> ... </documentation> <!-- types (0,1) --> <types> ... </types> <!-- messages (0,*) --> <message> ... </message> <!-- port types (0,*) --> <portType> ... </portType> <!-- bindings (0,*) --> <binding> ... </binding> <!-- services (0,*) --> <service> ... </service> </definitions> Winter 2011
  • 20. Service Definition  zero or more service definitions  i.e. one WSDL document can eventually define more interfaces to one or more services  element service  defines single service interface + binding to particular protocol and physical address  has unique name among all services • attribute name <service name="[name]"> </service> Winter 2011
  • 21. Service Definition  service consists of ports  element port  defines service port  has unique name among all ports of the service • attribute name  refers to particular port type which defines port operations and their input and output messages • attribute binding <service name="[name]"> <port name="[name]" binding="[binding-ref]"> <!-- protocol specific information --> </port> </service> Winter 2011
  • 22. Service Definition Message of defined by Message Types Binding input fault output input fault output Operation of Service Operation Binding comprises comprises comprises has of Port Binding PortType Winter 2011
  • 23. More on Bindings  HTTP  SOAP 1.1 over HTTP  SOAP 1.2 over HTTP  SOAP 1.1 over Java Messaging Service (JMS)  SOAP 1.2 over Java Messaging Service (JMS)  SOAP 1.1 over SMTP  ... Winter 2011
  • 24. SOAP 1.2 Binding  namespace with SOAP 1.2 specific binding extensions  http://schemas.xmlsoap.org/wsdl/soap12/  we will use prefix wsoap12  binding to SOAP 1.2 must start with element wsoap12:binding <binding name="[name]"> <wsoap12:binding /> </binding> Winter 2011
  • 25. SOAP 1.2 Binding  optional default operation style  specifies default style of each operation (RPC-oriented or document- oriented operations)  attribute style • values rpc or document, respectively • document is default  mandatory transport protocol  URI of particular protocol  HTTP has http://schemas.xmlsoap.org/soap/http  attribute transport <binding name="[name]"> <wsoap12:binding style="[style]" transport="[protocol-URI]"/> </binding> Winter 2011
  • 26. SOAP 1.2 Binding  RPC-oriented operations  SOAP body contains only one part – element whose name is the name of remote procedure to be called • contains element for each procedure parameter  document-oriented operations  SOAP body contains one or more child elements called parts  part can be anything Winter 2011
  • 27. SOAP 1.2 Binding  each operation is further specified by wsoap:operation element  may optionally have own style (rpc or document) • attribute style  if the operation is not determined by its request message we can determine it by SOAPAction HTTP header • the value of the SOAPAction HTTP header for the operation can be specified in attribute soapAction • if you want SOAPAction HTTP header to be mandatory for this operation, use attribute soapActionRequired <binding name="[name]"> <operation name="[operation-ref]"> <wsoap12:operation style="[style]" soapAction="[action-URI]“ soapActionRequired="[boolean]" /> </operation> </binding> Winter 2011
  • 28. SOAP 1.2 Binding  for each operation input/output we map one or more message parts to SOAP body  element wsoap12:body  message parts specified by attribute parts  attribute use indicates whether parts specify schema for messages or some other encoding of data to messages is used • values literal or encoded, respectively <binding name="[name]"> <operation name="[operation-ref]"> <input> <wsoap12:body parts="[part-refs-list]" use="[use]" /> </input> </operation> </binding> Winter 2011
  • 29. SOAP 1.2 Binding  for each operation input/output we can map particular message part to SOAP header  element wsoap12:header  mandatory attribute message  message part specified by attribute part  attribute use indicates whether part specifies schema for messages or some other encoding of data to messages is used • values literal or encoded, respectively <binding name="[name]"> <operation name="[operation-ref]"> <input> <wsoap12:header message="[message-ref]" part="[part-ref]" use="[use]" /> </input> </operation> </binding> Winter 2011
  • 30. SOAP 1.2 Binding  for each operation input/output we can map particular faults to SOAP fault  element wsoap12:fault Winter 2011
  • 31. SOAP 1.2 Binding  port is extended with physical location of SOAP 1.2 endpoint  element wsoap12:address • attribute location <service name="[name]"> <port name="[operation-ref]"> <wsoap12:address location="[URI]" /> </port> </binding> Winter 2011
  • 32. Examples  PublicContractWS.wsdl  TripleStoreWS.wsdl Winter 2011