AddressService.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. <?php
  2. /*
  3. * Copyright (c) 2008-2016 vip.com, All Rights Reserved.
  4. *
  5. * Powered by com.vip.osp.osp-idlc-2.5.11.
  6. *
  7. */
  8. namespace vipapis\cup\address;
  9. interface AddressServiceIf{
  10. public function getVipAddress( $province, $city, $county, $street);
  11. public function healthCheck();
  12. }
  13. class _AddressServiceClient extends \Osp\Base\OspStub implements \vipapis\cup\address\AddressServiceIf{
  14. public function __construct(){
  15. parent::__construct("vipapis.cup.address.AddressService", "1.0.0");
  16. }
  17. public function getVipAddress( $province, $city, $county, $street){
  18. $this->send_getVipAddress( $province, $city, $county, $street);
  19. return $this->recv_getVipAddress();
  20. }
  21. public function send_getVipAddress( $province, $city, $county, $street){
  22. $this->initInvocation("getVipAddress");
  23. $args = new \vipapis\cup\address\AddressService_getVipAddress_args();
  24. $args->province = $province;
  25. $args->city = $city;
  26. $args->county = $county;
  27. $args->street = $street;
  28. $this->send_base($args);
  29. }
  30. public function recv_getVipAddress(){
  31. $result = new \vipapis\cup\address\AddressService_getVipAddress_result();
  32. $this->receive_base($result);
  33. if ($result->success !== null){
  34. return $result->success;
  35. }
  36. }
  37. public function healthCheck(){
  38. $this->send_healthCheck();
  39. return $this->recv_healthCheck();
  40. }
  41. public function send_healthCheck(){
  42. $this->initInvocation("healthCheck");
  43. $args = new \vipapis\cup\address\AddressService_healthCheck_args();
  44. $this->send_base($args);
  45. }
  46. public function recv_healthCheck(){
  47. $result = new \vipapis\cup\address\AddressService_healthCheck_result();
  48. $this->receive_base($result);
  49. if ($result->success !== null){
  50. return $result->success;
  51. }
  52. }
  53. }
  54. class AddressService_getVipAddress_args {
  55. static $_TSPEC;
  56. public $province = null;
  57. public $city = null;
  58. public $county = null;
  59. public $street = null;
  60. public function __construct($vals=null){
  61. if (!isset(self::$_TSPEC)){
  62. self::$_TSPEC = array(
  63. 1 => array(
  64. 'var' => 'province'
  65. ),
  66. 2 => array(
  67. 'var' => 'city'
  68. ),
  69. 3 => array(
  70. 'var' => 'county'
  71. ),
  72. 4 => array(
  73. 'var' => 'street'
  74. ),
  75. );
  76. }
  77. if (is_array($vals)){
  78. if (isset($vals['province'])){
  79. $this->province = $vals['province'];
  80. }
  81. if (isset($vals['city'])){
  82. $this->city = $vals['city'];
  83. }
  84. if (isset($vals['county'])){
  85. $this->county = $vals['county'];
  86. }
  87. if (isset($vals['street'])){
  88. $this->street = $vals['street'];
  89. }
  90. }
  91. }
  92. public function read($input){
  93. if(true) {
  94. $input->readString($this->province);
  95. }
  96. if(true) {
  97. $input->readString($this->city);
  98. }
  99. if(true) {
  100. $input->readString($this->county);
  101. }
  102. if(true) {
  103. $input->readString($this->street);
  104. }
  105. }
  106. public function write($output){
  107. $xfer = 0;
  108. $xfer += $output->writeStructBegin();
  109. $xfer += $output->writeFieldBegin('province');
  110. $xfer += $output->writeString($this->province);
  111. $xfer += $output->writeFieldEnd();
  112. $xfer += $output->writeFieldBegin('city');
  113. $xfer += $output->writeString($this->city);
  114. $xfer += $output->writeFieldEnd();
  115. $xfer += $output->writeFieldBegin('county');
  116. $xfer += $output->writeString($this->county);
  117. $xfer += $output->writeFieldEnd();
  118. if($this->street !== null) {
  119. $xfer += $output->writeFieldBegin('street');
  120. $xfer += $output->writeString($this->street);
  121. $xfer += $output->writeFieldEnd();
  122. }
  123. $xfer += $output->writeFieldStop();
  124. $xfer += $output->writeStructEnd();
  125. return $xfer;
  126. }
  127. }
  128. class AddressService_healthCheck_args {
  129. static $_TSPEC;
  130. public function __construct($vals=null){
  131. if (!isset(self::$_TSPEC)){
  132. self::$_TSPEC = array(
  133. );
  134. }
  135. if (is_array($vals)){
  136. }
  137. }
  138. public function read($input){
  139. }
  140. public function write($output){
  141. $xfer = 0;
  142. $xfer += $output->writeStructBegin();
  143. $xfer += $output->writeFieldStop();
  144. $xfer += $output->writeStructEnd();
  145. return $xfer;
  146. }
  147. }
  148. class AddressService_getVipAddress_result {
  149. static $_TSPEC;
  150. public $success = null;
  151. public function __construct($vals=null){
  152. if (!isset(self::$_TSPEC)){
  153. self::$_TSPEC = array(
  154. 0 => array(
  155. 'var' => 'success'
  156. ),
  157. );
  158. }
  159. if (is_array($vals)){
  160. if (isset($vals['success'])){
  161. $this->success = $vals['success'];
  162. }
  163. }
  164. }
  165. public function read($input){
  166. if(true) {
  167. $this->success = new \com\vip\vop\cup\api\address\VipAddressInfo();
  168. $this->success->read($input);
  169. }
  170. }
  171. public function write($output){
  172. $xfer = 0;
  173. $xfer += $output->writeStructBegin();
  174. if($this->success !== null) {
  175. $xfer += $output->writeFieldBegin('success');
  176. if (!is_object($this->success)) {
  177. throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
  178. }
  179. $xfer += $this->success->write($output);
  180. $xfer += $output->writeFieldEnd();
  181. }
  182. $xfer += $output->writeFieldStop();
  183. $xfer += $output->writeStructEnd();
  184. return $xfer;
  185. }
  186. }
  187. class AddressService_healthCheck_result {
  188. static $_TSPEC;
  189. public $success = null;
  190. public function __construct($vals=null){
  191. if (!isset(self::$_TSPEC)){
  192. self::$_TSPEC = array(
  193. 0 => array(
  194. 'var' => 'success'
  195. ),
  196. );
  197. }
  198. if (is_array($vals)){
  199. if (isset($vals['success'])){
  200. $this->success = $vals['success'];
  201. }
  202. }
  203. }
  204. public function read($input){
  205. if(true) {
  206. $this->success = new \com\vip\hermes\core\health\CheckResult();
  207. $this->success->read($input);
  208. }
  209. }
  210. public function write($output){
  211. $xfer = 0;
  212. $xfer += $output->writeStructBegin();
  213. if($this->success !== null) {
  214. $xfer += $output->writeFieldBegin('success');
  215. if (!is_object($this->success)) {
  216. throw new \Osp\Exception\OspException('Bad type in structure.', \Osp\Exception\OspException::INVALID_DATA);
  217. }
  218. $xfer += $this->success->write($output);
  219. $xfer += $output->writeFieldEnd();
  220. }
  221. $xfer += $output->writeFieldStop();
  222. $xfer += $output->writeStructEnd();
  223. return $xfer;
  224. }
  225. }
  226. ?>