Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Utilisation de la classe SoapClient pour des messages XML, non WSDL
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
fredo  
View profile   Translate to Translated (View Original)
 More options Oct 8, 6:45 am
Newsgroups: fr.comp.lang.php
Followup-To: fr.comp.lang.php
From: fredo <frederic.mas...@gmail.com>
Date: 08 Oct 2009 10:45:00 GMT
Subject: Utilisation de la classe SoapClient pour des messages XML, non WSDL
Bonjour,

J'essaye sans succès de me connecter à un service web (SOAP 1.1)  qui
utilise des messages XML sans fichier WSDL.

Toute la documentation que j'ai pu trouver est basée sur du WSDL, il y
a très peu de documentation sur les envois directe de message XML.

Voici le code :

$location = 'https://test.reservit.com/testota';
$login = 'foo';
$password = 'bar';
$CompanyName = 'baz';
$ChainCode = '00';

$request = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
  <OTA_HotelSearchRQ Version="2006" MaxResponses="100"
        xmlns="http://www.opentravel.org/OTA/2006/01"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <POS>
        <Source>
          <RequestorID Type="2" ID="0">
               <CompanyName>'.$CompanyName.'</CompanyName>
          </RequestorID>
        </Source>
  </POS>
  <Criteria>
     <Criterion>
     <!-- On which   list of hotels, or channel I make the search -->
          <HotelRef  ChainCode="'.$ChainCode.'" />
     </Criterion>
     <Criterion>
           <!-- The period ! which is mandatory -->
           <StayDateRange Start="2009-10-06" End="2009-10-15" />
     </Criterion>
  </Criteria>
  </OTA_HotelSearchRQ>
 </soap:Body>
</soap:Envelope>';

$client = new SoapClient(null, array('location' => $location,
                                     'uri'      => 'http://
www.opentravel.org/OTA/2006/01',
                                     'style'    => SOAP_DOCUMENT,
                                     'use'      => SOAP_LITERAL,
                                     'login'    => $login,
                                     'password' => $password,
                                     'trace' => 1));

$client->__doRequest($request, $location, 'POST', SOAP_1_1);

echo "<br>\nRequestHeaders :<br>\n" . $client->__getLastRequestHeaders
() . "<br>\n";
echo "<br>\nRequest :<br>\n" . $client->__getLastRequest() . "<br>\n";
echo "<br>\nResponseHeaders :<br>\n" . $client-

>__getLastResponseHeaders() . "<br>\n";

echo "<br>\nResponse :<br>\n" . $client->__getLastResponse() . "<br>
\n";

La méthode "__getLastRequestHeaders" affiche l'en-tête envoyé.

Ce qui m'étonne, c'est que la méthode "__getLastRequest" ne retourne
rien.

Est-ce que j'utilise correctement le méthode "__doRequest" ?

Merci de vos réponses.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google