ClientTest.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Soap
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. if (!defined('PHPUnit_MAIN_METHOD')) {
  23. define('PHPUnit_MAIN_METHOD', 'Zend_Soap_ClientTest::main');
  24. }
  25. require_once dirname(__FILE__)."/../../TestHelper.php";
  26. /** PHPUnit Test Case */
  27. require_once "PHPUnit/Framework/TestCase.php";
  28. /** Zend_Soap_Server */
  29. require_once 'Zend/Soap/Server.php';
  30. /** Zend_Soap_Client */
  31. require_once 'Zend/Soap/Client.php';
  32. require_once 'Zend/Config.php';
  33. /**
  34. * @category Zend
  35. * @package Zend_Soap
  36. * @subpackage UnitTests
  37. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  38. * @license http://framework.zend.com/license/new-bsd New BSD License
  39. * @group Zend_Soap
  40. */
  41. class Zend_Soap_ClientTest extends PHPUnit_Framework_TestCase
  42. {
  43. /**
  44. * Runs this test suite
  45. *
  46. * @return void
  47. */
  48. public static function main()
  49. {
  50. $suite = new PHPUnit_Framework_TestSuite(__CLASS__);
  51. $result = PHPUnit_TextUI_TestRunner::run($suite);
  52. }
  53. public function setUp()
  54. {
  55. if (!extension_loaded('soap')) {
  56. $this->markTestSkipped('SOAP Extension is not loaded');
  57. }
  58. }
  59. public function testSetOptions()
  60. {
  61. /*************************************************************
  62. * ------ Test WSDL mode options -----------------------------
  63. *************************************************************/
  64. $client = new Zend_Soap_Client();
  65. $this->assertTrue($client->getOptions() == array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));
  66. $ctx = stream_context_create();
  67. $nonWsdlOptions = array('soap_version' => SOAP_1_1,
  68. 'classmap' => array('TestData1' => 'Zend_Soap_Client_TestData1',
  69. 'TestData2' => 'Zend_Soap_Client_TestData2',),
  70. 'encoding' => 'ISO-8859-1',
  71. 'uri' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  72. 'location' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  73. 'use' => SOAP_ENCODED,
  74. 'style' => SOAP_RPC,
  75. 'login' => 'http_login',
  76. 'password' => 'http_password',
  77. 'proxy_host' => 'proxy.somehost.com',
  78. 'proxy_port' => 8080,
  79. 'proxy_login' => 'proxy_login',
  80. 'proxy_password' => 'proxy_password',
  81. 'local_cert' => dirname(__FILE__).'/_files/cert_file',
  82. 'passphrase' => 'some pass phrase',
  83. 'stream_context' => $ctx,
  84. 'cache_wsdl' => 8,
  85. 'features' => 4,
  86. 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5);
  87. $client->setOptions($nonWsdlOptions);
  88. $this->assertTrue($client->getOptions() == $nonWsdlOptions);
  89. /*************************************************************
  90. * ------ Test non-WSDL mode options -----------------------------
  91. *************************************************************/
  92. $client1 = new Zend_Soap_Client();
  93. $this->assertTrue($client1->getOptions() == array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));
  94. $wsdlOptions = array('soap_version' => SOAP_1_1,
  95. 'wsdl' => dirname(__FILE__).'/_files/wsdl_example.wsdl',
  96. 'classmap' => array('TestData1' => 'Zend_Soap_Client_TestData1',
  97. 'TestData2' => 'Zend_Soap_Client_TestData2',),
  98. 'encoding' => 'ISO-8859-1',
  99. 'login' => 'http_login',
  100. 'password' => 'http_password',
  101. 'proxy_host' => 'proxy.somehost.com',
  102. 'proxy_port' => 8080,
  103. 'proxy_login' => 'proxy_login',
  104. 'proxy_password' => 'proxy_password',
  105. 'local_cert' => dirname(__FILE__).'/_files/cert_file',
  106. 'passphrase' => 'some pass phrase',
  107. 'stream_context' => $ctx,
  108. 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5);
  109. $client1->setOptions($wsdlOptions);
  110. $this->assertTrue($client1->getOptions() == $wsdlOptions);
  111. }
  112. public function testGetOptions()
  113. {
  114. $client = new Zend_Soap_Client();
  115. $this->assertTrue($client->getOptions() == array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));
  116. $options = array('soap_version' => SOAP_1_1,
  117. 'wsdl' => dirname(__FILE__).'/_files/wsdl_example.wsdl',
  118. 'classmap' => array('TestData1' => 'Zend_Soap_Client_TestData1',
  119. 'TestData2' => 'Zend_Soap_Client_TestData2',),
  120. 'encoding' => 'ISO-8859-1',
  121. 'uri' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  122. 'location' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  123. 'use' => SOAP_ENCODED,
  124. 'style' => SOAP_RPC,
  125. 'login' => 'http_login',
  126. 'password' => 'http_password',
  127. 'proxy_host' => 'proxy.somehost.com',
  128. 'proxy_port' => 8080,
  129. 'proxy_login' => 'proxy_login',
  130. 'proxy_password' => 'proxy_password',
  131. 'local_cert' => dirname(__FILE__).'/_files/cert_file',
  132. 'passphrase' => 'some pass phrase',
  133. 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5);
  134. $client->setOptions($options);
  135. $this->assertTrue($client->getOptions() == $options);
  136. }
  137. /**
  138. * @group ZF-8053
  139. */
  140. public function testGetAndSetUserAgentOption()
  141. {
  142. $client = new Zend_Soap_Client();
  143. $this->assertNull($client->getUserAgent());
  144. $client->setUserAgent('agent1');
  145. $this->assertEquals('agent1', $client->getUserAgent());
  146. $client->setOptions(array(
  147. 'user_agent' => 'agent2'
  148. ));
  149. $this->assertEquals('agent2', $client->getUserAgent());
  150. $client->setOptions(array(
  151. 'useragent' => 'agent3'
  152. ));
  153. $this->assertEquals('agent3', $client->getUserAgent());
  154. $client->setOptions(array(
  155. 'userAgent' => 'agent4'
  156. ));
  157. $this->assertEquals('agent4', $client->getUserAgent());
  158. $options = $client->getOptions();
  159. $this->assertEquals('agent4', $options['user_agent']);
  160. }
  161. /**
  162. * @group ZF-6954
  163. */
  164. public function testUserAgentAllowsEmptyString()
  165. {
  166. $client = new Zend_Soap_Client();
  167. $this->assertNull($client->getUserAgent());
  168. $options = $client->getOptions();
  169. $this->assertArrayNotHasKey('user_agent', $options);
  170. $client->setUserAgent('');
  171. $this->assertEquals('', $client->getUserAgent());
  172. $options = $client->getOptions();
  173. $this->assertEquals('', $options['user_agent']);
  174. $client->setUserAgent(null);
  175. $this->assertNull($client->getUserAgent());
  176. $options = $client->getOptions();
  177. $this->assertArrayNotHasKey('user_agent', $options);
  178. }
  179. public function testGetFunctions()
  180. {
  181. $server = new Zend_Soap_Server(dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  182. $server->setClass('Zend_Soap_Client_TestClass');
  183. $client = new Zend_Soap_Client_Local($server, dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  184. $this->assertTrue($client->getFunctions() == array('string testFunc1()',
  185. 'string testFunc2(string $who)',
  186. 'string testFunc3(string $who, int $when)',
  187. 'string testFunc4()'));
  188. }
  189. /**
  190. * @todo Implement testGetTypes().
  191. */
  192. public function testGetTypes()
  193. {
  194. // Remove the following line when you implement this test.
  195. $this->markTestIncomplete(
  196. "This test has not been implemented yet."
  197. );
  198. }
  199. public function testGetLastRequest()
  200. {
  201. if (headers_sent()) {
  202. $this->markTestSkipped('Cannot run testGetLastRequest() when headers have already been sent; enable output buffering to run this test');
  203. return;
  204. }
  205. $server = new Zend_Soap_Server(dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  206. $server->setClass('Zend_Soap_Client_TestClass');
  207. $client = new Zend_Soap_Client_Local($server, dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  208. // Perform request
  209. $client->testFunc2('World');
  210. $expectedRequest = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"
  211. . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" '
  212. . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
  213. . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
  214. . 'xmlns:enc="http://www.w3.org/2003/05/soap-encoding">'
  215. . '<env:Body>'
  216. . '<env:testFunc2 env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">'
  217. . '<who xsi:type="xsd:string">World</who>'
  218. . '</env:testFunc2>'
  219. . '</env:Body>'
  220. . '</env:Envelope>' . "\n";
  221. $this->assertEquals($client->getLastRequest(), $expectedRequest);
  222. }
  223. public function testGetLastResponse()
  224. {
  225. if (headers_sent()) {
  226. $this->markTestSkipped('Cannot run testGetLastResponse() when headers have already been sent; enable output buffering to run this test');
  227. return;
  228. }
  229. $server = new Zend_Soap_Server(dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  230. $server->setClass('Zend_Soap_Client_TestClass');
  231. $client = new Zend_Soap_Client_Local($server, dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  232. // Perform request
  233. $client->testFunc2('World');
  234. $expectedResponse = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"
  235. . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" '
  236. . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
  237. . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
  238. . 'xmlns:enc="http://www.w3.org/2003/05/soap-encoding">'
  239. . '<env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc">'
  240. . '<env:testFunc2Response env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">'
  241. . '<rpc:result>testFunc2Return</rpc:result>'
  242. . '<testFunc2Return xsi:type="xsd:string">Hello World!</testFunc2Return>'
  243. . '</env:testFunc2Response>'
  244. . '</env:Body>'
  245. . '</env:Envelope>' . "\n";
  246. $this->assertEquals($client->getLastResponse(), $expectedResponse);
  247. }
  248. public function testCallInvoke()
  249. {
  250. if (headers_sent()) {
  251. $this->markTestSkipped('Cannot run testCallInvoke() when headers have already been sent; enable output buffering to run this test');
  252. return;
  253. }
  254. $server = new Zend_Soap_Server(dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  255. $server->setClass('Zend_Soap_Client_TestClass');
  256. $client = new Zend_Soap_Client_Local($server, dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  257. $this->assertEquals($client->testFunc2('World'), 'Hello World!');
  258. }
  259. public function testSetOptionsWithZendConfig()
  260. {
  261. $ctx = stream_context_create();
  262. $nonWsdlOptions = array('soap_version' => SOAP_1_1,
  263. 'classmap' => array('TestData1' => 'Zend_Soap_Client_TestData1',
  264. 'TestData2' => 'Zend_Soap_Client_TestData2',),
  265. 'encoding' => 'ISO-8859-1',
  266. 'uri' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  267. 'location' => 'http://framework.zend.com/Zend_Soap_ServerTest.php',
  268. 'use' => SOAP_ENCODED,
  269. 'style' => SOAP_RPC,
  270. 'login' => 'http_login',
  271. 'password' => 'http_password',
  272. 'proxy_host' => 'proxy.somehost.com',
  273. 'proxy_port' => 8080,
  274. 'proxy_login' => 'proxy_login',
  275. 'proxy_password' => 'proxy_password',
  276. 'local_cert' => dirname(__FILE__).'/_files/cert_file',
  277. 'passphrase' => 'some pass phrase',
  278. 'stream_context' => $ctx,
  279. 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5
  280. );
  281. $config = new Zend_Config($nonWsdlOptions);
  282. $client = new Zend_Soap_Client(null, $config);
  283. $this->assertEquals($nonWsdlOptions, $client->getOptions());
  284. }
  285. public function testSetInputHeaders()
  286. {
  287. if (headers_sent()) {
  288. $this->markTestSkipped('Cannot run testSetInputHeaders() when headers have already been sent; enable output buffering to run this test');
  289. return;
  290. }
  291. $server = new Zend_Soap_Server(dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  292. $server->setClass('Zend_Soap_Client_TestClass');
  293. $client = new Zend_Soap_Client_Local($server, dirname(__FILE__) . '/_files/wsdl_example.wsdl');
  294. // Add request header
  295. $client->addSoapInputHeader(new SoapHeader('http://www.example.com/namespace', 'MyHeader1', 'SOAP header content 1'));
  296. // Add permanent request header
  297. $client->addSoapInputHeader(new SoapHeader('http://www.example.com/namespace', 'MyHeader2', 'SOAP header content 2'), true);
  298. // Perform request
  299. $client->testFunc2('World');
  300. $expectedRequest = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"
  301. . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" '
  302. . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
  303. . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
  304. . 'xmlns:ns1="http://www.example.com/namespace" '
  305. . 'xmlns:enc="http://www.w3.org/2003/05/soap-encoding">'
  306. . '<env:Header>'
  307. . '<ns1:MyHeader2>SOAP header content 2</ns1:MyHeader2>'
  308. . '<ns1:MyHeader1>SOAP header content 1</ns1:MyHeader1>'
  309. . '</env:Header>'
  310. . '<env:Body>'
  311. . '<env:testFunc2 env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">'
  312. . '<who xsi:type="xsd:string">World</who>'
  313. . '</env:testFunc2>'
  314. . '</env:Body>'
  315. . '</env:Envelope>' . "\n";
  316. $this->assertEquals($client->getLastRequest(), $expectedRequest);
  317. // Add request header
  318. $client->addSoapInputHeader(new SoapHeader('http://www.example.com/namespace', 'MyHeader3', 'SOAP header content 3'));
  319. // Perform request
  320. $client->testFunc2('World');
  321. $expectedRequest = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"
  322. . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" '
  323. . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
  324. . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
  325. . 'xmlns:ns1="http://www.example.com/namespace" '
  326. . 'xmlns:enc="http://www.w3.org/2003/05/soap-encoding">'
  327. . '<env:Header>'
  328. . '<ns1:MyHeader2>SOAP header content 2</ns1:MyHeader2>'
  329. . '<ns1:MyHeader3>SOAP header content 3</ns1:MyHeader3>'
  330. . '</env:Header>'
  331. . '<env:Body>'
  332. . '<env:testFunc2 env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">'
  333. . '<who xsi:type="xsd:string">World</who>'
  334. . '</env:testFunc2>'
  335. . '</env:Body>'
  336. . '</env:Envelope>' . "\n";
  337. $this->assertEquals($client->getLastRequest(), $expectedRequest);
  338. $client->resetSoapInputHeaders();
  339. // Add request header
  340. $client->addSoapInputHeader(new SoapHeader('http://www.example.com/namespace', 'MyHeader4', 'SOAP header content 4'));
  341. // Perform request
  342. $client->testFunc2('World');
  343. $expectedRequest = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"
  344. . '<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" '
  345. . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
  346. . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
  347. . 'xmlns:ns1="http://www.example.com/namespace" '
  348. . 'xmlns:enc="http://www.w3.org/2003/05/soap-encoding">'
  349. . '<env:Header>'
  350. . '<ns1:MyHeader4>SOAP header content 4</ns1:MyHeader4>'
  351. . '</env:Header>'
  352. . '<env:Body>'
  353. . '<env:testFunc2 env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">'
  354. . '<who xsi:type="xsd:string">World</who>'
  355. . '</env:testFunc2>'
  356. . '</env:Body>'
  357. . '</env:Envelope>' . "\n";
  358. $this->assertEquals($client->getLastRequest(), $expectedRequest);
  359. }
  360. /**
  361. * @group ZF-6955
  362. */
  363. public function testSetCookieIsDelegatedToSoapClient()
  364. {
  365. $fixtureCookieKey = "foo";
  366. $fixtureCookieValue = "bar";
  367. $clientMock = $this->getMock('SoapClient', array('__setCookie'), array(null, array('uri' => 'http://www.zend.com', 'location' => 'http://www.zend.com')));
  368. $clientMock->expects($this->once())
  369. ->method('__setCookie')
  370. ->with($fixtureCookieKey, $fixtureCookieValue);
  371. $soap = new Zend_Soap_Client();
  372. $soap->setSoapClient($clientMock);
  373. $soap->setCookie($fixtureCookieKey, $fixtureCookieValue);
  374. }
  375. public function testSetSoapClient()
  376. {
  377. $clientMock = $this->getMock('SoapClient', array('__setCookie'), array(null, array('uri' => 'http://www.zend.com', 'location' => 'http://www.zend.com')));
  378. $soap = new Zend_Soap_Client();
  379. $soap->setSoapClient($clientMock);
  380. $this->assertSame($clientMock, $soap->getSoapClient());
  381. }
  382. }
  383. /** Test Class */
  384. class Zend_Soap_Client_TestClass {
  385. /**
  386. * Test Function 1
  387. *
  388. * @return string
  389. */
  390. function testFunc1()
  391. {
  392. return "Hello World";
  393. }
  394. /**
  395. * Test Function 2
  396. *
  397. * @param string $who Some Arg
  398. * @return string
  399. */
  400. function testFunc2($who)
  401. {
  402. return "Hello $who!";
  403. }
  404. /**
  405. * Test Function 3
  406. *
  407. * @param string $who Some Arg
  408. * @param int $when Some
  409. * @return string
  410. */
  411. function testFunc3($who, $when)
  412. {
  413. return "Hello $who, How are you $when";
  414. }
  415. /**
  416. * Test Function 4
  417. *
  418. * @return string
  419. */
  420. static function testFunc4()
  421. {
  422. return "I'm Static!";
  423. }
  424. }
  425. /** Test class 2 */
  426. class Zend_Soap_Client_TestData1 {
  427. /**
  428. * Property1
  429. *
  430. * @var string
  431. */
  432. public $property1;
  433. /**
  434. * Property2
  435. *
  436. * @var float
  437. */
  438. public $property2;
  439. }
  440. /** Test class 2 */
  441. class Zend_Soap_Client_TestData2 {
  442. /**
  443. * Property1
  444. *
  445. * @var integer
  446. */
  447. public $property1;
  448. /**
  449. * Property1
  450. *
  451. * @var float
  452. */
  453. public $property2;
  454. }
  455. /* Test Functions */
  456. /**
  457. * Test Function
  458. *
  459. * @param string $arg
  460. * @return string
  461. */
  462. function Zend_Soap_Client_TestFunc1($who)
  463. {
  464. return "Hello $who";
  465. }
  466. /**
  467. * Test Function 2
  468. */
  469. function Zend_Soap_Client_TestFunc2()
  470. {
  471. return "Hello World";
  472. }
  473. /**
  474. * Return false
  475. *
  476. * @return bool
  477. */
  478. function Zend_Soap_Client_TestFunc3()
  479. {
  480. return false;
  481. }
  482. /**
  483. * Return true
  484. *
  485. * @return bool
  486. */
  487. function Zend_Soap_Client_TestFunc4()
  488. {
  489. return true;
  490. }
  491. /**
  492. * Return integer
  493. *
  494. * @return int
  495. */
  496. function Zend_Soap_Client_TestFunc5()
  497. {
  498. return 123;
  499. }
  500. /**
  501. * Return string
  502. *
  503. * @return string
  504. */
  505. function Zend_Soap_Client_TestFunc6()
  506. {
  507. return "string";
  508. }
  509. if (PHPUnit_MAIN_METHOD == 'Zend_Soap_ClientTest::main') {
  510. Zend_Soap_ClientTest::main();
  511. }