Bonjour à tous,

Voilà j'ai un petit soucis avec ce plugin.
En effet, je dois mettre en place un web-service, toutefois je n'arrive pas à récupérer les attribut de mon objet.
J'ai un objet wsPanier, et j'aimerai réussir à récupérer son libelle.

Voici mes fichiers :

app.yml :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/11-App
 
# default values
all:
  enable_soap_parameter: off
soap:
  enable_soap_parameter: on
  ck_web_service_plugin:
    wsdl: %SF_WEB_DIR%\ecoApi.wsdl
    handler: ecoApiHandler
  soap_options:
    classmap:
      wsPanier: wsPanier
soaptest:
  enable_soap_parameter: on
  ck_web_service_plugin:
    wsdl: %SF_WEB_DIR%\ecoApi.wsdl
    handler: ckSoapHandler
    soap_options:
      classmap:
        wsPanier: wsPanier
wsPanier.class.php :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
class wsPanier
{
  protected $id;
  protected $libelle;
  protected $codeClient;
  protected $codePanier;
  protected $dateCreation;
  protected $dateModification;
  protected $dateExpiration;
 
 
  /**
   * Getters
   */
 
  public function getId() {
    return $this->id;
  }
 
  public function getLibelle() {
    return $this->libelle;
  }
 
  public function getCodeClient() {
    return $this->codeClient;
  }
 
  public function getCodePanier() {
    return $this->codePanier;
  }
 
  public function getDateCreation() {
    return $this->dateCreation;
  }
 
  public function getDateModification() {
    return $this->dateModification;
  }
 
  public function getDateExpiration() {
    return $this->dateExpiration;
  }
 
  /**
   * Setters
   */
 
  public function setId(int $id) {
    $this->id = $id;
  }
 
  public function setLibelle($libelle) {
    $this->libelle = $libelle;
  }
 
  public function setCodeClient(string $codeClient) {
    $this->codeClient = $codeClient;
  }
 
  public function setCodePanier(string $codePanier) {
    $this->codePanier = $codePanier;
  }
 
  public function setDateCreation(int $dateCreation) {
    $this->dateCreation = $dateCreation;
  }
 
  public function setDateModification(int $dateModification) {
    $this->dateModification = $dateModification;
  }
 
  public function setDateExpiration(int $dateExpiration) {
    $this->dateExpiration = $dateExpiration;
  }
}
actions.php :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class APIActions extends sfActions
{
  /**
   *
   * Méthode de création d'un panier
   *
   * @WSMethod(webservice='ecoApi')
   * 
   * @param string $libelle Le libellé
   * @return wsPanier Le Panier
   */
  public function executeCreerPanier($requete) {
    $panier = new wsPanier();
    $panier->setLibelle("test");
    $this->result = $panier;
  }
}
APIActionsTest.php :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
 
$app = 'ecommerce';
$debug = true;
 
include_once(dirname(__FILE__).'/../../bootstrap/soaptest.php');
 
$options = array(
  'classmap' => array(
    'wsPanier' => 'wsPanier',
  ),
);
 
$c = new ckTestSoapClient($options);
$c->api_creerpanier('test')
  ->isFaultEmpty()
//  ->isType('', 'wsPanier')
  ->isType('libelle.libelle', 'string');
 
?>
Lorsque je lance mon test via l'invite de commande :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
symfony test:functional ecommerce APIActions
Je récupère ceci dans la fenêtre de l'invite :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
not ok 1 - response object libelle.libelle is a string
#     Failed test (.\plugins\ckWebServicePlugin\lib\test\ckTestSoapClient.class.
php at line 371)
#       variable isn't a 'string' it's a 'NULL'
not ok 2 - response object libelle.libelle is a string
#     Failed test (.\plugins\ckWebServicePlugin\lib\test\ckTestSoapClient.class.
php at line 371)
#       variable isn't a 'string' it's a 'NULL'
1..2
# Looks like you failed 2 tests of 2.
Alors que normalement à la place de la variable 'string' il y a la chaîne "test" et non NULL.

Pourriez-vous m'aider à me sortir de ce mauvais pas ?

Merci d'avance.