title: Calling ASP.NET Web Api method with PHP
body: <p>I have  the following web method in my web api controller</p>
  
  <pre><code>    public HttpResponseMessage PostMakeBooking(FacilityBookingRequest bookingRequest)
      {
  
          var returnStatus = HttpStatusCode.OK;
          var json = new JavaScriptSerializer().Serialize(bookingRequest);
  
          var response = Request.CreateResponse&lt;CardholderResponse&gt;(returnStatus, cardholderResponse);
  
  
          return response;
  
      }
  </code></pre>
  
  <p>When I make this call from my .NET app, my json string appears correctly when I seralize it</p>
  
  <pre><code>{"correlationId":null,"RequestId":"7ec5092a-342a-4e32-9311-10e7df3e3683","BookingId":"BK-123102","CardholderId":"123456","BookingFrom":"\/Date(1370512706448)\/","BookingUntil":"\/Date(1370523506449)\/","DeviceId":"ACU-01-R2","Action":"Add","LoginId":"tester","Password":"tester"}
  </code></pre>
  
  <p>However, when I made to call from my php script</p>
  
  <pre><code>public function web_request(){
  
      $guid   =self::getGUID();
      $replace = array("{","}");
      $guid  = str_replace($replace, "", $guid);
  
      $client = new Zend_Rest_Client("http://203.92.72.221");
      $request= new myZendCommon_FacilityBookingRequest();
      $request-&gt;RequestId         =$guid;
      $request-&gt;BookingFrom       ="27/03/2013 05:30";
      $request-&gt;BookingUntil      ="27/03/2013 06:30";
      $request-&gt;CardholderId      ="E0185963";
      $request-&gt;DeviceId          ="ACU-B2-01-R1";
      $request-&gt;BookingId         ="111";
      $request-&gt;Action            ="Add";
      $request-&gt;LoginId           ="tester";
      $request-&gt;correlationId     ="(null)";
      $request-&gt;Password          ="tester";
  
  
      $request = json_encode($request);
  
      $response = $client-&gt;restPost("/ibsswebapi/api/facilitybooking",$request);
  
  
      print_r($response);
      exit();
  </code></pre>
  
  <p>The call goes to my web method, but when I serialize it using <code>JavaScriptSerializer().Serialize(bookingRequest)</code></p>
  
  <pre><code>{"correlationId":null,"RequestId":null,"BookingId":null,"CardholderId":null,"BookingFrom":"\/Date(-62135596800000)\/","BookingUntil":"\/Date(-62135596800000)\/","DeviceId":null,"Action":null,"LoginId":null,"Password":null}
  </code></pre>
  
  <p>All the values are null. </p>
  
  <p>Is something wrong with the script?</p>