2
Well, I’ve got Curl up and running. I’m trying to integrate with the site: https://www.affinityassistencia.com.br/ws/examples/? usuario=teste&password=teste&button=Log in getplano method.
i send the xml via Curl and returns that the parameters were not informed
Name: Getplanos (available)
Purpose: Return all available plans.
Request parameters: Login, password
Response parameters: Plan code, plan name
example: https://www.affinityassistencia.com.br/ws/exemplos/getPlanos.asp
$input_xml="<?xml version='1.0' encoding='UTF-8' ?>
<requisicao>
<login>xml28</login>
<senha>15028</senha>
</requisicao>";
$url = 'https://www.affinityassistencia.com.br/ws/getPlanosLista/';
//setting the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// Following line is compulsary to add as it is:
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-type: application/xml',
'Content-length: '. strlen($input_xml)) );
curl_setopt($ch, CURLOPT_POSTFIELDS,
$input_xml);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "xml28:15028");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
$data = curl_exec($ch);
curl_close($ch);
//convert the XML result into array
// $array_data = json_decode(json_encode(simplexml_load_string($data)), true);
print_r('<pre>');
print_r($data);
print_r('</pre>');
So does anyone have any suggestions? Att Gustavo