Skip to content

Instantly share code, notes, and snippets.

@yeriomin
Created August 3, 2012 15:27
Show Gist options
  • Select an option

  • Save yeriomin/3248648 to your computer and use it in GitHub Desktop.

Select an option

Save yeriomin/3248648 to your computer and use it in GitHub Desktop.
Neuro SOAP service example
<?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";
}
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