示例#1
0
文件: booking.php 项目: brynner/postr
 /**
  * Creates a booking for pickup with specific 
  * pickup address.
  *
  * return array
  */
 public function getSpecific()
 {
     // 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);
     // prepare parameters
     $param = array(self::BOOKING_DATE => $this->_date, self::REMARKS => $this->_remarks, self::FIRST_NAME => $this->_firstName, self::LAST_NAME => $this->_lastName, self::STREET1 => $this->_street1, self::STREET2 => $this->_street2, self::CITY => $this->_city, self::PROVINCE => $this->_province, self::POSTAL_CODE => $this->_postalCode, self::LANDMARK => $this->_landmark);
     //shippers landmark
     // execute SOAP method
     try {
         $result = $client->ScheduleDev($param);
     } 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;
 }