3

dpd.com から配送ラベルを取得しようとしています。このために、タスクを実行するために石鹸を使用する必要があります。ログイン認証が完了し、AuthToken を取得しました。これがそのコードです。

<?php
$c = new SoapClient('https://public-ws-stage.dpd.com/services/LoginService/V2_0/?WSDL');
$res = $c->getAuth(array(
    'delisId' => 'username',
    'password' => 'password',
    'messageLanguage' => 'en-us',
));
$authToken = $res->return->authToken;

さて、問題は、リクエストを送信してこの AuthToken を使用して配送ラベルを取得したいということです。石鹸リクエストの形式はそのようなものです。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns="http://dpd.com/common/service/types/Authentication/2.0"
                  xmlns1="https://public-ws-stage.dpd.com/services/ShipmentService/V3_2/?wsdl">
    <soapenv:Header>
        <ns:authentication>
            <delisId>username</delisId>
            <authToken>AuthToken From Above</   authToken>
            <messageLanguage>en-us</messageLanguage>
        </ns:authentication>
    </soapenv:Header>
    <soapenv:Body>
        <ns1:storeOrders>
            <paperFormat>A4</paperFormat>
            <order>
                <generalShipmentData>
                    <sendingDepot>'.$depot_num.'</sendingDepot>
                    <product>CL</product>
                    <mpsCompleteDeliver>false</mpsCompleteDeliver>
                    <sender>
                        <name1>Fritz</name1>
                        <street>Mustergasse</street>
                        <houseNo>1</houseNo>
                        <state>BY</state>
                        <country>DE</country>
                        <zipCode>53950</zipCode>
                        <city>Maibach</city>
                    </sender>
                    <recipient>
                        <name1></name1>
                        <street></street>
                        <houseNo></houseNo>
                        <state></state>
                        <country></country>
                        <zipCode></zipCode>
                        <city></city>
                        </recipient>
                </generalShipmentData>
                <parcels>
                    <parcelLabelNumber></parcelLabelNumber>
                </parcels>
                <productAndServiceData>
                    <orderTyp></orderType>
                </productAndServiceData>
            </order>
        </ns1:storeOrdes>
    </soapenv:Body> 
</soapenv:Envelope>

しかし、このリクエストを送信して pdfData タグでレスポンスを取得する方法がわかりません。

4

1 に答える 1