1

我正在尝试从 GLS 的 Track and Trace 网络服务中获取一些数据。我希望获得带有参考号的特定订单的数据。此示例中的确切订单号存在,我可以从他们的网站访问它。但我不能使用这个网络服务。

.wsdl 可在此处访问:

http://www.gls-group.eu/276-I-PORTAL-WEBSERVICE/services/Tracking/wsdl/Tracking.wsdl

这就是我现在正在做的事情:

$reference = array(
    'Credentials' => array('UserName' => 'hidden', 'Password' => 'secret'),
    'RefValue' => '291054'
);
$client = new SoapClient('http://www.gls-group.eu/276-I-PORTAL-WEBSERVICE/services/Tracking/wsdl/Tracking.wsdl', array('login' => 'hidden', 'password' => 'secret'));
$result = $client->GetTuDetail($reference);

return $result;

我一直在尝试各种方法来获取数据,但请求大约需要 50 秒,然后返回:

stdClass Object
(
    [ExitCode] => stdClass Object
        (
            [ErrorCode] => 998
            [ErrorDscr] => No data found
        )

    [TuNo] => 
    [NationalRef] => 
    [ConsigneeAddress] => 
    [ShipperAddress] => 
    [RequesterAddress] => 
    [DeliveryDateTime] => 
    [PickupDateTime] => 
    [Product] => 
    [TuWeight] => 0
)

我已经拔掉了头上的每一根头发,我在这里错过了什么?提前致谢,一百万次。

4

1 回答 1

2
$reference = array(
    'Credentials' => array('UserName' => 'hidden', 'Password' => 'secret'),
    'RefValue' => '18235206982'
);
$client = new SoapClient("http://www.gls-group.eu/276-I-PORTAL-WEBSERVICE/services/Tracking/wsdl/Tracking.wsdl");
$result = $client->GetTuDetail($reference);

print_r($result);

“RefValue”是一个有效的包裹号码,因此您应该得到正确的回复。

于 2013-01-20T12:34:45.407 回答