Мне нужно сделать SOAP запрос, как в моем файле спецификации:
<s:complexType name="RegisterLoanApplicationRequest"> <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="BorrowerData" nillable="true" type="tns:BorrowerData"/>
<s:element minOccurs="0" maxOccurs="1" name="Income" type="tns:Income"/>
<s:element minOccurs="0" maxOccurs="1" name="Liabilities" type="tns:Liabilities"/>
<s:element minOccurs="1" maxOccurs="1" name="LoanApplicationData" nillable="true" type="tns:LoanApplicationData"/>
</s:sequence>
</s:complexType>
, и я пытаюсь так:
$certificate = dirname( __FILE__ ) . '/cert/cert.pem';
$options = [
'cache_wsdl' => WSDL_CACHE_NONE,
'exceptions' => true,
'trace' => true,
'local_cert' => $certificate,
'authentication' => SOAP_AUTHENTICATION_DIGEST
];
$client = new SoapClient($this->host, $options);
try {
$response = $client->__soapCall('RegisterLoanApplication', [
'RegisterLoanApplicationRequest' => [
'BorrowerData' => [
'ResidenceAddress' => [
'City' => 'City',
'PostalCode' => '50-261',
'Street' => 'Street',
'StreetNumber' => 7
],
'BusinessBorrowerID' => 16,
'Email' => 'test@test.pl',
'ForeName' => 'test',
'IdentityCardNumber' => 'AAA123456',
'Phone' => '235345345',
'PESEL' => '18300481496',
'Surname' => 'Kowalski',
'ProductionDate' => '2018-08-09'
],
'LoanApplicationData' => [
'LoanApplicationDate' => '2018-08-09',
'BusinessLoanApplicationID' => '194',
'PayoffPlannedDate' => '2019-10-24',
'ProductType' => 'LINE_CREDIT',
'RequestedAmountPLN' => 1500,
'RequestedCurrency' => 'PLN',
'ReturnReportClaimFlag' => true
]
]
]);
if ($response) {
$data['data'] = $response;
}
} catch (SoapFault $fault) {
$data['error'] = $fault->detail;
$data['lastRequest'] = $client->__getLastRequest();
}
но в функции getLastRequest - я получаю это тело запроса:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://customer.bfp.krd.pl/"><SOAP-ENV:Body><ns1:RegisterLoanApplication/></SOAP-ENV:Body></SOAP-ENV:Envelope>
Я получил пустое тело, что я делаю не так? Может быть, мне нужны дополнительные параметры здесь? Мне нужна твоя помощь.