SOAP-ERROR: Encoding: The object does not have the "FinalBookingDate" property

Before starting, I know these errors mean that I had to define the FinalBookingDate property, but just keep reading and you will understand my point.

URL: http://bestbuyhotel1.cangooroo.net/ws/2013/ClientBackOffice_b.asmx?op=getBookingList I first tested SoapUi and I managed to get the list I need: soapui

And in php I can get this answer: SOAP-ERROR: Encoding: object has no 'FinalBookingDate' property

SoapClient from php:

$params = array('soap_version'   => SOAP_1_2, 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, 'encoding'=>'UTF-8', 'trace' => 1, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_NONE, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS);
$client = new \SoapClient('http://bestbuyhotel1.cangooroo.net/ws/2013/ClientBackOffice_b.asmx?wsdl', $params);

And then, the code to retrieve the data:

    /*
    $query = array(
        'InitialServiceDate' => '2015-01-20',
        'InitialBookingDate' => '2015-01-20',
        'FinalBookingDate' => '2015-01-20',
        'FinalServiceDate' => '2015-01-20',
        'CreationUserId' => 1338,
        'CityId' => 4166,
        'ServiceTypes' => array('eServiceType' => 'HOTEL')
    );
     */
    $query = array(
        'InitialBookingDate' => '2015-01-20',
        'ServiceTypes' => array('eServiceType' => 'HOTEL')
    );
    $args = new \stdClass;
    $args->credential = new \stdClass;
    $args->credential->UserName = $conn['userPass']['usr'];
    $args->credential->Password = $conn['userPass']['pass'];
    $args->searchBookingCriteria = new \stdClass;
    $args->searchBookingCriteria->InitialBookingDate = '2015-01-20';
    $args->searchBookingCriteria->ServiceTypes = new \stdClass;
    $args->searchBookingCriteria->ServiceTypes->eServiceType = 'HOTEL';

    //$args = array('credential'=>$credentials, 'searchBookingCriteria' => $query);
    $data = $conn['client']->getBookingList($args);
    print_r($data);
    exit;

, $args getBookingList, , , ( ) . , , , , -, .

: - SoapClient, ? SoapUI ? ?

: SoapUI , https://www.evernote.com/shard/s14/sh/fb5ac276-8147-4e09-95bb-afa0be66d7a6/d273441c74186bf1e600b42ab3303899/deep/0/SoapUI-5.0.0.png

+4
2

:

   try { 
    $params = array('soap_version'   => SOAP_1_2, 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, 'encoding'=>'UTF-8', 'trace' => 1, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_NONE, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS);
        $client = new SoapClient('http://bestbuyhotel1.cangooroo.net/ws/2013/ClientBackOffice_b.asmx?wsdl',$params); 
    } catch (SoapFault $E) { 
        echo $E->faultstring;
    }
    if ($client) { 
    $req_params = array('credential' => 
                            array('userName' => 'XXXXXXX',
                                  'Password' => 'XXXXXXX'),
                        'searchBookingCriteria' =>
                            array('BookingNumber' => array('int' => 'XXXXXXXXX'),
                                  'ServiceTypes' => array('eServiceType' => 'HOTEL'),
                                  'PassengerName'=> 'XXXXXXXX',
                                  'InitialBookingDate'=> '2015-01-16',
                                  'FinalBookingDate'=> '2015-01-16',
                                  'InitialServiceDate' => '2015-01-18',
                                  'FinalServiceDate' => '2015-01-18',
                                  'BookingStatus'=> array('eStatus' => 'ACTIVATED'),
                                  'PaymentStatus'=> array('ePaymentStatus' => 'Payed'),
                                  'CreationUserId'=> 'XXX',
                                  'CityId'=> 'XXXX',
                                  'ExternalReference'=> '')
        );
    $response = $client->__soapCall('getBookingList',array($req_params));
    var_dump($response);
    }
+3

( ) :

$args->searchBookingCriteria->FinalBookingDate = '2015-01-22';
$args->searchBookingCriteria->InitialServiceDate = '2015-01-22';
$args->searchBookingCriteria->FinalServiceDate = '2015-01-22';
$args->searchBookingCriteria->CreationUserId = 'abc';
$args->searchBookingCriteria->CityId = 'abc';
+1

All Articles