Expedia API显示“无法处理此请求。身份验证失败”错误

时间:2012-06-26 05:39:25

标签: php xml

我是EAN开发的新手。我正在使用EAN开发PHP的酒店预订系统。我想从EAN API获取预订详细信息。

以下是我的代码:

$itinerary = xxxxxx;
        $cid = 55505;
        $minorRev = 13;
        $apiKey = "y2dfnyvwbwkvgth76hfjdej7";
        $locale = "en_US";
        $currencyCode = "USD";
        $customerSessionId;
        $customerUserAgent;
        $customerIpAddress;
        $url = "http:api.ean.com/ean-services/rs/hotel/v3/";
        $urlBook = "https:book.api.ean.com/ean-services/rs/hotel/v3/";

        $url = ($service == 'res') ? $urlBook : $url;
        $url .= $service
                . "?minorRev={$minorRev}"
                . "&cid={$cid}"
                . "&apiKey={$apiKey}"
                . "&customerUserAgent=" . rawurlencode($customerUserAgent)
                . "&customerIpAddress={$customerIpAddress}"
                . "&customerSessionId={$customerSessionID}"
                . "&locale={$locale}"
                . "&currencyCode={$currencyCode}";

        $xml = "
        <HotelItineraryRequest>
            <itineraryId>{$itinerary}</itineraryId>
            <email>customer@mail.com</email>
       </HotelItineraryRequest>
        ";

        $curl = new Curl();
        $info = $curl->exec($xml, $url, "ItinerarySearch");
        print_r($info);

显示以下错误: 无法为此请求提供服务。身份验证失败

此代码有什么问题。是否有任何解决方案,我如何从EAN获得预订详细信息。

我使用expedia中的演示php代码库:http://developer.ean.com/code_library/samples/PHP_Booking

提前致谢。

0 个答案:

没有答案