Dear Fred,
first of all I would like to thank you again for your hard work and the live framework provided.
While working with OSF for a while, we want to automate things by using the Web Services for importing entries, datasets, etc. using the web services provided.
Upon using both the POST Method and the PHP API, in a simple PHP script that I want to call, let's say once per day using cron jobs or through code in another application I couldn't do so with either methods.
For the POST HTTP Method, I am using the cURL library with PHP to create a script that's located in the main Drupal folder ( so I can call it with <my_ip>/script.php or localhost.php).
For simply adding an entry to an already existing dataset I used the information provided from here
http://wiki.opensemanticframework.org/index.php/CRUD:_Create with the following code:
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL,"
http://localhost/ws/crud/create/");
$vars= array();
$vars['document'] = $server_output;
$vars['mime'] = 'application/rdf+xml';
$vars['mode'] = 'full';
$vars['dataset'] = '
http://localhost/wsf/datasets/dynamic_dataset_test2/';
$headers = array();
$headers[] = 'Accept: */*';
curl_setopt($ch2, CURLOPT_POST,1);
curl_setopt($ch2, CURLOPT_POSTFIELDS,$vars);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_HTTPHEADER, $headers);
where the $server_output is a RDF/XML entry.
I suppose that I have to use the admin user (1)
http://localhost/user/1 but I can't find in the documentation the way to do so.
Also, as you can see in the following prntscn the Dataset info and the Dataset permissions (even to anonymous users).
What am I missing?
Kind Regards,
Apostolos