cm_soap_course.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <?php
  2. require_once(dirname(__FILE__).'/cm_webservice_course.php');
  3. require_once(dirname(__FILE__).'/cm_soap.php');
  4. /**
  5. * Configures the WSCourse SOAP service
  6. */
  7. $s = WSCMSoapServer::singleton();
  8. $s->wsdl->addComplexType(
  9. 'course_id',
  10. 'complexType',
  11. 'struct',
  12. 'all',
  13. '',
  14. array(
  15. 'course_id_field_name' => array('name' => 'course_id_field_name', 'type' => 'xsd:string'),
  16. 'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string')
  17. )
  18. );
  19. $s->wsdl->addComplexType(
  20. 'course_result',
  21. 'complexType',
  22. 'struct',
  23. 'all',
  24. '',
  25. array(
  26. 'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string'),
  27. 'result' => array('name' => 'result', 'type' => 'tns:result')
  28. )
  29. );
  30. $s->wsdl->addComplexType(
  31. 'course_result_array',
  32. 'complexType',
  33. 'array',
  34. '',
  35. 'SOAP-ENC:Array',
  36. array(),
  37. array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course_result[]')),
  38. 'tns:course_result'
  39. );
  40. $s->register(
  41. 'WSCMCourse.DeleteCourse',
  42. array('secret_key' => 'xsd:string', 'course_id_field_name' => 'xsd:string', 'course_id_value' => 'xsd:string')
  43. );
  44. $s->register(
  45. 'WSCMCourse.DeleteCourses',
  46. array('secret_key' => 'xsd:string', 'courses' => 'tns:course_id[]'),
  47. array('return' => 'tns:course_result_array')
  48. );
  49. $s->register(
  50. 'WSCMCourse.CreateCourse',
  51. array(
  52. 'secret_key' => 'xsd:string',
  53. 'title' => 'xsd:string',
  54. 'category_code' => 'xsd:string',
  55. 'wanted_code' => 'xsd:string',
  56. 'tutor_name' => 'xsd:string',
  57. 'course_admin_user_id_field_name' => 'xsd:string',
  58. 'course_admin_user_id_value' => 'xsd:string',
  59. 'language' => 'xsd:string',
  60. 'course_id_field_name' => 'xsd:string',
  61. 'course_id_value' => 'xsd:string',
  62. 'extras' => 'tns:extra_field[]'
  63. ),
  64. array('return' => 'xsd:int')
  65. );
  66. $s->wsdl->addComplexType(
  67. 'course_create',
  68. 'complexType',
  69. 'struct',
  70. 'all',
  71. '',
  72. array(
  73. 'title' => array('name' => 'title', 'type' => 'xsd:string'),
  74. 'category_code' => array('name' => 'category_code', 'type' => 'xsd:string'),
  75. 'wanted_code' => array('name' => 'wanted_code', 'type' => 'xsd:int'),
  76. 'tutor_name' => array('name' => 'tutor_name', 'type' => 'xsd:string'),
  77. 'course_admin_user_id_field_name' => array('name' => 'course_admin_user_id_field_name', 'type' => 'xsd:string'),
  78. 'course_admin_user_id_value' => array('name' => 'course_admin_user_id_value', 'type' => 'xsd:string'),
  79. 'language' => array('name' => 'language', 'type' => 'xsd:string'),
  80. 'course_id_field_name' => array('name' => 'course_id_field_name', 'type' => 'xsd:string'),
  81. 'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string'),
  82. 'extras' => array('name' => 'extras', 'type' => 'tns:extra_field[]')
  83. )
  84. );
  85. $s->wsdl->addComplexType(
  86. 'course_create_result',
  87. 'complexType',
  88. 'struct',
  89. 'all',
  90. '',
  91. array(
  92. 'course_id_value' => array('name' => 'course_id_value', 'type' => 'xsd:string'),
  93. 'course_id_generated' => array('name' => 'course_id_generated', 'type' => 'xsd:int'),
  94. 'result' => array('name' => 'result', 'type' => 'tns:result')
  95. )
  96. );
  97. $s->wsdl->addComplexType(
  98. 'course_create_result_array',
  99. 'complexType',
  100. 'array',
  101. '',
  102. 'SOAP-ENC:Array',
  103. array(),
  104. array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course_create_result[]')),
  105. 'tns:course_create_result'
  106. );
  107. $s->register(
  108. 'WSCMCourse.CreateCourses',
  109. array(
  110. 'secret_key' => 'xsd:string',
  111. 'courses' => 'tns:course_create[]'
  112. ),
  113. array('return' => 'tns:course_create_result_array')
  114. );
  115. $s->register(
  116. 'WSCMCourse.EditCourse',
  117. array(
  118. 'secret_key' => 'xsd:string',
  119. 'course_id_field_name' => 'xsd:string',
  120. 'course_id_value' => 'xsd:string',
  121. 'title' => 'xsd:string',
  122. 'category_code' => 'xsd:string',
  123. 'department_name' => 'xsd:string',
  124. 'department_url' => 'xsd:string',
  125. 'language' => 'xsd:string',
  126. 'visibility' => 'xsd:int',
  127. 'subscribe' => 'xsd:int',
  128. 'unsubscribe' => 'xsd:int',
  129. 'visual_code' => 'xsd:string',
  130. 'extras' => 'tns:extra_field[]'
  131. )
  132. );
  133. $s->wsdl->addComplexType(
  134. 'course',
  135. 'complexType',
  136. 'struct',
  137. 'all',
  138. '',
  139. array(
  140. 'id' => array('name' => 'id', 'type' => 'xsd:int'),
  141. 'code' => array('name' => 'code', 'type' => 'xsd:string'),
  142. 'title' => array('name' => 'title', 'type' => 'xsd:string'),
  143. 'language' => array('name' => 'language', 'type' => 'xsd:string'),
  144. 'visibility' => array('name' => 'visibility', 'type' => 'xsd:int'),
  145. 'category_name' => array('name' => 'category_name', 'type' => 'xsd:string'),
  146. 'number_students' => array('name' => 'number_students', 'type' => 'xsd:int'),
  147. 'external_course_id' => array('name' => 'external_course_id', 'type' => 'xsd:string'),
  148. )
  149. );
  150. $s->wsdl->addComplexType(
  151. 'course_array',
  152. 'complexType',
  153. 'array',
  154. '',
  155. 'SOAP-ENC:Array',
  156. array(),
  157. array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course[]')),
  158. 'tns:course'
  159. );
  160. $s->register(
  161. 'WSCMCourse.ListCourses',
  162. array(
  163. 'secret_key' => 'xsd:string',
  164. 'course_id_field_name' => 'xsd:string'
  165. ),
  166. array('return' => 'tns:course_array')
  167. );
  168. $s->register(
  169. 'WSCMCourse.SubscribeUserToCourse',
  170. array(
  171. 'secret_key' => 'xsd:string',
  172. 'course_id_field_name' => 'xsd:string',
  173. 'course_id_value' => 'xsd:string',
  174. 'user_id_field_name' => 'xsd:string',
  175. 'user_id_value' => 'xsd:string',
  176. 'status' => 'xsd:int'
  177. )
  178. );
  179. $s->register(
  180. 'WSCMCourse.UnsubscribeUserFromCourse',
  181. array(
  182. 'secret_key' => 'xsd:string',
  183. 'course_id_field_name' => 'xsd:string',
  184. 'course_id_value' => 'xsd:string',
  185. 'user_id_field_name' => 'xsd:string',
  186. 'user_id_value' => 'xsd:string'
  187. )
  188. );
  189. $s->wsdl->addComplexType(
  190. 'course_description',
  191. 'complexType',
  192. 'struct',
  193. 'all',
  194. '',
  195. array(
  196. 'course_desc_id' => array('name' => 'course_desc_id', 'type' => 'xsd:int'),
  197. 'course_desc_title' => array('name' => 'course_desc_title', 'type' => 'xsd:string'),
  198. 'course_desc_content' => array('name' => 'course_desc_content', 'type' => 'xsd:string')
  199. )
  200. );
  201. $s->wsdl->addComplexType(
  202. 'course_description_array',
  203. 'complexType',
  204. 'array',
  205. '',
  206. 'SOAP-ENC:Array',
  207. array(),
  208. array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:course_description[]')),
  209. 'tns:course_description'
  210. );
  211. $s->register(
  212. 'WSCMCourse.GetCourseDescriptions',
  213. array(
  214. 'secret_key' => 'xsd:string',
  215. 'course_id_field_name' => 'xsd:string',
  216. 'course_id_value' => 'xsd:string'
  217. ),
  218. array('return' => 'tns:course_description_array')
  219. );
  220. $s->register(
  221. 'WSCMCourse.EditCourseDescription',
  222. array(
  223. 'secret_key' => 'xsd:string',
  224. 'course_id_field_name' => 'xsd:string',
  225. 'course_id_value' => 'xsd:string',
  226. 'course_desc_id' => 'xsd:int',
  227. 'course_desc_title' => 'xsd:string',
  228. 'course_desc_content' => 'xsd:string'
  229. )
  230. );
  231. $s->register(
  232. 'WSCMCourse.unreadMessage',
  233. array(
  234. 'username' => 'xsd:string',
  235. 'password' => 'xsd:string',
  236. ),
  237. array('return' => 'xsd:string'),
  238. 'urn:WSCMService',
  239. '',
  240. '',
  241. '',
  242. 'Retorna a quantidade de mensagens nao lidas na caixa de entrada do usuario.'
  243. );
  244. $s->register(
  245. 'WSCMCourse.getIdMessage',
  246. array(
  247. 'username' => 'xsd:string',
  248. 'password' => 'xsd:string',
  249. ),
  250. array('return' => 'xsd:string'),
  251. 'urn:WSCMService',
  252. '',
  253. '',
  254. '',
  255. 'Retorna o ID das mensagens.'
  256. );
  257. $s->register(
  258. 'WSCMCourse.nada',
  259. array('username' => 'xsd:string', 'password' => 'xsd:string'),
  260. array('return' => 'xsd:string')
  261. );