1: <?php
2:
3: require_once('../qcubed.inc.php');
4:
5: class ExampleService extends QSoapService {
6:
7: /**
8: * Adds two numbers together, and returns the result
9: *
10: * @param int $intNumber1
11: * @param int $intNumber2
12: * @return int
13: */
14: public function AddNumbers($intNumber1, $intNumber2) {
15: return $intNumber1 + $intNumber2;
16: }
17:
18: /**
19: * Returns the Date as a QDateTime.
20: * Note that the QSoapService handler will automatically convert to a valid
21: * SOAP dateTime.
22: *
23: * @param int $intMonth
24: * @param int $intDay
25: * @param int $intYear
26: * @return QDateTime
27: */
28: public function GetDate($intMonth, $intDay, $intYear) {
29: $dttToReturn = new QDateTime($intYear . '-' . $intMonth . '-' . $intDay);
30: return $dttToReturn;
31: }
32:
33: /**
34: * Gets all the Person objects with a certain last name as an array
35: *
36: * @param string $strLastName
37: * @return Person[]
38: */
39: public function GetPeople($strLastName) {
40: return Person::QueryArray(
41: QQ::Equal(QQN::Person()->LastName, $strLastName)
42: );
43: }
44:
45: }
46:
47: // We need to RUN the WebService (just like how we run a QForm)
48: ExampleService::Run('ExampleService', 'http://examples.qcu.be');
49:
50: