I'm using the basic SOAP client of php => 7 to make a request to a third party web service. The authentication works fine and I can get all data from it but can't do a request to send some data.
The basic data (in xml-format) what they need is:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:day="https://daywize.mendixcloud.com">
<soapenv:Header>
<day:authentication>
<username>someusername</username>
<password>somepassword</password>
</day:authentication>
</soapenv:Header>
<soapenv:Body>
<day:SollicitatieWebservicesVerwerken>
<MedewerkerTemp>
<Achternaam>exampleinput</Achternaam>
<EmailadresPrive>email@example.nl</EmailadresPrive>
<EmailadresWerk></EmailadresWerk>
<GeboorteDatum>2002-05-30T09:30:10.5</GeboorteDatum>
<Geboortenaam></Geboortenaam>
<GeboortePlaats>exampleinput</GeboortePlaats>
<Geslacht>Man</Geslacht>
<OpmerkingenInteresses></OpmerkingenInteresses>
<OpmerkingenMotivatie></OpmerkingenMotivatie>
<OpmerkingenOpleiding></OpmerkingenOpleiding>
<OpmerkingenWerkervaring></OpmerkingenWerkervaring>
<Plaats>exampleinput</Plaats>
<StraatInclNummer></StraatInclNummer>
<Postcode></Postcode>
<Roepnaam>Henk</Roepnaam>
<TelefoonVast>010-123456789</TelefoonVast>
<TelefoonMobiel></TelefoonMobiel>
<TelefoonWerk></TelefoonWerk>
<Voorletters>H</Voorletters>
<Voorvoegsels></Voorvoegsels>
<_InterneSollicitatie>false</_InterneSollicitatie>
<_Mobiliteitskandidaat>false</_Mobiliteitskandidaat>
<VacatureNummer></VacatureNummer>
<Base64Decode_CV></Base64Decode_CV>
<Base64Decode_Motivatiebrief></Base64Decode_Motivatiebrief>
<Base64Decode_ExtraBijlage></Base64Decode_ExtraBijlage>
<Bestandsnaam_CV>CV</Bestandsnaam_CV>
<Bestandsnaam_Motivatiebrief></Bestandsnaam_Motivatiebrief>
<Bestandsnaam_ExtraBijlage></Bestandsnaam_ExtraBijlage>
<_OpenSollicitatie>true</_OpenSollicitatie>
<LinkedIn>?</LinkedIn>
<Twitter>?</Twitter>
<_StopzettenJobalert>false</_StopzettenJobalert>
<_LangereBewaartermijnAVG>false</_LangereBewaartermijnAVG>
</MedewerkerTemp>
</day:SollicitatieWebservicesVerwerken>
</soapenv:Body>
</soapenv:Envelope>
The SOAP request I do to the server looks like:
try {
$this->_SoapClient->webserviceFunctionName([
'MedewerkerTemp' => [
'Achternaam' => 'exampleinput',
'EmailadresPrive' => 'email@example.nl',
'EmailadresWerk' => '',
'GeboorteDatum' => '2002-05-30T09:30:10.5',
'Geboortenaam' => '',
'GeboortePlaats' => 'exampleinput',
'Geslacht' => 'Man',
'OpmerkingenInteresses' => '',
'OpmerkingenMotivatie' => '',
'OpmerkingenOpleiding' => '',
'OpmerkingenWerkervaring' => '',
'Plaats' => 'exampleinput',
'StraatInclNummer' => '',
'Postcode' => '',
'Roepnaam' => 'Henk',
'TelefoonVast' => '010-123456789',
'TelefoonMobiel' => '',
'TelefoonWerk' => '',
'Voorletters' => 'H',
'Voorvoegsels' => 'test',
'_InterneSollicitatie' => false,
'_Mobiliteitskandidaat' => false,
'VacatureNummer' => '',
'Base64Decode_CV' => '',
'Base64Decode_Motivatiebrief' => '',
'Base64Decode_ExtraBijlage' => '',
'Bestandsnaam_CV' => 'CV',
'Bestandsnaam_Motivatiebrief' => '',
'Bestandsnaam_ExtraBijlage' => '',
'_OpenSollicitatie' => true,
'LinkedIn' => '?',
'Twitter' => '?',
'_StopzettenJobalert' => false,
'_LangereBewaartermijnAVG' => false
],
]);
} catch (Exception $e) {
var_dump(
$e->getMessage(),
$this->_SoapClient->__getLastRequest(),
$this->_SoapClient->__getLastResponse()
);
}
The request always end up inside the catch because the request returns a internal server error message like "Internal server error". Also when I add ini_set('display_errors', 1); error_reporting(E_ALL);
I can't figure out what the cause is. I'm expect that I send all basic needed values to it. I hope someone can help me with this.
Update:
When I echoing the request like below the output will be:
echo "REQUEST:
" . $this->_SoapClient->__getLastRequest() . "
";
REQUEST: someUernameSomePasswordMedewerkerTempAchternaamexampleinputEmailadresPriveemail@example.nlEmailadresWerkGeboorteDatum2002-05-30T09:30:10.5GeboortenaamGeboortePlaatsexampleinputGeslachtManOpmerkingenInteressesOpmerkingenMotivatieOpmerkingenOpleidingOpmerkingenWerkervaringPlaatsexampleinputStraatInclNummerPostcodeRoepnaamHenkTelefoonVast010-123456789TelefoonMobielTelefoonWerkVoorlettersHVoorvoegselstest_InterneSollicitatiefalse_MobiliteitskandidaatfalseVacatureNummerBase64Decode_CVBase64Decode_MotivatiebriefBase64Decode_ExtraBijlageBestandsnaam_CVCVBestandsnaam_MotivatiebriefBestandsnaam_ExtraBijlage_OpenSollicitatietrueLinkedIn?Twitter?_StopzettenJobalertfalse_LangereBewaartermijnAVGfalse