Probleme mit einem Fedex-Webservice per WSDL/SOAP

Ich habe die Beispiel-code zur Anforderung einer rate von fedex website... ich legte die WSDL-Datei in der richtigen Position, ich habe meine Konto-Nummer, Passwort, zählernummer und Schlüssel. Wenn ich das Skript bekomme ich diesen Fehler:

Fehler bei der Verarbeitung der Transaktion.

FEHLER

prof

1000

Authentifizierung Fehlgeschlagen

Das Skript, die Sie geben, ist wie folgt, und ja, das Tue ich tatsächlich ersetzen Sie die XXX und YYY ist es überall sagt.:

<?php

//Copyright 2009, FedEx Corporation. All rights reserved.
//Version 7.0.0

require_once('fedex-common.php5');

$newline = "<br />";
//The WSDL is not included with the sample code.
//Please include and reference in $path_to_wsdl variable.
$path_to_wsdl = "RateService_v7.wsdl";

ini_set("soap.wsdl_cache_enabled", "0");

$client = new SoapClient($path_to_wsdl, array('trace' => 1)); //Refer to http://us3.php.net/manual/en/ref.soap.php for more information

$request['WebAuthenticationDetail'] = array('UserCredential' =>
                                      array('Key' => 'XXX', 'Password' => 'YYY')); //Replace 'XXX' and 'YYY' with FedEx provided credentials 
$request['ClientDetail'] = array('AccountNumber' => 'XXX', 'MeterNumber' => 'YYY');//Replace 'XXX' with your account and meter number
$request['TransactionDetail'] = array('CustomerTransactionId' => ' *** Rate Request v7 using PHP ***');
$request['Version'] = array('ServiceId' => 'crs', 'Major' => '7', 'Intermediate' => '0', 'Minor' => '0');
$request['ReturnTransitAndCommit'] = true;
$request['RequestedShipment']['DropoffType'] = 'REGULAR_PICKUP'; //valid values REGULAR_PICKUP, REQUEST_COURIER, ...
$request['RequestedShipment']['ShipTimestamp'] = date('c');
$request['RequestedShipment']['ServiceType'] = 'FEDEX_GROUND'; //valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ...
$request['RequestedShipment']['PackagingType'] = 'YOUR_PACKAGING'; //valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ...
$request['RequestedShipment']['Shipper'] = array('Address' => array(
                                          'StreetLines' => array('10 Fed Ex Pkwy'), //Origin details
                                          'City' => 'Memphis',
                                          'StateOrProvinceCode' => 'TN',
                                          'PostalCode' => '38115',
                                          'CountryCode' => 'US'));
$request['RequestedShipment']['Recipient'] = array('Address' => array (
                                               'StreetLines' => array('13450 Farmcrest Ct'), //Destination details
                                               'City' => 'Herndon',
                                               'StateOrProvinceCode' => 'VA',
                                               'PostalCode' => '20171',
                                               'CountryCode' => 'US'));
$request['RequestedShipment']['ShippingChargesPayment'] = array('PaymentType' => 'SENDER',
                                                        'Payor' => array('AccountNumber' => 'XXX', //Replace 'XXX' with payor's account number
                                                                     'CountryCode' => 'US'));
$request['RequestedShipment']['RateRequestTypes'] = 'ACCOUNT'; 
$request['RequestedShipment']['RateRequestTypes'] = 'LIST'; 
$request['RequestedShipment']['PackageCount'] = '2';
$request['RequestedShipment']['PackageDetailSpecified'] = true;
$request['RequestedShipment']['PackageDetail'] = 'INDIVIDUAL_PACKAGES';  // Or PACKAGE_SUMMARY
$request['RequestedShipment']['RequestedPackageLineItems'] = array('0' => array('Weight' => array('Value' => 2.0,
                                                                                    'Units' => 'LB'),
                                                                                    'Dimensions' => array('Length' => 10,
                                                                                        'Width' => 10,
                                                                                        'Height' => 3,
                                                                                        'Units' => 'IN')),
                                                                   '1' => array('Weight' => array('Value' => 5.0,
                                                                                    'Units' => 'LB'),
                                                                                    'Dimensions' => array('Length' => 20,
                                                                                        'Width' => 20,
                                                                                        'Height' => 10,
                                                                                        'Units' => 'IN')));
try 
{
    $response = $client ->getRates($request);

    if ($response -> HighestSeverity != 'FAILURE' && $response -> HighestSeverity != 'ERROR')
    {
        printRequestResponse($client);
    }
    else
    {
        echo 'Error in processing transaction.'. $newline. $newline; 
        foreach ($response -> Notifications as $notification)
        {           
            if(is_array($response -> Notifications))
            {              
               echo $notification -> Severity;
               echo ': ';           
               echo $notification -> Message . $newline;
            }
            else
            {
                echo $notification . $newline;
            }
        } 
    } 

    writeToLog($client);    //Write to log file   

} catch (SoapFault $exception) {
   printFault($exception, $client);        
}

?>

Ich bin nicht ganz sicher, warum es nicht funktioniert, die ich gelesen habe über die Verwendung von einem proxy, aber ich bin nicht ganz sicher, wie würde ich es in diesem Fall? Ist das nicht der Punkt, der die Verwendung von SOAP und WSDL zu vermeiden, mit CURL, Direct Connect Typ Zeug?

  • Ich habe versucht, dies für einen anderen service (die AddressValidationService) und da war es aufgelistet unter Advanced Services auf der Fedex-Entwickler-Ressourcen-site, Sie musste rufen Sie Ihre tech-support-Nummer (1.877.339.2774) und bitten Sie Sie, Ihnen zu ermöglichen, für Ihre jeweilige API-key.
  • danke. ich bin vor dem gleichen Problem, ich habe mit url gegeben, indem Sie.aber noch vor diesem Problem. irgendwelche Ideen ?
  • Wo ist der tatsächliche Preis? Alles, was ich sehe, ist die Rückkehr Wert der Felder, auf die ich Einreichen
InformationsquelleAutor Parris | 2010-01-06
Schreibe einen Kommentar