IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

XML/XSL et SOAP Discussion :

retour xml SOAP en PHP


Sujet :

XML/XSL et SOAP

  1. #1
    Membre habitué
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juillet 2011
    Messages
    135
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Conseil

    Informations forums :
    Inscription : Juillet 2011
    Messages : 135
    Points : 153
    Points
    153
    Par défaut retour xml SOAP en PHP
    Bonjour,

    J'ai un problème avec le retour XML en SOAP.
    J'utilise la technologie PHP.
    En fait mon webservice fonctionne correctement lorsque je retourne un tableau de moins de 12 entrées sinon il me retourne une erreur '["faultstring"]=>
    string(33) "looks like we got no XML document"' .
    Comment faire pour remédier à ce problème ?
    Faut-il augmenter la mémoire?

    Voici un exemple d'un retour de la fonction lorsque ca fonctionne :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn:NavisionWs" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:recupererPrixStockResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>tabProduit</rpc:result><tabProduit enc:itemType="enc:Struct" enc:arraySize="12" xsi:type="enc:Array"><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMVHS1</id><tarif1 xsi:type="xsd:string">.99000000000000000000</tarif1><tarif2 xsi:type="xsd:string">.99000000000000000000</tarif2><tarif3 xsi:type="xsd:string">.99000000000000000000</tarif3><tarif4 xsi:type="xsd:string">.99000000000000000000</tarif4><tarif5 xsi:type="xsd:string">.99000000000000000000</tarif5><tarif6 xsi:type="xsd:string">.95000000000000000000</tarif6><tarif7 xsi:type="xsd:string">.99000000000000000000</tarif7><stock xsi:type="xsd:int">6</stock><stockReel xsi:type="xsd:int">6</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMSG100G</id><tarif1 xsi:type="xsd:string">6.55000000000000000000</tarif1><tarif2 xsi:type="xsd:string">6.55000000000000000000</tarif2><tarif3 xsi:type="xsd:string">6.55000000000000000000</tarif3><tarif4 xsi:type="xsd:string">6.55000000000000000000</tarif4><tarif5 xsi:type="xsd:string">6.55000000000000000000</tarif5><tarif6 xsi:type="xsd:string">5.50000000000000000000</tarif6><tarif7 xsi:type="xsd:string">6.55000000000000000000</tarif7><stock xsi:type="xsd:int">4</stock><stockReel xsi:type="xsd:int">4</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMSG100C</id><tarif1 xsi:type="xsd:string">6.55000000000000000000</tarif1><tarif2 xsi:type="xsd:string">6.55000000000000000000</tarif2><tarif3 xsi:type="xsd:string">6.55000000000000000000</tarif3><tarif4 xsi:type="xsd:string">6.55000000000000000000</tarif4><tarif5 xsi:type="xsd:string">6.55000000000000000000</tarif5><tarif6 xsi:type="xsd:string">5.50000000000000000000</tarif6><tarif7 xsi:type="xsd:string">6.55000000000000000000</tarif7><stock xsi:type="xsd:int">28</stock><stockReel xsi:type="xsd:int">28</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMS600B</id><tarif1 xsi:type="xsd:string">26.59000000000000000000</tarif1><tarif2 xsi:type="xsd:string">26.45000000000000000000</tarif2><tarif3 xsi:type="xsd:string">26.30000000000000000000</tarif3><tarif4 xsi:type="xsd:string">26.25000000000000000000</tarif4><tarif5 xsi:type="xsd:string">25.97000000000000000000</tarif5><tarif6 xsi:type="xsd:string">26.83000000000000000000</tarif6><tarif7 xsi:type="xsd:string">25.30000000000000000000</tarif7><stock xsi:type="xsd:int">14</stock><stockReel xsi:type="xsd:int">14</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMRHS1</id><tarif1 xsi:type="xsd:string">5.53000000000000000000</tarif1><tarif2 xsi:type="xsd:string">5.50000000000000000000</tarif2><tarif3 xsi:type="xsd:string">5.47000000000000000000</tarif3><tarif4 xsi:type="xsd:string">5.40000000000000000000</tarif4><tarif5 xsi:type="xsd:string">5.35000000000000000000</tarif5><tarif6 xsi:type="xsd:string">5.41000000000000000000</tarif6><tarif7 xsi:type="xsd:string">5.00000000000000000000</tarif7><stock xsi:type="xsd:int">0</stock><stockReel xsi:type="xsd:int">1</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMPC302U3</id><tarif1 xsi:type="xsd:string">14.50000000000000000000</tarif1><tarif2 xsi:type="xsd:string">14.50000000000000000000</tarif2><tarif3 xsi:type="xsd:string">14.50000000000000000000</tarif3><tarif4 xsi:type="xsd:string">14.50000000000000000000</tarif4><tarif5 xsi:type="xsd:string">14.50000000000000000000</tarif5><tarif6 xsi:type="xsd:string">10.00000000000000000000</tarif6><tarif7 xsi:type="xsd:string">14.50000000000000000000</tarif7><stock xsi:type="xsd:int">40</stock><stockReel xsi:type="xsd:int">40</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMPB84IW</id><tarif1 xsi:type="xsd:string">30.10000000000000000000</tarif1><tarif2 xsi:type="xsd:string">29.59000000000000000000</tarif2><tarif3 xsi:type="xsd:string">29.10000000000000000000</tarif3><tarif4 xsi:type="xsd:string">28.48000000000000000000</tarif4><tarif5 xsi:type="xsd:string">28.18000000000000000000</tarif5><tarif6 xsi:type="xsd:string">28.95000000000000000000</tarif6><tarif7 xsi:type="xsd:string">27.45000000000000000000</tarif7><stock xsi:type="xsd:int">15</stock><stockReel xsi:type="xsd:int">16</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMPB112IW</id><tarif1 xsi:type="xsd:string">36.50000000000000000000</tarif1><tarif2 xsi:type="xsd:string">35.89000000000000000000</tarif2><tarif3 xsi:type="xsd:string">35.30000000000000000000</tarif3><tarif4 xsi:type="xsd:string">34.54000000000000000000</tarif4><tarif5 xsi:type="xsd:string">34.17000000000000000000</tarif5><tarif6 xsi:type="xsd:string">35.10000000000000000000</tarif6><tarif7 xsi:type="xsd:string">33.28000000000000000000</tarif7><stock xsi:type="xsd:int">13</stock><stockReel xsi:type="xsd:int">14</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMMH200U3</id><tarif1 xsi:type="xsd:string">44.77000000000000000000</tarif1><tarif2 xsi:type="xsd:string">44.27000000000000000000</tarif2><tarif3 xsi:type="xsd:string">43.78000000000000000000</tarif3><tarif4 xsi:type="xsd:string">42.37000000000000000000</tarif4><tarif5 xsi:type="xsd:string">41.91000000000000000000</tarif5><tarif6 xsi:type="xsd:string">41.00000000000000000000</tarif6><tarif7 xsi:type="xsd:string">40.83000000000000000000</tarif7><stock xsi:type="xsd:int">0</stock><stockReel xsi:type="xsd:int">0</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMK200M</id><tarif1 xsi:type="xsd:string">2.99000000000000000000</tarif1><tarif2 xsi:type="xsd:string">2.99000000000000000000</tarif2><tarif3 xsi:type="xsd:string">2.99000000000000000000</tarif3><tarif4 xsi:type="xsd:string">3.85000000000000000000</tarif4><tarif5 xsi:type="xsd:string">3.80000000000000000000</tarif5><tarif6 xsi:type="xsd:string">3.95000000000000000000</tarif6><tarif7 xsi:type="xsd:string">3.80000000000000000000</tarif7><stock xsi:type="xsd:int">118</stock><stockReel xsi:type="xsd:int">119</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMHE135</id><tarif1 xsi:type="xsd:string">19.50000000000000000000</tarif1><tarif2 xsi:type="xsd:string">19.50000000000000000000</tarif2><tarif3 xsi:type="xsd:string">19.50000000000000000000</tarif3><tarif4 xsi:type="xsd:string">19.75000000000000000000</tarif4><tarif5 xsi:type="xsd:string">19.70000000000000000000</tarif5><tarif6 xsi:type="xsd:string">21.51000000000000000000</tarif6><tarif7 xsi:type="xsd:string">19.70000000000000000000</tarif7><stock xsi:type="xsd:int">8</stock><stockReel xsi:type="xsd:int">8</stockReel></item><item xsi:type="enc:Struct"><id xsi:type="xsd:string">ZMGWB8800GTS</id><tarif1 xsi:type="xsd:string">15.00000000000000000000</tarif1><tarif2 xsi:type="xsd:string">15.00000000000000000000</tarif2><tarif3 xsi:type="xsd:string">15.00000000000000000000</tarif3><tarif4 xsi:type="xsd:string">15.00000000000000000000</tarif4><tarif5 xsi:type="xsd:string">15.00000000000000000000</tarif5><tarif6 xsi:type="xsd:string">12.00000000000000000000</tarif6><tarif7 xsi:type="xsd:string">15.00000000000000000000</tarif7><stock xsi:type="xsd:int">17</stock><stockReel xsi:type="xsd:int">17</stockReel></item></tabProduit></ns1:recupererPrixStockResponse></env:Body></env:Envelope>
    Sinon l'erreur :
    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
    object(SoapFault)#3 (10) {
      ["message":protected]=>
      string(33) "looks like we got no XML document"
      ["string":"Exception":private]=>
      string(0) ""
      ["code":protected]=>
      int(0)
      ["file":protected]=>
      string(32) "xxxx.php"
      ["line":protected]=>
      int(22)
      ["trace":"Exception":private]=>
      array(2) {
        [0]=>
        array(6) {
          ["file"]=>
          string(32) "/xxxx.php"
          ["line"]=>
          int(22)
          ["function"]=>
          string(6) "__call"
          ["class"]=>
          string(10) "SoapClient"
          ["type"]=>
          string(2) "->"
          ["args"]=>
          array(2) {
            [0]=>
            string(18) "recupererPrixStock"
            [1]=>
            array(1) {
              [0]=>
              object(stdClass)#1 (2) {
                ["login"]=>
                string(4) "xxxx"
                ["password"]=>
                string(4) "xxxx"
              }
            }
          }
        }
        [1]=>
        array(6) {
          ["file"]=>
          string(32) "/xxx.php"
          ["line"]=>
          int(22)
          ["function"]=>
          string(18) "recupererPrixStock"
          ["class"]=>
          string(10) "SoapClient"
          ["type"]=>
          string(2) "->"
          ["args"]=>
          array(1) {
            [0]=>
            object(stdClass)#1 (2) {
              ["login"]=>
              string(4) "XXXX"
              ["password"]=>
              string(4) "XXXX"
            }
          }
        }
      }
      ["previous":"Exception":private]=>
      NULL
      ["faultstring"]=>
      string(33) "looks like we got no XML document"
      ["faultcode"]=>
      string(6) "Sender"
      ["faultcodens"]=>
      string(39) "http://www.w3.org/2003/05/soap-envelope"
    }

  2. #2
    Membre habitué
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juillet 2011
    Messages
    135
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Conseil

    Informations forums :
    Inscription : Juillet 2011
    Messages : 135
    Points : 153
    Points
    153
    Par défaut
    En utilisant getLastResponse je me suis rendu compte qu'il manque deux caractères à la réponse voici ce que je récupère :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ...xsd:string">15.00000000000000000000</tarif7><stock xsi:type="xsd:int">14</stock><stockReel xsi:type="xsd:int">14</stockReel></item><item xsi:type="SOAP-ENC:Struct"><id xsi:type="xsd:string">ZMF1PLUSSF</id><tarif1 xsi:type="xsd:string">2.67000000000000000000</tarif1><tarif2 xsi:type="xsd:string">2.64000000000000000000</tarif2><tarif3 xsi:type="xsd:string">2.58000000000000000000</tarif3><tarif4 xsi:type="xsd:string">2.44000000000000000000</tarif4><tarif5 xsi:type="xsd:string">2.41000000000000000000</tarif5><tarif6 xsi:type="xsd:string">2.58000000000000000000</tarif6><tarif7 xsi:type="xsd:string">2.39000000000000000000</tarif7><stock xsi:type="xsd:int">0</stock><stockReel xsi:type="xsd:int">0</stockReel></item></tabProduit></ns1:recupererPrixStockResponse></SOAP-ENV:Body></SOAP-ENV:Envelop"
    Il manque "e>" . Comment faire pour y remédier ?

  3. #3
    Membre habitué
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juillet 2011
    Messages
    135
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Conseil

    Informations forums :
    Inscription : Juillet 2011
    Messages : 135
    Points : 153
    Points
    153
    Par défaut
    En fait il y avait un problème d'encodage de mon fichier php.
    Je l'ai ouvert une fois avec le blocnote et ca a modifié l'encodage du coup j'ai dû réencoder le fichier.

    Voila

  4. #4
    Candidat au Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2011
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juin 2011
    Messages : 3
    Points : 3
    Points
    3
    Par défaut Même Problme
    SVP comment vous avez resolu ça je ne vois pas ton code ?!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 3
    Dernier message: 08/07/2013, 18h27
  2. [Web Service] SOAP et PHP no.xml.data.specified
    Par abcd23 dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 08/02/2012, 18h15
  3. [WD15] Webservice -XML de retour (Serveur soap windev sous apache 2.2)
    Par GEOFDEN dans le forum WinDev
    Réponses: 2
    Dernier message: 25/01/2011, 13h39
  4. [SOAP et PHP] Pourquoi soapUI retourne un msg XML structuré et pas PHP ?
    Par gloriarglouglou dans le forum XML/XSL et SOAP
    Réponses: 0
    Dernier message: 02/04/2010, 14h03

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo