Modification contenu vue et ajout vue code
This commit is contained in:
parent
9c3173efa8
commit
3e42324096
82
application/views/scripts/index/code.phtml
Normal file
82
application/views/scripts/index/code.phtml
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<h2>PHP</h2>
|
||||||
|
<pre>
|
||||||
|
$wsdl = 'http://hostname/service?wsdl';
|
||||||
|
$options = array(
|
||||||
|
'login' => $login,
|
||||||
|
'password' => md5($login.'|'.$password)
|
||||||
|
);
|
||||||
|
$client = new SoapClient($wsdl, $options);
|
||||||
|
|
||||||
|
$parameters = new stdClass();
|
||||||
|
$parameters->siret = '552144503';
|
||||||
|
$parameters->id = 0;
|
||||||
|
$parameters->forceVerif = false;
|
||||||
|
$result = $client->getIdentite($parameters);
|
||||||
|
|
||||||
|
var_dump($result);
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<h2>Perl</h2>
|
||||||
|
<pre>
|
||||||
|
Générer les méthodes à partir du WSDL grâce à l'utilitaire wsdl2perl
|
||||||
|
|
||||||
|
wsdl2perl -p Entreprise -b . http://hostname/service?wsdl
|
||||||
|
|
||||||
|
Modifier pour inclure l'authentification http basique
|
||||||
|
|
||||||
|
-> proxy('http://login:md5(login|password)@hostname/service')
|
||||||
|
|
||||||
|
Puis intérroger le service,
|
||||||
|
|
||||||
|
use EntrepriseInterfaces::entreprisesService::entreprisesPort;
|
||||||
|
use EntrepriseElements::IdentiteRequest;
|
||||||
|
my $service = EntrepriseInterfaces::entreprisesService::entreprisesPort->new();
|
||||||
|
my $params = EntrepriseElements::IdentiteRequest->new({
|
||||||
|
siret => '34838984200017',
|
||||||
|
});
|
||||||
|
my $result = $service->getIdentite($params);
|
||||||
|
die $result if not $result;
|
||||||
|
print $result;
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<h2>Python</h2>
|
||||||
|
<pre>
|
||||||
|
|
||||||
|
from SOAPpy import Config, HTTPTransport, SOAPAddress, WSDL
|
||||||
|
|
||||||
|
class myHTTPTransport(HTTPTransport):
|
||||||
|
username = None
|
||||||
|
passwd = None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setAuthentication(cls,u,p):
|
||||||
|
cls.username = u
|
||||||
|
cls.passwd = p
|
||||||
|
|
||||||
|
def call(self, addr, data, namespace, soapaction=None, encoding=None,
|
||||||
|
http_proxy=None, config=Config):
|
||||||
|
|
||||||
|
if not isinstance(addr, SOAPAddress):
|
||||||
|
addr=SOAPAddress(addr, config)
|
||||||
|
|
||||||
|
if self.username != None:
|
||||||
|
addr.user = self.username+":"+self.passwd
|
||||||
|
|
||||||
|
return HTTPTransport.call(self, addr, data, namespace, soapaction,
|
||||||
|
encoding, http_proxy, config)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
wsdlFile = 'http://localhost/soap/wsdl/'
|
||||||
|
myHTTPTransport.setAuthentication('USERNAME', 'PASSWORD')
|
||||||
|
server = WSDL.Proxy(wsdlFile, transport=myHTTPTransport)
|
||||||
|
print server.ApiVersion()
|
||||||
|
|
||||||
|
|
||||||
|
</pre>
|
@ -1,15 +1,51 @@
|
|||||||
|
<h2>WSDL</h2>
|
||||||
|
<p>Télécharger le WSDL</p>
|
||||||
|
<p>Le fichier est accessible sans authentification.</p>
|
||||||
|
|
||||||
|
<h2>Authentification</h2>
|
||||||
|
<p>
|
||||||
|
Le WebService utilise une authentification http basique.
|
||||||
|
Il s'agit donc de transmettre comme paramtères d'authentification
|
||||||
|
</p>
|
||||||
|
<p>http://{login}:{password}@url</p>
|
||||||
|
<p>password est une chaine construite de cette façon md5({login}|{pass})</p>
|
||||||
|
<p>ou le login est l'identifiant fournit et pass le mot de passe fournit.</p>
|
||||||
|
<h2>Compatibilté</h2>
|
||||||
|
<p>Notre service web a été testé avec ces langages/librairies</p>
|
||||||
|
<ul>
|
||||||
|
<li>PHP : PHP5 SOAP Extension</li>
|
||||||
|
<li>Perl : SOAP::Lite</li>
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
<li>Python : SOAPpy</li>
|
||||||
|
<li>C and C++ : gSOAP et Axis2</li>
|
||||||
|
<li>C# : .Net Framework</li>
|
||||||
|
<li>Ruby : SOAP::WSDLDriver</li>
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Liste des opérations :</h2>
|
||||||
|
<ol>
|
||||||
|
<?php foreach ($this->serviceMethods as $method) {?>
|
||||||
|
<li><b><?=$method['name']?></b></li>
|
||||||
|
<?php } ?>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<h2>Détails :</h2>
|
||||||
<?php foreach ($this->serviceMethods as $method) {?>
|
<?php foreach ($this->serviceMethods as $method) {?>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<p><?=$this->docMethod($method)?><p>
|
<p><?=$this->docMethod($method)?><p>
|
||||||
<div style="border:1px solid;">
|
<div><u>Description : </u></div>
|
||||||
Description : <?=$this->docDescription($method)?>
|
<div><?=$this->docDescription($method)?></div>
|
||||||
</div>
|
|
||||||
<div style="border:1px solid;">
|
<div><u>Paramètres : </u></div>
|
||||||
Paramètres : <?=$this->docParameter($method['params'], $this->serviceTypes)?>
|
<div><?=$this->docParameter($method['params'], $this->serviceTypes)?></div>
|
||||||
</div>
|
|
||||||
<div style="border:1px solid;">
|
<div><u>Retour : </u></div>
|
||||||
Retour : <?=$this->docReturn($method['return'], $this->serviceTypes)?>
|
<div><?=$this->docReturn($method['return'], $this->serviceTypes)?></div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user