itopsoaptypes.class.inc.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php
  2. // Copyright (C) 2010 Combodo SARL
  3. //
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; version 3 of the License.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. /**
  17. * Declarations required for the WSDL
  18. *
  19. * @author Erwan Taloc <erwan.taloc@combodo.com>
  20. * @author Romain Quetiez <romain.quetiez@combodo.com>
  21. * @author Denis Flaven <denis.flaven@combodo.com>
  22. * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL
  23. */
  24. // Note: the attributes must have the same names (case sensitive) as in the WSDL specification
  25. //
  26. class SOAPSearchCondition
  27. {
  28. public $attcode; // string
  29. public $value; // mixed
  30. public function __construct($sAttCode, $value)
  31. {
  32. $this->attcode = $sAttCode;
  33. $this->value = $value;
  34. }
  35. }
  36. class SOAPExternalKeySearch
  37. {
  38. public $conditions; // array of SOAPSearchCondition
  39. public function __construct($aConditions)
  40. {
  41. $this->conditions = $aConditions;
  42. }
  43. }
  44. class SOAPAttributeValue
  45. {
  46. public $attcode; // string
  47. public $value; // mixed
  48. public function __construct($sAttCode, $value)
  49. {
  50. $this->attcode = $sAttCode;
  51. $this->value = $value;
  52. }
  53. }
  54. class SOAPLinkCreationSpec
  55. {
  56. public $class;
  57. public $conditions; // array of SOAPSearchCondition
  58. public $attributes; // array of SOAPAttributeValue
  59. public function __construct($sClass, $aConditions, $aAttributes)
  60. {
  61. $this->class = $sClass;
  62. $this->conditions = $aConditions;
  63. $this->attributes = $aAttributes;
  64. }
  65. }
  66. class SOAPLogMessage
  67. {
  68. public $text; // string
  69. public function __construct($sText)
  70. {
  71. $this->text = $sText;
  72. }
  73. }
  74. class SOAPResultLog
  75. {
  76. public $messages; // array of SOAPLogMessage
  77. public function __construct($aMessages)
  78. {
  79. $this->messages = $aMessages;
  80. }
  81. }
  82. class SOAPResultData
  83. {
  84. public $key; // string
  85. public $value; // string
  86. public function __construct($sKey, $sValue)
  87. {
  88. $this->key = $sKey;
  89. $this->value = $sValue;
  90. }
  91. }
  92. class SOAPResultMessage
  93. {
  94. public $label; // string
  95. public $values; // array of SOAPResultData
  96. public function __construct($sLabel, $aValues)
  97. {
  98. $this->label = $sLabel;
  99. $this->values = $aValues;
  100. }
  101. }
  102. class SOAPResult
  103. {
  104. public $status; // boolean
  105. public $result; // array of SOAPResultMessage
  106. public $errors; // array of SOAPResultLog
  107. public $warnings; // array of SOAPResultLog
  108. public $infos; // array of SOAPResultLog
  109. public function __construct($bStatus, $aResult, $aErrors, $aWarnings, $aInfos)
  110. {
  111. $this->status = $bStatus;
  112. $this->result = $aResult;
  113. $this->errors = $aErrors;
  114. $this->warnings = $aWarnings;
  115. $this->infos = $aInfos;
  116. }
  117. }
  118. $aSOAPMapping = array(
  119. 'SearchCondition' => 'SOAPSearchCondition',
  120. 'ExternalKeySearch' => 'SOAPExternalKeySearch',
  121. 'AttributeValue' => 'SOAPAttributeValue',
  122. 'LinkCreationSpec' => 'SOAPLinkCreationSpec',
  123. 'LogMessage' => 'SOAPLogMessage',
  124. 'ResultLog' => 'SOAPResultLog',
  125. 'ResultData' => 'SOAPResultData',
  126. 'ResultMessage' => 'SOAPResultMessage',
  127. 'Result' => 'SOAPResult',
  128. );
  129. ?>