Php Bing流量API消失事件、结果波动

Php Bing流量API消失事件、结果波动,php,xml,bing-maps,bing-api,Php,Xml,Bing Maps,Bing Api,我正在解析Bing API,用于该地区的交通事故,我使用URL 示例结果是: <?xml version="1.0" encoding="UTF-8"?> <Response> <Copyright>Copyright © 2015 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results m

我正在解析Bing API,用于该地区的交通事故,我使用URL

示例结果是:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
   <Copyright>Copyright © 2015 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.</Copyright>
   <BrandLogoUri>http://dev.virtualearth.net/Branding/logo_powered_by.png</BrandLogoUri>
   <StatusCode>200</StatusCode>
   <StatusDescription>OK</StatusDescription>
   <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
   <TraceId>b6b8a1174b3c40738f754f3ed0d443db|BN20130731|02.00.174.2300|BN20010843</TraceId>
   <ResourceSets>
      <ResourceSet>
         <EstimatedTotal>3</EstimatedTotal>
         <Resources>
            <TrafficIncident>
               <Point>
                  <Latitude>38.8677</Latitude>
                  <Longitude>-94.80368</Longitude>
               </Point>
               <Source>4</Source>
               <IncidentId>9000000669</IncidentId>
               <LastModifiedUTC>2015-06-24T15:12:15.0238037Z</LastModifiedUTC>
               <StartTimeUTC>2015-05-20T16:45:09Z</StartTimeUTC>
               <EndTimeUTC>2015-07-10T17:19:00Z</EndTimeUTC>
               <Type>Miscellaneous</Type>
               <Severity>Serious</Severity>
               <Verified>true</Verified>
               <RoadClosed>true</RoadClosed>
               <Description>is closed between I-35 and I-35 - closed</Description>
               <ToPoint>
                  <Latitude>38.8677</Latitude>
                  <Longitude>-94.80368</Longitude>
               </ToPoint>
            </TrafficIncident>
            <TrafficIncident>
               <Point>
                  <Latitude>38.95653</Latitude>
                  <Longitude>-94.74221</Longitude>
               </Point>
               <Source>4</Source>
               <IncidentId>9000000690</IncidentId>
               <LastModifiedUTC>2015-06-24T15:12:15.0238037Z</LastModifiedUTC>
               <StartTimeUTC>2015-05-27T17:08:07Z</StartTimeUTC>
               <EndTimeUTC>2015-10-05T09:04:00Z</EndTimeUTC>
               <Type>Miscellaneous</Type>
               <Severity>Serious</Severity>
               <Verified>true</Verified>
               <RoadClosed>true</RoadClosed>
               <Description>is closed between W 95th St and W 95th St - closed</Description>
               <ToPoint>
                  <Latitude>38.95653</Latitude>
                  <Longitude>-94.74221</Longitude>
               </ToPoint>
            </TrafficIncident>
            <TrafficIncident>
               <Point>
                  <Latitude>38.94201</Latitude>
                  <Longitude>-94.74218</Longitude>
               </Point>
               <Source>4</Source>
               <IncidentId>9000000691</IncidentId>
               <LastModifiedUTC>2015-06-24T15:12:15.0238037Z</LastModifiedUTC>
               <StartTimeUTC>2015-05-27T17:10:13Z</StartTimeUTC>
               <EndTimeUTC>2015-10-05T09:05:00Z</EndTimeUTC>
               <Type>Miscellaneous</Type>
               <Severity>Serious</Severity>
               <Verified>true</Verified>
               <RoadClosed>true</RoadClosed>
               <Description>is closed between W 103rd St and W 103rd St - closed</Description>
               <ToPoint>
                  <Latitude>38.94201</Latitude>
                  <Longitude>-94.74218</Longitude>
               </ToPoint>
            </TrafficIncident>
         </Resources>
      </ResourceSet>
   </ResourceSets>
</Response>

我没有看到任何说明如何设置超时的文档,因此我觉得simplexml_load_file()函数应该等待xml响应的整个加载。

在读取xml之前,您没有等待服务器的整个响应。服务器内置在Bing API中。@jdweng我使用simplexml_load_file(),正如我在编辑的问题中添加的,我不认为这应该如何部分加载xml,文档中没有提到在方法上设置任何超时。我不喜欢使用第三方API。使用以下网页上的代码获取xml:
$xml = simplexml_load_file("http://dev.virtualearth.net/REST/v1/Traffic/Incidents/37,-105,45,-94?o=xml&severity=3,4&key=#######myapikey######");