dtio35880438 2019-02-23 11:20
浏览 235

通过php soap client请求返回500错误

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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的