/code/CurrencyServerWebService.php

https://github.com/pedrocadena/Prueba · PHP · 447 lines · 188 code · 35 blank · 224 comment · 21 complexity · 7d988f5cc7a705a7e58cca79c72d3577 MD5 · raw file

  1. <?php
  2. if (!class_exists("getDataSet")) {
  3. /**
  4. * getDataSet
  5. */
  6. class getDataSet {
  7. /**
  8. * @access public
  9. * @var string
  10. */
  11. public $provider;
  12. }}
  13. if (!class_exists("getDataSetResponse")) {
  14. /**
  15. * getDataSetResponse
  16. */
  17. class getDataSetResponse {
  18. /**
  19. * @access public
  20. * @var anyType
  21. */
  22. public $getDataSetResult;
  23. /**
  24. * @access public
  25. * @var sschema
  26. */
  27. public $schema;
  28. }}
  29. if (!class_exists("getDataSetResult")) {
  30. /**
  31. * getDataSetResult
  32. */
  33. class getDataSetResult {
  34. /**
  35. * @access public
  36. * @var sschema
  37. */
  38. public $schema;
  39. }}
  40. if (!class_exists("getXmlStream")) {
  41. /**
  42. * getXmlStream
  43. */
  44. class getXmlStream {
  45. /**
  46. * @access public
  47. * @var string
  48. */
  49. public $provider;
  50. }}
  51. if (!class_exists("getXmlStreamResponse")) {
  52. /**
  53. * getXmlStreamResponse
  54. */
  55. class getXmlStreamResponse {
  56. /**
  57. * @access public
  58. * @var string
  59. */
  60. public $getXmlStreamResult;
  61. }}
  62. if (!class_exists("getCurrencyValue")) {
  63. /**
  64. * getCurrencyValue
  65. */
  66. class getCurrencyValue {
  67. /**
  68. * @access public
  69. * @var string
  70. */
  71. public $provider;
  72. /**
  73. * @access public
  74. * @var string
  75. */
  76. public $srcCurrency;
  77. /**
  78. * @access public
  79. * @var string
  80. */
  81. public $dstCurrency;
  82. }}
  83. if (!class_exists("getCurrencyValueResponse")) {
  84. /**
  85. * getCurrencyValueResponse
  86. */
  87. class getCurrencyValueResponse {
  88. /**
  89. * @access public
  90. * @var double
  91. */
  92. public $getCurrencyValueResult;
  93. }}
  94. if (!class_exists("getDollarValue")) {
  95. /**
  96. * getDollarValue
  97. */
  98. class getDollarValue {
  99. /**
  100. * @access public
  101. * @var string
  102. */
  103. public $provider;
  104. /**
  105. * @access public
  106. * @var string
  107. */
  108. public $currency;
  109. }}
  110. if (!class_exists("getDollarValueResponse")) {
  111. /**
  112. * getDollarValueResponse
  113. */
  114. class getDollarValueResponse {
  115. /**
  116. * @access public
  117. * @var double
  118. */
  119. public $getDollarValueResult;
  120. }}
  121. if (!class_exists("getProviderDescription")) {
  122. /**
  123. * getProviderDescription
  124. */
  125. class getProviderDescription {
  126. /**
  127. * @access public
  128. * @var string
  129. */
  130. public $provider;
  131. }}
  132. if (!class_exists("getProviderDescriptionResponse")) {
  133. /**
  134. * getProviderDescriptionResponse
  135. */
  136. class getProviderDescriptionResponse {
  137. /**
  138. * @access public
  139. * @var string
  140. */
  141. public $getProviderDescriptionResult;
  142. }}
  143. if (!class_exists("getProviderTimestamp")) {
  144. /**
  145. * getProviderTimestamp
  146. */
  147. class getProviderTimestamp {
  148. /**
  149. * @access public
  150. * @var string
  151. */
  152. public $providerId;
  153. /**
  154. * @access public
  155. * @var string
  156. */
  157. public $provider;
  158. }}
  159. if (!class_exists("getProviderTimestampResponse")) {
  160. /**
  161. * getProviderTimestampResponse
  162. */
  163. class getProviderTimestampResponse {
  164. /**
  165. * @access public
  166. * @var string
  167. */
  168. public $getProviderTimestampResult;
  169. }}
  170. if (!class_exists("getProviderList")) {
  171. /**
  172. * getProviderList
  173. */
  174. class getProviderList {
  175. }}
  176. if (!class_exists("getProviderListResponse")) {
  177. /**
  178. * getProviderListResponse
  179. */
  180. class getProviderListResponse {
  181. /**
  182. * @access public
  183. * @var string
  184. */
  185. public $getProviderListResult;
  186. }}
  187. if (!class_exists("DataSet")) {
  188. /**
  189. * DataSet
  190. */
  191. class DataSet {
  192. /**
  193. * @access public
  194. * @var sschema
  195. */
  196. public $schema;
  197. }}
  198. if (!class_exists("CurrencyServerWebService")) {
  199. /**
  200. * CurrencyServerWebService
  201. * @author WSDLInterpreter
  202. */
  203. class CurrencyServerWebService extends SoapClient {
  204. /**
  205. * Default class map for wsdl=>php
  206. * @access private
  207. * @var array
  208. */
  209. private static $classmap = array(
  210. "getDataSet" => "getDataSet",
  211. "getDataSetResponse" => "getDataSetResponse",
  212. "getDataSetResult" => "getDataSetResult",
  213. "getXmlStream" => "getXmlStream",
  214. "getXmlStreamResponse" => "getXmlStreamResponse",
  215. "getCurrencyValue" => "getCurrencyValue",
  216. "getCurrencyValueResponse" => "getCurrencyValueResponse",
  217. "getDollarValue" => "getDollarValue",
  218. "getDollarValueResponse" => "getDollarValueResponse",
  219. "getProviderDescription" => "getProviderDescription",
  220. "getProviderDescriptionResponse" => "getProviderDescriptionResponse",
  221. "getProviderTimestamp" => "getProviderTimestamp",
  222. "getProviderTimestampResponse" => "getProviderTimestampResponse",
  223. "getProviderList" => "getProviderList",
  224. "getProviderListResponse" => "getProviderListResponse",
  225. "DataSet" => "DataSet",
  226. );
  227. /**
  228. * Constructor using wsdl location and options array
  229. * @param string $wsdl WSDL location for this service
  230. * @param array $options Options for the SoapClient
  231. */
  232. public function __construct($wsdl="http://www.currencyserver.de/webservice/currencyserverwebservice.asmx?WSDL", $options=array()) {
  233. foreach(self::$classmap as $wsdlClassName => $phpClassName) {
  234. if(!isset($options['classmap'][$wsdlClassName])) {
  235. $options['classmap'][$wsdlClassName] = $phpClassName;
  236. }
  237. }
  238. parent::__construct($wsdl, $options);
  239. }
  240. /**
  241. * Checks if an argument list matches against a valid argument type list
  242. * @param array $arguments The argument list to check
  243. * @param array $validParameters A list of valid argument types
  244. * @return boolean true if arguments match against validParameters
  245. * @throws Exception invalid function signature message
  246. */
  247. public function _checkArguments($arguments, $validParameters) {
  248. $variables = "";
  249. foreach ($arguments as $arg) {
  250. $type = gettype($arg);
  251. if ($type == "object") {
  252. $type = get_class($arg);
  253. }
  254. $variables .= "(".$type.")";
  255. }
  256. if (!in_array($variables, $validParameters)) {
  257. throw new Exception("Invalid parameter types: ".str_replace(")(", ", ", $variables));
  258. }
  259. return true;
  260. }
  261. /**
  262. * Service Call: getDataSet
  263. * Parameter options:
  264. * (getDataSet) parameters
  265. * (getDataSet) parameters
  266. * (string) provider
  267. * (string) provider
  268. * @param mixed,... See function description for parameter options
  269. * @return getDataSetResponse|DataSet
  270. * @throws Exception invalid function signature message
  271. */
  272. public function getDataSet($mixed = null) {
  273. $validParameters = array(
  274. "(getDataSet)",
  275. "(getDataSet)",
  276. "(string)",
  277. "(string)",
  278. );
  279. $args = func_get_args();
  280. $this->_checkArguments($args, $validParameters);
  281. return $this->__soapCall("getDataSet", $args);
  282. }
  283. /**
  284. * Service Call: getXmlStream
  285. * Parameter options:
  286. * (getXmlStream) parameters
  287. * (getXmlStream) parameters
  288. * (string) provider
  289. * (string) provider
  290. * @param mixed,... See function description for parameter options
  291. * @return getXmlStreamResponse|string
  292. * @throws Exception invalid function signature message
  293. */
  294. public function getXmlStream($mixed = null) {
  295. $validParameters = array(
  296. "(getXmlStream)",
  297. "(getXmlStream)",
  298. "(string)",
  299. "(string)",
  300. );
  301. $args = func_get_args();
  302. $this->_checkArguments($args, $validParameters);
  303. return $this->__soapCall("getXmlStream", $args);
  304. }
  305. /**
  306. * Service Call: getCurrencyValue
  307. * Parameter options:
  308. * (getCurrencyValue) parameters
  309. * (getCurrencyValue) parameters
  310. * (string) provider, (string) srcCurrency, (string) dstCurrency
  311. * (string) provider, (string) srcCurrency, (string) dstCurrency
  312. * @param mixed,... See function description for parameter options
  313. * @return getCurrencyValueResponse|double
  314. * @throws Exception invalid function signature message
  315. */
  316. public function getCurrencyValue($mixed = null) {
  317. $validParameters = array(
  318. "(getCurrencyValue)",
  319. "(getCurrencyValue)",
  320. "(string)(string)(string)",
  321. "(string)(string)(string)",
  322. );
  323. $args = func_get_args();
  324. $this->_checkArguments($args, $validParameters);
  325. return $this->__soapCall("getCurrencyValue", $args);
  326. }
  327. /**
  328. * Service Call: getDollarValue
  329. * Parameter options:
  330. * (getDollarValue) parameters
  331. * (getDollarValue) parameters
  332. * (string) provider, (string) currency
  333. * (string) provider, (string) currency
  334. * @param mixed,... See function description for parameter options
  335. * @return getDollarValueResponse|double
  336. * @throws Exception invalid function signature message
  337. */
  338. public function getDollarValue($mixed = null) {
  339. $validParameters = array(
  340. "(getDollarValue)",
  341. "(getDollarValue)",
  342. "(string)(string)",
  343. "(string)(string)",
  344. );
  345. $args = func_get_args();
  346. $this->_checkArguments($args, $validParameters);
  347. return $this->__soapCall("getDollarValue", $args);
  348. }
  349. /**
  350. * Service Call: getProviderDescription
  351. * Parameter options:
  352. * (getProviderDescription) parameters
  353. * (getProviderDescription) parameters
  354. * (string) provider
  355. * (string) provider
  356. * @param mixed,... See function description for parameter options
  357. * @return getProviderDescriptionResponse|string
  358. * @throws Exception invalid function signature message
  359. */
  360. public function getProviderDescription($mixed = null) {
  361. $validParameters = array(
  362. "(getProviderDescription)",
  363. "(getProviderDescription)",
  364. "(string)",
  365. "(string)",
  366. );
  367. $args = func_get_args();
  368. $this->_checkArguments($args, $validParameters);
  369. return $this->__soapCall("getProviderDescription", $args);
  370. }
  371. /**
  372. * Service Call: getProviderTimestamp
  373. * Parameter options:
  374. * (getProviderTimestamp) parameters
  375. * (getProviderTimestamp) parameters
  376. * (string) providerId, (string) provider
  377. * (string) providerId, (string) provider
  378. * @param mixed,... See function description for parameter options
  379. * @return getProviderTimestampResponse|string
  380. * @throws Exception invalid function signature message
  381. */
  382. public function getProviderTimestamp($mixed = null) {
  383. $validParameters = array(
  384. "(getProviderTimestamp)",
  385. "(getProviderTimestamp)",
  386. "(string)(string)",
  387. "(string)(string)",
  388. );
  389. $args = func_get_args();
  390. $this->_checkArguments($args, $validParameters);
  391. return $this->__soapCall("getProviderTimestamp", $args);
  392. }
  393. /**
  394. * Service Call: getProviderList
  395. * Parameter options:
  396. * (getProviderList) parameters
  397. * (getProviderList) parameters
  398. * @param mixed,... See function description for parameter options
  399. * @return getProviderListResponse|string
  400. * @throws Exception invalid function signature message
  401. */
  402. public function getProviderList($mixed = null) {
  403. $validParameters = array(
  404. "(getProviderList)",
  405. "(getProviderList)",
  406. );
  407. $args = func_get_args();
  408. $this->_checkArguments($args, $validParameters);
  409. return $this->__soapCall("getProviderList", $args);
  410. }
  411. }}
  412. ?>