Note that there are some explanatory texts on larger screens.

plurals
  1. POCurl not getting an xml response with https url?
    text
    copied!<p>I am working with Expedia's api and I am trying to do a test booking. I have to call a https url. I have been able to make connections to all other normal http request, but now I am stuck. Here is how I am calling the page. all the php values from my form are correct but I get nothing in the xml file..I mean nothing no errors, nothing! I am truly stuck and do not know what to do. Here is my php code:</p> <pre><code>$ch = curl_init(); $fp = fopen('bookit.xml','w'); curl_setopt($ch, CURLOPT_URL, "https://book.api.ean.com/ean-services/rs/hotel/v3/res?cid=55505&amp;minorRev=13&amp;apiKey=4sr8d8bsn75tpcuja6ypx5g3&amp;locale=en_US&amp;currencyCode=USD&amp;customerIpAddress=10.184.2.9&amp;customerUserAgent=Mozilla/5.0+(Windows+NT+6.1)+AppleWebKit/535.11+(KHTML,+like+Gecko)+Chrome/17.0.963.79+Safari/535.11&amp;customerSessionId=&amp;locale=en_US&amp;currencyCode=USD&amp;xml=&lt;HotelRoomReservationRequest&gt;&lt;hotelId&gt;".$hid."&lt;/hotelId&gt;&lt;arrivalDate&gt;".$arrive."&lt;/arrivalDate&gt;&lt;departureDate&gt;".$depart."&lt;/departureDate&gt;&lt;supplierType&gt;".$supplier."&lt;/supplierType&gt;&lt;rateKey&gt;".$rkey."&lt;/rateKey&gt;&lt;rateCode&gt;".$ratecode."&lt;/rateCode&gt;&lt;roomTypeCode&gt;".$roomcode."&lt;/roomTypeCode&gt;&lt;chargeableRate&gt;".$total."&lt;/chargeableRate&gt;&lt;RoomGroup&gt;&lt;Room&gt;&lt;numberOfAdults&gt;".$adults."&lt;/numberOfAdults&gt;&lt;numberOfChildren&gt;".$children."&lt;/numberOfChildren&gt;&lt;childAges&gt;".$childages."&lt;/childAges&gt;&lt;firstName&gt;".$fname."&lt;/firstName&gt;&lt;lastName&gt;".$lname."&lt;/lastName&gt;&lt;smokingPreference&gt;".$smoking."&lt;/smokingPreference&gt;&lt;/Room&gt;&lt;/RoomGroup&gt;&lt;ReservationInfo&gt;&lt;email&gt;".$email."&lt;/email&gt;&lt;firstName&gt;".$ccname."&lt;/firstName&gt;&lt;lastName&gt;".$cclast."&lt;/lastName&gt;&lt;homePhone&gt;".$phone."&lt;/homePhone&gt;&lt;workPhone&gt;&lt;/workPhone&gt;&lt;creditCardType&gt;".$cc."&lt;/creditCardType&gt;&lt;creditCardNumber&gt;".$ccnumber."&lt;/creditCardNumber&gt;&lt;creditCardExpirationMonth&gt;".$exmonth."&lt;/creditCardExpirationMonth&gt;&lt;creditCardExpirationYear&gt;".$exyear."&lt;/creditCardExpirationYear&gt;&lt;creditCardIdentifier&gt;".$ccsecure."&lt;/creditCardIdentifier&gt;&lt;/ReservationInfo&gt;&lt;AddressInfo&gt;&lt;address1&gt;".$street1."&lt;/address1&gt;&lt;city&gt;".$city."&lt;/city&gt;&lt;stateProvinceCode&gt;AZ&lt;/stateProvinceCode&gt;&lt;countryCode&gt;".$country."&lt;/countryCode&gt;&lt;postalCode&gt;".$zip."&lt;/postalCode&gt;&lt;/AddressInfo&gt;&lt;/HotelRoomReservationRequest&gt;"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/xml')); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); $val = curl_exec($ch); curl_close($ch);//Close curl session fclose($fp); //Close file overwrite var_dump($val); $data = simplexml_load_file('bookit.xml'); </code></pre> <p>And I like I said I get nothing at all. I have checked all the code and I do not see a problem and the url is correct.. any help would be so greatly appreciated. Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload