Example #1
0
 /**
  * Retrieves the list of addresses in the account.
  *
  * return array
  */
 public function getDetail()
 {
     //if it is in test mode
     if ($this->_test) {
         $this->_url = self::TEST_BOOKING_WSDL;
         $this->_header = self::TEST_HEADER;
     }
     //initialize SOAP client
     $client = new SoapClient($this->_url, array());
     $funcs = $client->__getFunctions();
     //initialize SOAP header
     $headerbody = array(self::USER_TOKEN => $this->_userToken);
     $header = new SoapHeader($this->_header, self::AUTH_HEADER, $headerbody);
     $client->__setSoapHeaders($header);
     //execute SOAP method
     try {
         $result = $client->GetAddress();
         //catch soap fault
     } catch (SoapFault $soapfault) {
         $this->_exceptionFlag = true;
         $exception = $soapfault->getMessage();
         preg_match_all('/: (.*?). at/s', $exception, $error, PREG_SET_ORDER);
         //Print error
         return $error[0][1];
     }
     return $result->GetAddressResult->Address;
 }