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

Bibliothèques et frameworks PHP Discussion :

[Web Service][SOAP] Output Data Invalid


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2009
    Messages
    104
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2009
    Messages : 104
    Points : 45
    Points
    45
    Par défaut [Web Service][SOAP] Output Data Invalid
    Bonjour , je suis débutant en Soap.
    je souhaite mettre en place un webservice me permettant de mettre à jour mon flux catalogue et récupérer mes commandes sur un site distant.

    Le problème se pose pour la récupération des commandes.

    J'utilise la librairie Nusoap avec la wsdl qui m'a été fourni. Les attributs demandés ne sont pas identifiés alors qu'ils sont bien dans le array envoyé.

    Mon code

    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
    <?php
    
    require_once('lib/nusoap.php');
    require_once('lib/nusoapmime.php');
    $e_user_id = "2229";
    $orderId = "20120660222901";
    $now = date('Y-m-d\TH:i:s');
    $client = new nusoap_client_mime('laredoute-order.wsdl', true);
    $client->soap_defencoding = 'utf-8';
    $err = $client->getError();
    if ($err) {
    	echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    	echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
    	exit();
    }
    $params = array(
    	'HubID' => '5',
    	'SellerID' => $e_user_id,
    	'MessageDate' => $now,
    	'MessageRelease' => '2.0',
    	'OrderID' => $orderId,
    );
    $result = $client->call('RetrieveSellerOrder_2.0Op', $params);
    if ($client->fault) {
    	echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>';
    } else {
    	
    	$err = $client->getError();
    	if ($err) {
    		echo '<h2>Error</h2><pre>' . $err . '</pre>';
    	}
    	echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
    	
    }
    
    ?>
    Maintenant mon message d'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
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    Array
    (
        [faultcode] => SOAP-ENV:Server
        [faultstring] => This is an operation implementation generated fault
        [faultactor] => 
        [detail] => Array
            (
                [Fault_1.0] => Array
                    (
                        [FaultId] => VALI_010
                        [FaultMessage] => Input data invalid
                        [FaultTrace] =>  [BusinessServices/RCA_Order_2.0/Interface/RetrieveSellerOrder_2.0.process/Start]
    Output data invalid
    	at com.tibco.pe.core.ProcessGroup.a(Unknown Source)
    	at com.tibco.pe.core.ProcessGroup.eval(Unknown Source)
    	at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    	at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    	at com.tibco.pe.core.Job.a(Unknown Source)
    	at com.tibco.pe.core.Job.k(Unknown Source)
    	at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    	at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
    caused by: org.xml.sax.SAXException: validation error: attribute "HubID" is required   ({com.tibco.xml.validation}COMPLEX_E_MISSING_ATTRIBUTE) at /{http://Redcats/Order/SellerOrder/2.0}RetrieveSellerOrderRequest_2.0[1]/parameters[1]/RetrieveSellerOrderRequest_2.0[1]
    com.tibco.xml.validation.exception.MissingAttributesException: attribute "HubID" is required
    	at com.tibco.xml.validation.state.driver.ValidationJazz.a(ValidationJazz.java:821)
    	at com.tibco.xml.validation.state.driver.ValidationJazz.endAttributes(ValidationJazz.java:790)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:87)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:92)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:92)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:129)
    	at com.tibco.xml.xdata.bind.BindingRunner.validate(Unknown Source)
    	at com.tibco.pe.core.ProcessGroup.a(Unknown Source)
    	at com.tibco.pe.core.ProcessGroup.eval(Unknown Source)
    	at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    	at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    	at com.tibco.pe.core.Job.a(Unknown Source)
    	at com.tibco.pe.core.Job.k(Unknown Source)
    	at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    	at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
    validation error: attribute "SellerID" is required   ({com.tibco.xml.validation}COMPLEX_E_MISSING_ATTRIBUTE) at /{http://Redcats/Order/SellerOrder/2.0}RetrieveSellerOrderRequest_2.0[1]/parameters[1]/RetrieveSellerOrderRequest_2.0[1]
    com.tibco.xml.validation.exception.MissingAttributesException: attribute "SellerID" is required
    	at com.tibco.xml.validation.state.driver.ValidationJazz.a(ValidationJazz.java:821)
    	at com.tibco.xml.validation.state.driver.ValidationJazz.endAttributes(ValidationJazz.java:790)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:87)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:92)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:92)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:129)
    	at com.tibco.xml.xdata.bind.BindingRunner.validate(Unknown Source)
    	at com.tibco.pe.core.ProcessGroup.a(Unknown Source)
    	at com.tibco.pe.core.ProcessGroup.eval(Unknown Source)
    	at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    	at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    	at com.tibco.pe.core.Job.a(Unknown Source)
    	at com.tibco.pe.core.Job.k(Unknown Source)
    	at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    	at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
    validation error: attribute "MessageDate" is required   ({com.tibco.xml.validation}COMPLEX_E_MISSING_ATTRIBUTE) at /{http://Redcats/Order/SellerOrder/2.0}RetrieveSellerOrderRequest_2.0[1]/parameters[1]/RetrieveSellerOrderRequest_2.0[1]
    com.tibco.xml.validation.exception.MissingAttributesException: attribute "MessageDate" is required
    	at com.tibco.xml.validation.state.driver.ValidationJazz.a(ValidationJazz.java:821)
    	at com.tibco.xml.validation.state.driver.ValidationJazz.endAttributes(ValidationJazz.java:790)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:87)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:92)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:92)
    	at com.tibco.xml.validation.state.glue.XmlTreeNodeValidationDriver.xmlTreeNode(XmlTreeNodeValidationDriver.java:129)
    	at com.tibco.xml.xdata.bind.BindingRunner.validate(Unknown Source)
    	at com.tibco.pe.core.ProcessGroup.a(Unknown Source)
    	at com.tibco.pe.core.ProcessGroup.eval(Unknown Source)
    	at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    	at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    	at com.tibco.pe.core.Job.a(Unknown Source)
    	at com.tibco.pe.core.Job.k(Unknown Source)
    	at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    	at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
    
    	at com.tibco.xml.xdata.bind.BindingRemarkHandler.assertNoErrors(Unknown Source)
    	at com.tibco.xml.xdata.bind.BindingRunner.validate(Unknown Source)
    	at com.tibco.pe.core.ProcessGroup.a(Unknown Source)
    	at com.tibco.pe.core.ProcessGroup.eval(Unknown Source)
    	at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    	at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    	at com.tibco.pe.core.Job.a(Unknown Source)
    	at com.tibco.pe.core.Job.k(Unknown Source)
    	at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    	at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
    
                        [TrcTs] => 2012-03-21T09:35:44.51+01:00
                        [msgID] => 3a14X5O1n1kDQpZwxhxZLe6HduM=
                    )
    
            )
    
    )
    Il faut savoir que je ne suis pas encore en prod mais en recette et je fais mes tests avec easyPhp

    Dans le message d'erreur en rouge vous verrez les attributs manquants mais qui sont bien transmis en rouge dans mon code.

    Merci d'avance pour votre compréhension.

    Cordialement

  2. #2
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2009
    Messages
    104
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2009
    Messages : 104
    Points : 45
    Points
    45
    Par défaut
    Il semblerait que lorsque je fais ça

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    $params = array(
    	'HubID' => '5',
    	'SellerID' => $e_user_id,
    	'MessageDate' => $now,
    	'MessageRelease' => '2.0',
    	'OrderID' => $orderId,
    );
    $result = $client->call('RetrieveSellerOrder_2.0Op', $params);
    J'envoie des paramètres et non des attributs.
    Si c'est bien le cas comment est ce que je peux envoyer ces infos en tant qu'attributs?

    Merci d'avance

Discussions similaires

  1. [Web Service][SOAP] Webservice Nusoap : page blanche
    Par Harry dans le forum Bibliothèques et frameworks
    Réponses: 2
    Dernier message: 11/01/2007, 16h37
  2. [Web Service][SOAP] Probleme de passage de parametres
    Par _Froggy_ dans le forum Bibliothèques et frameworks
    Réponses: 3
    Dernier message: 22/03/2006, 20h54
  3. [Web Service][SOAP] Problemes d'envoi de donnée
    Par _Froggy_ dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 06/03/2006, 16h08
  4. [Web Service][SOAP] NuSOAP Webservice Sur tous serveurs ?
    Par Harry dans le forum Bibliothèques et frameworks
    Réponses: 2
    Dernier message: 05/01/2006, 14h59

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