【问题标题】:error in calling soap function in php在php中调用soap函数时出错
【发布时间】:2013-11-28 13:06:33
【问题描述】:

我如何从这个站点获取 php 中的肥皂数据 http://www2.rlcarriers.com/freight/shipping-resources/rate-quote-instructions

他们有“GetRateQuote(string APIKey, RequestObjects.RateQuoteRequest request)” 这个函数我怎么能从 php soap 调用这个

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

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

【问题讨论】:

    标签: php soap


    【解决方案1】:

    尝试以下方法:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-02
      • 2011-09-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多