Is there an existing module that sends data from any form from my Drupal site to a web service?
UPDATING my PROGRESS:
Ok, I decided to continue my project using cURL. I created my form that contains 2 fields: "Name" and "Phone" and a submit button. (All in my own module)
Then I show my code that I just did. However, when I see the web service. The shipping data, not shown. I did a debug and uh I realized that when running: "curl_exec ($ch)" returns me FALSE.
function mymodule_form_submit($form, &$form_state){
$name = $form_state['values']['name'];
$phone = $form_state['values']['phone'];
$att = array(
'name' => $name,
'phone' => $phone
);
$attendee = http_build_query($att, '', '&');
$url = 'http://[IP]/event/management/attendee';
$headers = array('Content-Type: application/x-www-form-urlencoded');
$userpasswd = 'user:pass';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, $userpasswd);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attendee);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
curl_setopt($ch, CURLOPT_FAILONERROR, FALSE);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$result = curl_exec($ch);
curl_close($ch);
}
The params,in the web service, are: attendee['name'], attendee['phone']. What is my error?
UPDATE 2: NOW with this code, the variable $result return me a bool(TRUE). That tell me that the data was pass to the webservice. But, when I see the web service, I see no records with the data that I supposedly sent.