Lines Php Sample
<?php
class LinesRequestType {
  public $BookIds; // BookIdsType
  public $EventIds; // EventIdsType
  public $LeagueId; // LeagueIdType
  public $TimeStamp; // dateTime
}
 
class LinesResponseType {
  public $Event; // EventType
  public $time; // dateTime
}
 
class BookIdsType {
  public $BookId; // BookIdType
}
 
class BookIdType {
}
 
class EventIdsType {
  public $EventId; // EventIdType
}
 
class EventIdType {
}
 
class LeagueIdType {
}
 
class EventType {
  public $Odds; // OddsType
  public $date; // dateTime
  public $id; // integer
  public $league; // string
  public $leagueId; // integer
  public $name; // string
}
 
class OddsType {
  public $Book; // BookType
}
 
class BookType {
  public $PeriodOdds; // PeriodOddsType
  public $id; // integer
  public $name; // string
}
 
class PeriodOddsType {
  public $Money; // MoneyType
  public $Spread; // SpreadType
  public $Total; // TotalType
  public $Combined; // CombinedLinesType
  public $linePeriod; // string
  public $timeStamp; // dateTime
  public $lineType; // LineType
}
 
class MoneyType {
  public $away; // integer
  public $home; // integer
  public $draw; // integer
}
 
class SpreadType {
  public $awayPoints; // decimal
  public $awayPrice; // integer
  public $homePoints; // decimal
  public $homePrice; // integer
}
 
class TotalType {
  public $points; // decimal
  public $overPrice; // integer
  public $underPrice; // integer
}
 
class CombinedLinesType {
  public $awayDisplay; // UNKNOWN
  public $homeDisplay; // UNKNOWN
}
 
class LineType {
  const current = 'current';
  const previous = 'previous';
  const opener = 'opener';
  const closer = 'closer';
}
 
/**
 * LinesService class
 * 
 *  
 * 
* @author    Matthew Belzberg - Don Best Sports
 * @copyright Creative Commons Attribution 3.0 Unported License
 * @package   donbest.samples.php
 */
class LinesService extends SoapClient {
 
  private static $classmap = array(
                                    'LinesRequestType' => 'LinesRequestType',
                                    'LinesResponseType' => 'LinesResponseType',
                                    'BookIdsType' => 'BookIdsType',
                                    'BookIdType' => 'BookIdType',
                                    'EventIdsType' => 'EventIdsType',
                                    'EventIdType' => 'EventIdType',
                                    'LeagueIdType' => 'LeagueIdType',
                                    'EventType' => 'EventType',
                                    'OddsType' => 'OddsType',
                                    'BookType' => 'BookType',
                                    'PeriodOddsType' => 'PeriodOddsType',
                                    'MoneyType' => 'MoneyType',
                                    'SpreadType' => 'SpreadType',
                                    'TotalType' => 'TotalType',
                                    'CombinedLinesType' => 'CombinedLinesType',
                                    'LineType' => 'LineType',
                                   );
 
  public function LinesService($wsdl = "http://feeds.donbest.com/webservices/lines.wsdl", $options = array()) {
    foreach(self::$classmap as $key => $value) {
      if(!isset($options['classmap'][$key])) {
        $options['classmap'][$key] = $value;
      }
    }
    parent::__construct($wsdl, $options);
  }
 
  /**
   *  
   *
   * @param LinesRequestType $CurrentLinesRequest
   * @return LinesResponseType
   */
  public function CurrentLines(LinesRequestType $CurrentLinesRequest,$username,$password)  {
 
    $authheader = sprintf('
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
             <wsse:UsernameToken>
                <wsse:Username>%s</wsse:Username>
                <wsse:Password>%s</wsse:Password>
             </wsse:UsernameToken>
        </wsse:Security>
    ', htmlspecialchars($username), htmlspecialchars($password));
 
    $authvars = new SoapVar($authheader,XSD_ANYXML);
    $header=new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security",$authvars);
    $this->__setSoapHeaders($header);
 
    return $this->__soapCall('CurrentLines', array($CurrentLinesRequest),       array(
            'uri' => 'http://donbest.com/lines/definitions',
            'soapaction' => ''
           )
      );
  }
 
  /**
   *  
   *
   * @param LinesRequestType $OpeningLinesRequest
   * @return LinesResponseType
   */
  public function OpeningLines(LinesRequestType $OpeningLinesRequest,$username,$password)  {
 
    $authheader = sprintf('
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
             <wsse:UsernameToken>
                <wsse:Username>%s</wsse:Username>
                <wsse:Password>%s</wsse:Password>
             </wsse:UsernameToken>
        </wsse:Security>
    ', htmlspecialchars($username), htmlspecialchars($password));
 
    $authvars = new SoapVar($authheader,XSD_ANYXML);
    $header=new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security",$authvars);
    $this->__setSoapHeaders($header);
 
    return $this->__soapCall('OpeningLines', array($OpeningLinesRequest),       array(
            'uri' => 'http://donbest.com/lines/definitions',
            'soapaction' => ''
           )
      );
  }
 
  /**
   *  
   *
   * @param LinesRequestType $CurrentAndPreviousLinesRequest
   * @return LinesResponseType
   */
  public function CurrentAndPreviousLines(LinesRequestType $CurrentAndPreviousLinesRequest,$username,$password)  {
 
    $authheader = sprintf('
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
             <wsse:UsernameToken>
                <wsse:Username>%s</wsse:Username>
                <wsse:Password>%s</wsse:Password>
             </wsse:UsernameToken>
        </wsse:Security>
    ', htmlspecialchars($username), htmlspecialchars($password));
 
    $authvars = new SoapVar($authheader,XSD_ANYXML);
    $header=new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security",$authvars);
    $this->__setSoapHeaders($header);
 
    return $this->__soapCall('CurrentAndPreviousLines', array($CurrentAndPreviousLinesRequest),       array(
            'uri' => 'http://donbest.com/lines/definitions',
            'soapaction' => ''
           )
      );
  }
 
  /**
   *  
   *
   * @param LinesRequestType $ClosingLinesRequest
   * @return LinesResponseType
   */
  public function ClosingLines(LinesRequestType $ClosingLinesRequest,$username,$password)  {
 
    $authheader = sprintf('
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
             <wsse:UsernameToken>
                <wsse:Username>%s</wsse:Username>
                <wsse:Password>%s</wsse:Password>
             </wsse:UsernameToken>
        </wsse:Security>
    ', htmlspecialchars($username), htmlspecialchars($password));
 
    $authvars = new SoapVar($authheader,XSD_ANYXML);
    $header=new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security",$authvars);
    $this->__setSoapHeaders($header);
 
    return $this->__soapCall('ClosingLines', array($ClosingLinesRequest),       array(
            'uri' => 'http://donbest.com/lines/definitions',
            'soapaction' => ''
           )
      );
  }
 
}
 
?>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License