| @@ 55-117 (lines=63) @@ | ||
| 52 | public $department; |
|
| 53 | } |
|
| 54 | ||
| 55 | class WrapperSoapServer |
|
| 56 | { |
|
| 57 | /** |
|
| 58 | * @WebMethod |
|
| 59 | * @param wrapper $user @className=User |
|
| 60 | * @param int $id |
|
| 61 | * @return string $nameWithAge |
|
| 62 | */ |
|
| 63 | public function getUserString($user, $id) |
|
| 64 | { |
|
| 65 | return '[#' . $id . ']Your name is: ' . $user->name . ' and you have ' . $user->age . ' years old with payment ' . $user->payment; |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * @WebMethod |
|
| 70 | * @param string $name |
|
| 71 | * @param string $age |
|
| 72 | * @param string $payment |
|
| 73 | * @return wrapper $userReturn @className=User |
|
| 74 | */ |
|
| 75 | public function getUser($name, $age, $payment) |
|
| 76 | { |
|
| 77 | //FIXME incorrect response structure |
|
| 78 | $user = new User(); |
|
| 79 | $user->name = $name; |
|
| 80 | $user->age = $age; |
|
| 81 | $user->payment = $payment; |
|
| 82 | return $user; |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * @WebMethod |
|
| 87 | * @return wrapper[] $employees @className=Employee |
|
| 88 | */ |
|
| 89 | public function getEmployees() |
|
| 90 | { |
|
| 91 | //FIXME incorrect response structure |
|
| 92 | $employees = array(); |
|
| 93 | $departments = array('IT', 'Logistics', 'Management'); |
|
| 94 | for ($i = 0; $i < 3; $i++) { |
|
| 95 | $employee = new Employee(); |
|
| 96 | $employee->id = 2 + $i + 1; |
|
| 97 | $employee->department = $departments[$i]; |
|
| 98 | $employees[] = $employee; |
|
| 99 | } |
|
| 100 | return $employees; |
|
| 101 | } |
|
| 102 | ||
| 103 | /** |
|
| 104 | * @WebMethod |
|
| 105 | * @param wrapper[] $employeesList @className=Employee |
|
| 106 | * @return string $str |
|
| 107 | */ |
|
| 108 | public function getEmployeesDepartments($employeesList) |
|
| 109 | { |
|
| 110 | //FIXME incorrect response structure |
|
| 111 | $names = array(); |
|
| 112 | foreach ($employeesList as $employee) { |
|
| 113 | $names[] = $employee->department; |
|
| 114 | } |
|
| 115 | return implode(', ', $names); |
|
| 116 | } |
|
| 117 | } |
|
| @@ 54-113 (lines=60) @@ | ||
| 51 | public $department; |
|
| 52 | } |
|
| 53 | ||
| 54 | class WrapperSoapServer |
|
| 55 | { |
|
| 56 | /** |
|
| 57 | * @WebMethod |
|
| 58 | * @param wrapper $user @className=User |
|
| 59 | * @param int $id |
|
| 60 | * @return string $nameWithAge |
|
| 61 | */ |
|
| 62 | public function getUserString($user, $id) |
|
| 63 | { |
|
| 64 | return '[#' . $id . ']Your name is: ' . $user->name . ' and you have ' . $user->age . ' years old with payment ' . $user->payment; |
|
| 65 | } |
|
| 66 | ||
| 67 | /** |
|
| 68 | * @WebMethod |
|
| 69 | * @param string $name |
|
| 70 | * @param string $age |
|
| 71 | * @param string $payment |
|
| 72 | * @return wrapper $userReturn @className=User |
|
| 73 | */ |
|
| 74 | public function getUser($name, $age, $payment) |
|
| 75 | { |
|
| 76 | $user = new User(); |
|
| 77 | $user->name = $name; |
|
| 78 | $user->age = $age; |
|
| 79 | $user->payment = $payment; |
|
| 80 | return $user; |
|
| 81 | } |
|
| 82 | ||
| 83 | /** |
|
| 84 | * @WebMethod |
|
| 85 | * @return wrapper[] $employees @className=Employee |
|
| 86 | */ |
|
| 87 | public function getEmployees() |
|
| 88 | { |
|
| 89 | $employees = array(); |
|
| 90 | $departments = array('IT', 'Logistics', 'Management'); |
|
| 91 | for ($i = 0; $i < 3; $i++) { |
|
| 92 | $employee = new Employee(); |
|
| 93 | $employee->id = 2 + $i + 1; |
|
| 94 | $employee->department = $departments[$i]; |
|
| 95 | $employees[] = $employee; |
|
| 96 | } |
|
| 97 | return $employees; |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * @WebMethod |
|
| 102 | * @param wrapper[] $employeesList @className=Employee |
|
| 103 | * @return string $str |
|
| 104 | */ |
|
| 105 | public function getEmployeesDepartments($employeesList) |
|
| 106 | { |
|
| 107 | $names = array(); |
|
| 108 | foreach ($employeesList as $employee) { |
|
| 109 | $names[] = $employee->department; |
|
| 110 | } |
|
| 111 | return implode(', ', $names); |
|
| 112 | } |
|
| 113 | } |
|
| @@ 53-113 (lines=61) @@ | ||
| 50 | public $department; |
|
| 51 | } |
|
| 52 | ||
| 53 | class WrapperSoapServer |
|
| 54 | { |
|
| 55 | /** |
|
| 56 | * @WebMethod |
|
| 57 | * @param wrapper $user @className=User |
|
| 58 | * @param int $id |
|
| 59 | * @return string $nameWithAge |
|
| 60 | */ |
|
| 61 | public function getUserString($user, $id) |
|
| 62 | { |
|
| 63 | return '[#' . $id . ']Your name is: ' . $user->name . ' and you have ' . $user->age . ' years old with payment ' . $user->payment; |
|
| 64 | } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * @WebMethod |
|
| 68 | * @param string $name |
|
| 69 | * @param string $age |
|
| 70 | * @param string $payment |
|
| 71 | * @return wrapper $userReturn @className=User |
|
| 72 | */ |
|
| 73 | public function getUser($name, $age, $payment) |
|
| 74 | { |
|
| 75 | $user = new User(); |
|
| 76 | $user->name = $name; |
|
| 77 | $user->age = $age; |
|
| 78 | $user->payment = $payment; |
|
| 79 | return $user; |
|
| 80 | } |
|
| 81 | ||
| 82 | /** |
|
| 83 | * @WebMethod |
|
| 84 | * @return wrapper[] $employees @className=Employee |
|
| 85 | */ |
|
| 86 | public function getEmployees() |
|
| 87 | { |
|
| 88 | $employees = array(); |
|
| 89 | $departments = array('IT', 'Logistics', 'Management'); |
|
| 90 | for ($i = 0; $i < 3; $i++) { |
|
| 91 | $employee = new Employee(); |
|
| 92 | $employee->id = 2 + $i + 1; |
|
| 93 | $employee->department = $departments[$i]; |
|
| 94 | $employees[] = $employee; |
|
| 95 | } |
|
| 96 | return $employees; |
|
| 97 | } |
|
| 98 | ||
| 99 | /** |
|
| 100 | * @WebMethod |
|
| 101 | * @param wrapper[] $employeesList @className=Employee |
|
| 102 | * @return string $str |
|
| 103 | */ |
|
| 104 | public function getEmployeesDepartments($employeesList) |
|
| 105 | { |
|
| 106 | //FIXME getting correct $employeesList |
|
| 107 | $names = array(); |
|
| 108 | foreach ($employeesList as $employee) { |
|
| 109 | $names[] = $employee->department; |
|
| 110 | } |
|
| 111 | return implode(', ', $names); |
|
| 112 | } |
|
| 113 | } |
|