Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
teknopedia

teknopedia

teknopedia

teknopedia

teknopedia

teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. Web Services Description Language - Teknopedia
Web Services Description Language - Teknopedia

Il Web Services Description Language (WSDL) è un linguaggio formale in formato XML utilizzato per la creazione di "documenti" per la descrizione di Web service.

Descrizione

[modifica | modifica wikitesto]

Mediante WSDL può essere infatti descritta l'interfaccia pubblica di un Web service (ovvero una descrizione basata su XML) che indica come interagire con un determinato servizio.

Un "documento" WSDL contiene infatti, relativamente al Web service descritto, informazioni su:

  • cosa può essere utilizzato (le "operazioni" messe a disposizione dal servizio)
  • come sfruttare tale raggruppamento (specificando il protocollo di comunicazione da utilizzare per accedere al servizio, il formato dei messaggi accettati in input e restituiti in output dal servizio ed i dati correlati) ovvero i "vincoli" (in inglese bindings) del servizio;
  • dove si trova il servizio nella rete (cosiddetto endpoint o port del servizio che solitamente corrisponde all'indirizzo — in formato URI — che rende disponibile il Web service)

Le operazioni supportate dal Web service ed i messaggi che è possibile scambiare con lo stesso sono descritti in maniera astratta e quindi non collegati ad uno specifico protocollo di rete e ad uno specifico formato.

Il WSDL è solitamente utilizzato in combinazione con SOAP e XML Schema per rendere disponibili Web service su reti aziendali o su internet: un programma client può, infatti, "leggere" il documento WSDL relativo ad un Web service per determinare quali siano le funzioni messe a disposizione sul server e attraverso il protocollo SOAP utilizzare una o più delle funzioni elencate dal WSDL.

La versione 1.1 di WSDL non è stata adottata come standard dal World Wide Web Consortium (W3C).

Il 26 giugno 2007 la versione 2.0 è stata promossa a standard ufficiale (in forma di "raccomandazione") dal W3C.

Stili e codifiche

[modifica | modifica wikitesto]

Un documento WSDL può essere caratterizzato da quattro distinte combinazioni di stili e codifiche:[1][2]

  • RPC/encoded: ha una struttura molto semplice, ma non è approvato dallo standard WS-I ed è complesso da validare.
  • RPC/literal: è di nuovo molto semplice ed è privo di informazioni di codifica sui tipi. Soddisfa inoltre le specifiche WS-I, ma resta complesso da validare.
  • Document/encoded: non è conforme alle specifiche WS-I e non è praticamente mai utilizzato.
  • Document/literal: anche qui mancano le informazioni di codifica sui tipi ed è conforme alle specifiche WS-I (con alcune restrizioni). Può inoltre essere facilmente controllato con un validatore XML. Tuttavia, la struttura del WSDL diventa più complessa e verbosa. Infine, nel messaggio SOAP non è prevista l'indicazione del metodo utilizzato, per cui può risultare più complesso (o impossibile) capire quale operazione è richiesta dal client.

Esempio di documento WSDL 2.0

[modifica | modifica wikitesto]
<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://www.w3.org/ns/wsdl" 
             xmlns:tns="http://www.example.com/wsdl20sample" 
             xmlns:whttp="http://www.w3.org/ns/wsdl/http"
             xmlns:wsoap="http://www.w3.org/ns/wsdl/soap"
             targetNamespace="http://www.example.com/wsdl20sample">

<!-- Abstract types -->
   <types>
      <xs:schema xmlns="http://www.example.com/wsdl20sample"
                 xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                 targetNamespace="http://www.example.com/wsdl20sample">
                 
         <xs:element name="request">
            <xs:complexType>
               <xs:sequence>
                  <xs:element name="header" maxOccurs="unbounded">
                     <xs:complexType>
                        <xs:simpleContent>
                           <xs:extension base="xs:string">
                              <xs:attribute name="name" type="xs:string" use="required"/>
                           </xs:extension>
                        </xs:simpleContent>
                     </xs:complexType>
                  </xs:element>
                  <xs:element name="body" type="xs:anyType" minOccurs="0"/>
               </xs:sequence>
               <xs:attribute name="method" type="xs:string" use="required"/>
               <xs:attribute name="uri" type="xs:anyURI" use="required"/>
            </xs:complexType>
         </xs:element>
         
         <xs:element name="response">
            <xs:complexType>
               <xs:sequence>
                  <xs:element name="header" maxOccurs="unbounded">
                     <xs:complexType>
                        <xs:simpleContent>
                           <xs:extension base="xs:string">
                              <xs:attribute name="name" type="xs:string" use="required"/>
                           </xs:extension>
                        </xs:simpleContent>
                     </xs:complexType>
                  </xs:element>
                  <xs:element name="body" type="xs:anyType" minOccurs="0"/>
               </xs:sequence>
               <xs:attribute name="status-code" type="xs:anySimpleType" use="required"/>
               <xs:attribute name="response-phrase" use="required"/>
            </xs:complexType>
         </xs:element>
      </xs:schema>
   </types>

<!-- Abstract interfaces -->
   <interface name="RESTfulInterface">
      <fault name="ClientError" element="tns:response"/>
      <fault name="ServerError" element="tns:response"/>
      <fault name="Redirection" element="tns:response"/>
      <operation name="Get" pattern="http://www.w3.org/ns/wsdl/in-out">
         <input messageLabel="GetMsg" element="tns:request"/>
         <output messageLabel="SuccessfulMsg" element="tns:response"/>
      </operation>
      <operation name="Post" pattern="http://www.w3.org/ns/wsdl/in-out">
         <input messageLabel="PostMsg" element="tns:request"/>
         <output messageLabel="SuccessfulMsg" element="tns:response"/>
      </operation>
      <operation name="Put" pattern="http://www.w3.org/ns/wsdl/in-out">
         <input messageLabel="PutMsg" element="tns:request"/>
         <output messageLabel="SuccessfulMsg" element="tns:response"/>
      </operation>
      <operation name="Delete" pattern="http://www.w3.org/ns/wsdl/in-out">
         <input messageLabel="DeleteMsg" element="tns:request"/>
         <output messageLabel="SuccessfulMsg" element="tns:response"/>
      </operation>
   </interface>

<!-- Concrete Binding Over HTTP -->
   <binding name="RESTfulInterfaceHttpBinding" interface="tns:RESTfulInterface" 
            type="http://www.w3.org/ns/wsdl/http">
      <operation ref="tns:Get" whttp:method="GET"/>
      <operation ref="tns:Post" whttp:method="POST" 
                 whttp:inputSerialization="application/x-www-form-urlencoded"/>
      <operation ref="tns:Put" whttp:method="PUT" 
                 whttp:inputSerialization="application/x-www-form-urlencoded"/>
      <operation ref="tns:Delete" whttp:method="DELETE"/>
   </binding>
   
<!-- Concrete Binding with SOAP-->
   <binding name="RESTfulInterfaceSoapBinding" interface="tns:RESTfulInterface" 
            type="http://www.w3.org/ns/wsdl/soap" 
            wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/"
            wsoap:mepDefault="http://www.w3.org/2003/05/soap/mep/request-response">
      <operation ref="tns:Get" />
      <operation ref="tns:Post" />
      <operation ref="tns:Put" />
      <operation ref="tns:Delete" />
   </binding>
   
<!-- Web Service offering endpoints for both the bindings-->
   <service name="RESTfulService" interface="tns:RESTfulInterface">
      <endpoint name="RESTfulServiceRestEndpoint" 
                binding="tns:RESTfulInterfaceHttpBinding" 
                address="http://www.example.com/rest/"/>
      <endpoint name="RESTfulServiceSoapEndpoint" 
                binding="tns:RESTfulInterfaceSoapBinding" 
                address="http://www.example.com/soap/"/>
   </service>
</description>

Note

[modifica | modifica wikitesto]
  1. ^ (EN) Russel Butek, Which style of WSDL should I use?, su ibm.com, IBM, 31 ottobre 2003. URL consultato il 10 settembre 2018 (archiviato il 23 agosto 2018).
  2. ^ Marco Parente, WSDL: stili e codifiche, su HTML.it (archiviato il 22 gennaio 2014).

Voci correlate

[modifica | modifica wikitesto]
  • Web service
  • SOAP
  • UDDI
  • Web Application Description Language
  • Business Process Execution Language

Collegamenti esterni

[modifica | modifica wikitesto]
  • Specifiche WSDL 1.1, su w3.org.
  • WSDL 2.0 Specification Part 0: Primer (Latest Version), su w3.org.
  • WSDL 2.0 Specification Part 1: Core (Latest Version), su w3.org.
  • WSDL 2.0 Specification Part 2: Adjuncts (Latest Version), su w3.org.
  • Web Services Description Working Group, su w3.org.
  • XML protocol activity, su w3.org.
  • WSDL Validator, su validwsdl.com.
Controllo di autoritàGND (DE) 4681739-6
  Portale Internet: accedi alle voci di Teknopedia che trattano di internet
Estratto da "https://it.wikipedia.org/w/index.php?title=Web_Services_Description_Language&oldid=146525972"

  • Indonesia
  • English
  • Français
  • 日本語
  • Deutsch
  • Italiano
  • Español
  • Русский
  • فارسی
  • Polski
  • 中文
  • Nederlands
  • Português
  • العربية
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022