首页 文章

在php中调用soap函数时出错

提问于
浏览
0

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

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

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

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

1 回答

  • 0

    请尝试以下方法:

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

相关问题