Created
August 3, 2012 15:27
-
-
Save yeriomin/3248648 to your computer and use it in GitHub Desktop.
Neuro SOAP service example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $client = new SoapClient( | |
| 'http://www.polisbroker.ru/WebCalculator/services/CService?wsdl', | |
| array( | |
| 'trace' => true, | |
| 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, | |
| 'encoding' => 'utf-8', | |
| ) | |
| ); | |
| $parameters[] = new SoapVar( | |
| '<ns1:getProgramms>' | |
| . '<ns1:user>' | |
| . '<ns1:login>EVROSIB</ns1:login>' | |
| . '<ns1:password>EVROSIB</ns1:password>' | |
| . '</ns1:user>' | |
| . '</ns1:getProgramms>', | |
| XSD_ANYXML | |
| ); | |
| try { | |
| $ensuranceCampaign = $client->__call( | |
| 'getProgramms', | |
| $parameters | |
| ); | |
| echo 'Everything is fine:' . "\n"; | |
| echo print_r($ensuranceCampaign, true) . "\n"; | |
| echo $client->__getLastRequest() . "\n"; | |
| } catch (SoapFault $exception) { | |
| echo 'Exception:' . "\n"; | |
| echo print_r($exception, true) . "\n"; | |
| echo $client->__getLastRequest() . "\n"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Everything is fine: | |
| stdClass Object | |
| ( | |
| [return] => stdClass Object | |
| ( | |
| [programms] => stdClass Object | |
| ( | |
| [id] => 50448 | |
| [nazvanie] => КАСКО | |
| [strahovaaKompania] => ЗАО «ЕВРОСИБ-СТРАХОВАНИЕ» | |
| ) | |
| ) | |
| ) | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://services.pointegracia.lois.ru"><SOAP-ENV:Body><ns1:getProgramms><ns1:user><ns1:login>EVROSIB</ns1:login><ns1:password>EVROSIB</ns1:password></ns1:user></ns1:getProgramms></SOAP-ENV:Body></SOAP-ENV:Envelope> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment