% CVSId: $Id: adulau.tex,v 1.1 2003/02/07 17:51:53 adulau Exp adulau $
%
%
%     Copyright (c)  2001,2002,2003  Alexandre Dulaunoy <adulau@foo.be>
%     Permission is granted to copy, distribute and/or modify this document
%     under the terms of the GNU Free Documentation License, Version 1.2
%     or any later version published by the Free Software Foundation;
%     with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
%     A copy of the license is included in the section entitled "GNU
%     Free Documentation License".
\documentclass[%
pdf,
%nocolorBG,
colorBG,
slideColor,
%slideBW,
%draft,
frames
%azure
%contemporain
%nuancegris
%troispoints
%lignesbleues
%darkblue
%alienglow
%autumn
]{prosper}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage{pslatex}
\usepackage[french,english]{babel}
%\usepackage{listings}

\begin{document}
\title{Sécurité en ingénierie du Logiciel}
\subtitle{Le cadre des Web Services \\ {\em Partie 9 : Introduction à 'Web Services Definition Language' (WSDL)}}
\author{Alexandre Dulaunoy}
\email{adulau@foo.be}
\maketitle

\begin{slide}{Agenda}
\begin{itemize}
\item Introduction
\item WSDL types
\item WSDL messages
\item WSDL porttype
\item WSDL binding
\item WSDL port
\item Conclusion
\end{itemize}
\end{slide}

\begin{slide}{Introduction}
\begin{itemize}
\item Spécification W3C 
\item Web Services Description Language (WSDL) 1.1 (2001),
\item Descriptions des services web par un langage décrit en XML, 
\item Pas uniquement SOAP mais aussi HTTP GET et POST,
\item API disponible en Java/Perl/Python...,
\end{itemize}
Peut aussi servir de générateur d'applications clients mais attention.
\end{slide}

\begin{slide}{WSDL structure/définition}
Eléments XML pour WSDL : 
\begin{itemize}
\item types,\\ (types rencontrés dans le Web Service)
\item message,\\ (description des appels distants (paramètres, retour,...))
\item porttype,\\ (description des opérations à réaliser en utilisant des messages)
\item binding,\\ (lie le porttype avec un type de protocole  (p.ex. SOAP)
\item port,\\ (lie un point d'entrée réseau avec un binding)
\item service, (plusieurs entrées indirects)\\
\end{itemize}
\end{slide}

\begin{slide}{WSDL types}
Partie de définition des types disponibles :\\
<?xml version="1.0"?>\\
<definitions name="StockQuote"\\

targetNamespace="http://example.com/stockquote.wsdl"\\
          xmlns:tns="http://example.com/stockquote.wsdl"\\
          xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"\\
          xmlns:xsd1="http://example.com/stockquote/schema"\\
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"\\
          xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"\\
          xmlns="http://schemas.xmlsoap.org/wsdl/">\\

\end{slide}

\begin{slide}{WSDL types}
\tiny{
    <types>\\
       <schema targetNamespace="http://example.com/stockquote/schema"\\
              xmlns="http://www.w3.org/2000/10/XMLSchema">\\
           <complexType name="TimePeriod">
              <all>\\
                  <element name="startTime" type="xsd:timeInstant"/>\\
                  <element name="endTime" type="xsd:timeInstant"/>\\
              </all>\\
           </complexType>\\
           <complexType name="ArrayOfFloat">\\
              <complexContent>\\
                  <restriction base="soapenc:Array">\\
                      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:float[]"/>\\
                  </restriction>
              </complexContent>
           </complexType>
       </schema>
    </types>\\
}
\end{slide}

\begin{slide}{WSDL message}
Description des paramètres et types des paramètres, valeur de retour,...\\
    <message name="GetTradePricesInput">\\
        <part name="tickerSymbol" element="xsd:string"/>\\
        <part name="timePeriod" element="xsd1:TimePeriod"/>\\
    </message>\\

    <message name="GetTradePricesOutput">\\
        <part name="result" type="xsd1:ArrayOfFloat"/>\\
        <part name="frequency" type="xsd:float"/>\\
    </message>
\end{slide}

\begin{slide}{WSDL porttype}
Description des opérations.
\begin{itemize}
\item One-way,
\item Request-response,
\item Solicit-response,
\item Notification
\end{itemize}
\end{slide}

\begin{slide}{WSDL porttype}
    <portType name="StockQuotePortType">\\
        <operation name="GetLastTradePrice" parameterOrder="tickerSymbol timePeriod frequency">\\
           <input message="tns:GetTradePricesInput"/>\\
           <output message="tns:GetTradePricesOutput"/>\\
        </operation>\\
    </portType>\\
\end{slide}

\begin{slide}{WSDL binding}
Description de la liaison entre un porttype et un ou des protocoles : (ex. SOAP RPC sur HTTP)\\
\tiny{
    <binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">\\
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>\\
        <operation name="GetTradePrices">\\
           <soap:operation soapAction="http://example.com/GetTradePrices"/>\\
           <input>\\
               <soap:body use="encoded" namespace="http://example.com/stockquote"\\
                          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>\\
           </input>\\
           <output>\\
               <soap:body use="encoded" namespace="http://example.com/stockquote"\\
                          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>\\
           </output>\\
        </operation>\\
    </binding>\\
}
\end{slide}

\begin{slide}{WSDL service}
Description des points des "endpoint" :\\

    <service name="StockQuoteService">\\
        <documentation>My first service</documentation>\\
        <port name="StockQuotePort" binding="tns:StockQuoteBinding">\\
           <soap:address location="http://example.com/stockquote"/>\\
        </port>\\
    </service>\\
\end{slide}

\begin{slide}{WSDL service - description HTTP GET/POST}
WSDL peut aussi décrire des simple GET et POST :\\
les valeurs sont part1=1, part2=2, part3=3\\
\begin{itemize}
\item port1: GET, URL="http://example.com/o1/A1B2/3"
\item port2: GET, URL="http://example.com/o1?p1=1\&p2=2\&p3=3"
\item port3: POST, URL="http://example.com/o1", PAYLOAD="p1=1\&p2=2\&p3=3"
\end{itemize}
Retour est une image gif ou un image jpeg.
\end{slide}

\begin{slide}{WSDL service - description HTTP GET/POST}
\tiny{
<definitions .... >\\
    <message name="m1">\\
        <part name="part1" type="xsd:string"/>\\
        <part name="part2" type="xsd:int"/>\\
        <part name="part3" type="xsd:string"/>\\
    </message>\\

    <message name="m2">\\
        <part name="image" type="xsd:binary"/>\\
    </message>\\

    <portType name="pt1">\\
        <operation name="o1">\\
           <input message="tns:m1"/>\\
           <output message="tns:m2"/>\\
        </operation>\\
    </portType>\\
	
}
\end{slide}

\begin{slide}{WSDL service - description HTTP GET/POST}
\tiny{
   <service name="service1">\\
        <port name="port1" binding="tns:b1">\\
           <http:address location="http://example.com/"/>\\
        </port>\\
        <port name="port2" binding="tns:b2">\\
           <http:address location="http://example.com/"/>\\
        </port>\\
        <port name="port3" binding="tns:b3">\\
             <http:address location="http://example.com/"/>\\
        </port>\\
    </service>\\

    <binding name="b1" type="pt1">\\
        <http:binding verb="GET"/>\\
        <operation name="o1">\\
           <http:operation location="o1/A(part1)B(part2)/(part3)"/>\\
           <input>\\
               <http:urlReplacement/>\\
           </input>\\
           <output>\\
               <mime:content type="image/gif"/>\\
               <mime:content type="image/jpeg"/>\\
           </output>\\
        </operation>\\
    </binding>\\

}
\end{slide}

\begin{slide}{WSDL service - description HTTP GET/POST}
\tiny{
    <binding name="b2" type="pt1">\\
        <http:binding verb="GET"/>\\
        <operation name="o1">\\
           <http:operation location="o1"/>\\
           <input>\\
               <http:urlEncoded/>\\
           </input>\\
           <output>\\
               <mime:content type="image/gif"/>\\
               <mime:content type="image/jpeg"/>\\
           </output>\\
        </operation>\\
    </binding>\\

    <binding name="b3" type="pt1">\\
        <http:binding verb="POST"/>\\
        <operation name="o1">\\
           <http:operation location="o1"/>\\
           <input>\\
               <mime:content type="application/x-www-form-urlencoded"/>\\
           </input>\\
           <output>\\
               <mime:content type="image/gif"/>\\
               <mime:content type="image/jpeg"/>\\
           </output>\\
        </operation>\\
    </binding>\\
</definitions>\\

}
\end{slide}

\begin{slide}{Q\&R}
\begin{itemize}
\item adulau@foo.be
\item http://www.foo.be/cours/securite-webservices/
\item 3B12 DCC2 82FA 2931 2F5B  709A 09E2 CD49 44E6 CBCD
\end{itemize}
\end{slide}

\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t%%% End: 
