簡體   English   中英

在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的肥皂

$ client = new 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);
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM