Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 带soap请求的白色屏幕_Php_Xml_Curl_Soap - Fatal编程技术网

Php 带soap请求的白色屏幕

Php 带soap请求的白色屏幕,php,xml,curl,soap,Php,Xml,Curl,Soap,我有一个物流网站,允许公司在一个地点获得货运公司的所有报价。我一直在为我的客户将Averitt Express费率报价API添加到我的其他运营商中。当我将此代码添加到现有代码时,我得到了一个白色屏幕。如果我把这个代码放在一个独立的文件中,它会输出所需的信息。有人能帮我解释一下为什么在添加到现有代码时会出现白色屏幕吗 if($cominfo[0]['companyNAME'] == "Averitt Express" && $rescar12[0]['login']!="" &am

我有一个物流网站,允许公司在一个地点获得货运公司的所有报价。我一直在为我的客户将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;


                }

白色屏幕通常意味着您在某个地方有错误,并且没有打开错误报告。可能会有帮助。错误报告处于启用状态,并且我没有从该代码中得到任何错误。