在php中调用soap函数时出错


error in calling soap function in php

如何从该站点获取php中的soap数据http://www2.rlcarriers.com/freight/shipping-resources/rate-quote-instructions

他们有"GetRateQuote(字符串APIKey,RequestObjects.RateQuoteRequest请求)"这个函数我如何从php-soap-调用它

$client=新SoapClient('http://api.rlcarriers.com/1.0.1/RateQuoteService.asmx?WSDL');//print_r($client);//$result=$client->GetRateQuote('xxxxxxxxxxxxxxxxxxxxxx……',);

print_r($result);?>我应该在第二个参数中传递什么

尝试以下操作:

$client = new SoapClient("http://api.rlcarriers.com/1.0.1/ShipmentTracingService.asmx?WSDL", array("trace" => 1));
$request = array(
    "APIKey" => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "request" => array(
        "TraceNumbers" => array(
            0 => "xxxxxxxxx"
        ),
        "TraceType" => "PRO",
        "FormatResults" => "true",
        "IncludeBlind" => "true",
        "OutputFormat" => "Standard"
    )
);
try {
    $response = $client->TraceShipment($request);
    print_r($response);
}
catch (SoapFault $exception) {
    print_r($exception);
}