Figure 2: REST server returning Plain Old XML to REST client


<?php
/* ******************************
 * Control Main                 *
 *                              */
post_mandatory
(  array
   ( 'error', 'action', 'type',
     'title'
   )
);
post_mandatory_array
(  array
   ( 'selected_item', 'item'
   )
);
if ($_POST['type'])
{ if (! model_search
        ( $_POST ['type'],
          $_POST ['title'],
          $search_item
        ))
  { $_POST['error'] = model_error ();
    echo POX_error($_POST ['error');
  }
  else
  { echo POX_OUT($search_item);
  }
}
else
{ echo POX_error("no search data specified");
}
?>