Bonjour,
Je tente d'appeler une fonction à partir d'un webservice. Je pense appeler correctement la fonction mais voici ce qu'elle me retourne :
voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 <br /> <b>Fatal error</b>: Uncaught SoapFault exception: [HTTP] Bad Request in /mnt/sda5/wwwroot/myfile.php:40 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://62.105.9...', 'http://Holidayb...', 2, 0) #1 [internal function]: SoapClient->__call('AvailabilitySea...', Array) #2 /mnt/sda5/wwwroot/myfile.php(40): SoapClient->AvailabilitySearch(Array) #3 {main} thrown in <b>/mnt/sda5/wwwroot/myfile.php</b> on line <b>40</b><br />
voici ce que retourne getLastRequest :
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$wsdl = "http://62.105........."; $client = new SoapClient($wsdl, array("trace"=>true,'soap_version'=> SOAP_1_2)); $xml = '<?xml version="1.0" encoding="utf-8" ?> <HB_AvailabilitySearch> <Control lang="en"> <Brand>EC</Brand> <Country>FR</Country> <SessionId/> <AffiliateId>XXXXX</AffiliateId> </Control> <CampsiteQuery siteCode="MC013"> <ArrivalDate>2010-05-01</ArrivalDate> <Duration durationType="Nights">4</Duration> <NumberOfAdults>2</NumberOfAdults> <NumberOfChildren>0</NumberOfChildren> <NumberOfInfants>0</NumberOfInfants> </CampsiteQuery> </HB_AvailabilitySearch>'; $soapvar = new SoapVar($xml, XSD_ANYXML); $reponse = $client->AvailabilitySearch(array("docRQ"=>$soapvar));
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 ?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://Holidaybreak.com/"><env:Body><ns1:AvailabilitySearch><ns1:docRQ><?xml version="1.0" encoding="utf-8" ?> <HB_AvailabilitySearch> <Control lang="en"> <Brand>EC</Brand> <Country>FR</Country> <SessionId/> <AffiliateId>OCTEC</AffiliateId> </Control> <CampsiteQuery siteCode="MC013"> <ArrivalDate>2010-05-01</ArrivalDate> <Duration durationType="Nights">4</Duration> <NumberOfAdults>2</NumberOfAdults> <NumberOfChildren>0</NumberOfChildren> <NumberOfInfants>0</NumberOfInfants> </CampsiteQuery> </HB_AvailabilitySearch></ns1:docRQ></ns1:AvailabilitySearch></env:Body></env:Envelope>
et getlastresponse :
Merci pour votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Sender</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to read request. ---> There is an error in XML document (17, 45). ---> The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>
Partager