Index: wp-includes/class-wp-xmlrpc-server.php
===================================================================
--- wp-includes/class-wp-xmlrpc-server.php	(revision 19998)
+++ wp-includes/class-wp-xmlrpc-server.php	(working copy)
@@ -467,6 +467,21 @@
 	}
 
 	/**
+	 * Convert a WordPress date string to an IXR_Date object.
+	 *
+	 * @access protected
+	 *
+	 * @param $date
+	 * @return IXR_Date
+	 */
+	protected function _convert_date( $date ) {
+		if ( $date === '0000-00-00 00:00:00' ) {
+			return new IXR_Date( '00000000T00:00:00Z' );
+		}
+		return new IXR_Date( mysql2date( 'Ymd\TH:i:s', $date, false ) );
+	}
+
+	/**
 	 * Prepares post data for return in an XML-RPC object.
 	 *
 	 * @access private
@@ -477,15 +492,15 @@
 	 */
 	function _prepare_post( $post, $fields ) {
 		// holds the data for this post. built up based on $fields
-		$_post = array( 'post_id' => $post['ID'] );
+		$_post = array( 'post_id' => strval( $post['ID'] ) );
 
 		// prepare common post fields
 		$post_fields = array(
 			'post_title'        => $post['post_title'],
-			'post_date'         => new IXR_Date( mysql2date( 'Ymd\TH:i:s', $post['post_date'], false ) ),
-			'post_date_gmt'     => new IXR_Date( mysql2date( 'Ymd\TH:i:s', $post['post_date_gmt'], false ) ),
-			'post_modified'     => new IXR_Date( mysql2date( 'Ymd\TH:i:s', $post['post_modified'], false ) ),
-			'post_modified_gmt' => new IXR_Date( mysql2date( 'Ymd\TH:i:s', $post['post_modified_gmt'], false ) ),
+			'post_date'         => $this->_convert_date( $post['post_date'] ),
+			'post_date_gmt'     => $this->_convert_date( $post['post_date_gmt'] ),
+			'post_modified'     => $this->_convert_date( $post['post_modified'] ),
+			'post_modified_gmt' => $this->_convert_date( $post['post_modified_gmt'] ),
 			'post_status'       => $post['post_status'],
 			'post_type'         => $post['post_type'],
 			'post_name'         => $post['post_name'],
@@ -497,6 +512,7 @@
 			'comment_status'    => $post['comment_status'],
 			'ping_status'       => $post['ping_status'],
 			'sticky'            => ( $post['post_type'] === 'post' && is_sticky( $post['ID'] ) ),
+			'featured_image'    => get_post_meta( $post['ID'], '_thumbnail_id', true ),
 		);
 
 		// Consider future posts as published
@@ -591,6 +607,7 @@
 	 *      - comment_status - can be 'open' | 'closed'
 	 *      - ping_status - can be 'open' | 'closed'
 	 *      - sticky
+	 *      - featured_image - ID of a media item to use as the featured image
 	 *      - custom_fields - array, with each element containing 'key' and 'value'
 	 *      - terms - array, with taxonomy names as keys and arrays of term IDs as values
 	 *      - terms_names - array, with taxonomy names as keys and arrays of term names as values
@@ -724,6 +741,20 @@
 			stick_post( $post_ID );
 		}
 
+		if ( isset ( $post_data['featured_image'] ) ) {
+			// empty value deletes, non-empty value adds/updates
+			if ( empty( $post_data['featured_image'] ) ) {
+				delete_post_meta( $post_ID, '_thumbnail_id' );
+			}
+			else {
+				$image = get_post( intval( $post_data['featured_image'] ), ARRAY_A );
+				if ( empty($image['ID'] ) )
+					return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
+				update_post_meta( $post_ID, '_thumbnail_id', $image['ID'] );
+			}
+			unset( $content_struct['featured_image'] );
+		}
+
 		if ( isset ( $post_data['custom_fields'] ) && post_type_supports( $post_data['post_type'], 'custom-fields' ) ) {
 			$this->set_custom_fields( $post_ID, $post_data['custom_fields'] );
 		}
@@ -880,14 +911,14 @@
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
 
 		// convert the date field back to IXR form
-		$post['post_date'] = new IXR_Date( mysql2date( 'Ymd\TH:i:s', $post['post_date'], false ) );
+		$post['post_date'] = $this->_convert_date( $post['post_date'] );
 
 		// ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct,
 		// since _insert_post will ignore the non-GMT date if the GMT date is set
 		if ( $post['post_date_gmt'] == '0000-00-00 00:00:00' || isset( $content_struct['post_date'] ) )
 			unset( $post['post_date_gmt'] );
 		else
-			$post['post_date_gmt'] = new IXR_Date( mysql2date( 'Ymd\TH:i:s', $post['post_date_gmt'], false ) );
+			$post['post_date_gmt'] = $this->_convert_date( $post['post_date_gmt'] );
 
 		$this->escape( $post );
 		$merged_content_struct = array_merge( $post, $content_struct );
@@ -1080,8 +1111,6 @@
 				$query['order'] = $filter['order'];
 		}
 
-		do_action( 'xmlrpc_call', 'wp.getPosts' );
-
 		$posts_list = wp_get_recent_posts( $query );
 
 		if ( ! $posts_list )
