白色屏幕与肥皂要求

时间:2015-02-19 15:28:42

标签: php xml curl soap

我有一个物流网站,允许公司在一个地方获得货运公司的所有报价。我一直致力于为我的客户将Averitt Express费率报价API添加到我的其他运营商。当我将此代码添加到现有代码时,我得到一个白色屏幕。如果我将此代码放在一个独立的文件中,它会输出所需的所需信息。任何人都可以帮我解释为什么在添加现有代码时会出现白屏?

if($cominfo[0]['companyNAME'] == "Averitt Express" && $rescar12[0]['login']!="" && $rescar12[0]['carpassword']!="" && $rescar12[0]['accountNUMBER']!="" ){

require_once "Curler.php";

use grafhax\Curler;



$soap = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:ltl="https://webservices.averittexpress.com/LTLRateQuoteService">
    <soapenv:Header xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <ns:authnHeader soapenv:mustUnderstand="0" xmlns:ns="http://webservices.averittexpress.com/authn">
            <Username>xxxx</Username>
            <Password>xxxxxx</Password>
        </ns:authnHeader>
    </soapenv:Header>
    <soapenv:Body>
    <ltl:getLTLRate>

         <!--Optional:-->

         <arg0>

            <!--Optional:-->



            <!--Optional:-->

            <ltl:AccountNumber>xxxxxx</ltl:AccountNumber>

            <!--Optional:-->



            <!--Optional:-->

            <ltl:OriginCity>Randleman</ltl:OriginCity><ltl:OriginState>NC</ltl:OriginState>

            <!--Optional:-->

            <ltl:OriginZip>27317</ltl:OriginZip>

            <!--Optional:-->

            <ltl:DestinationCity>Miami</ltl:DestinationCity>

            <!--Optional:-->

            <ltl:DestinationState>FL</ltl:DestinationState>

            <!--Optional:-->

            <ltl:DestinationZip>33101</ltl:DestinationZip>

            <!--Optional:-->

            <ltl:ShipDate>02/16/2015</ltl:ShipDate><ltl:CustomerType>Shipper</ltl:CustomerType>

            <!--Optional:-->



            <!--Optional:-->

            <ltl:PaymentType>Prepaid</ltl:PaymentType><ltl:ShipmentInfo>

               <!--Optional:-->



               <!--Optional:-->

               <ltl:NumHandlingUnits></ltl:NumHandlingUnits>

               <!--Optional:-->

               <ltl:CubicFeet></ltl:CubicFeet>

               <!--Zero or more repetitions:-->

               <ltl:Items>

                  <!--Optional:-->



                  <!--Optional:-->

                  <ltl:ShipmentClass>60</ltl:ShipmentClass>

                  <!--Optional:-->

                  <ltl:ShipmentWeight>500</ltl:ShipmentWeight><ltl:Units>?</ltl:Units>

                  <!--Optional:-->

                  <ltl:Description></ltl:Description>

                  <!--Optional:-->

                  <ltl:NmfcNumber></ltl:NmfcNumber>

                  <!--Optional:-->

                  <ltl:NmfcSubNumber></ltl:NmfcSubNumber>

               </ltl:Items>

               <!--Optional:-->

               <ltl:TotalItem></ltl:TotalItem>

               <!--Optional:-->

               <ltl:TotalWeight></ltl:TotalWeight>

               <!--Zero or more repetitions:-->

               <ltl:Accessorial>

                  <ltl:ArrivalNotify>true</ltl:ArrivalNotify>

                  <ltl:ConventionCenterDelivery>false</ltl:ConventionCenterDelivery>

                  <ltl:ConstructionSiteDelivery>false</ltl:ConstructionSiteDelivery>

                  <ltl:InsideDelivery>false</ltl:InsideDelivery>

                  <ltl:Liftgate>false</ltl:Liftgate>

                  <ltl:Hazmat>false</ltl:Hazmat>

                  <ltl:ResidentialDelivery>false</ltl:ResidentialDelivery>

                  <ltl:Non-CommercialPickupDelivery>false</ltl:Non-CommercialPickupDelivery>

                  <ltl:StandardLTLGuarantee>false</ltl:StandardLTLGuarantee>

                  <ltl:SecurityInspection>false</ltl:SecurityInspection>

               </ltl:Accessorial>

            </ltl:ShipmentInfo>

         </arg0>

      </ltl:getLTLRate>

   </soapenv:Body></soapenv:Envelope>';

//print_r($soap);exit;

$curl = new Curler();
$curl->fail_on_error = 0;
$curl->debug=true;
$curl->SetHeader('Content-Type', 'text/xml;charset="utf-8"');

//$curl->PostData('https://webservices.averittexpress.com/LTLRateQuoteService', $soap, false, true, false, '', "$user:$pass");
//var_dump($curl->response);

//exit;

//$curl->PostData('https://webservices.averittexpress.com/LTLRateQuoteService', $soap, $this->lastUrl, true, false, '', "$user:$pass");
$curl->PostData('https://webservices.averittexpress.com/LTLRateQuoteService', $soap);

$xml = simplexml_load_string($curl->response);
$ns = $xml->getNamespaces(true);

$getLTLRateResponse = $xml->children($ns['soapenv'])->Body->children($ns['ns2'])->children()->return->children($ns['ns2']);

echo $getLTLRateResponse->TotalFreightCharge;

 $_SESSION['AE'][$counter]['TotalFreightCharge'] = $getLTLRateResponse->TotalFreightCharge;


                }

0 个答案:

没有答案