Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Login WebServices failed
#12
Saludos Jeo, kapsule y demás compañeros.

Si probé el script que me enviaste y este no es capas de conectarse al servicio.

Tengo dudas, este es una parte del código del archivo coreBOSConfig.php.

1. Se supone que cuando yo intento crear un incidente en cbmibew para que se guarde en corebos no lo hace, pregunto, en que tablas debe guardar el incidente?, noto que no apunta a ninguna tabla de corebos, supongo que hace referencia a los módulos, cuando hace este query => "select * from Contacts where lastname='$lastname';";

2. El servicio Web, no se esta conectando, con el usuario y generatedKey que le estoy enviando, lo que hace es que siempre genera un valor null y el código lo manda a la excepción como si fuera un error en la creación.

Señor Joe, pido por favor que me ayude para logar conectar el usuario y generatedKey al servicio, o me indique como hago para la conexión con el servicio.


Respuesta = {"success":false,"error":{"code":"AUTHENTICATION_REQUIRED","message":"Given user cannot be found"}}

Quedo atento y muchas gracias

//look if the person exists in Contacts module.
$query = "select * from Contacts where lastname='$lastname';";
$encodedParameters= urlencode($query);
$channel2 = curl_init();
curl_setopt($channel2, CURLOPT_URL, $endpointUrl."?operation=query&sessionName=".$sessionId."&query=".$encodedParameters);
curl_setopt($channel2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($channel2, CURLOPT_POST, false);
curl_setopt($channel2, CURLOPT_CONNECTTIMEOUT, 100);
curl_setopt($channel2, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($channel2, CURLOPT_TIMEOUT, 1000);
$response2 = curl_exec($channel2);
$jsonResponse2 = json_decode($response2,true);
$valore=$jsonResponse2['result'][0]['id'];

if($valore==NULL){ => siempre es NULL, NO LOGRA CONEXIÓN
//if the person does not exists, create the record
$contactvalues = array('assigned_user_id' => $userId,'lastname'=> $lastname, 'firstname'=> $firstname, 'phone'=> '--', 'email'=> $email2);
$encodedParameters=json_encode($contactvalues,true);
$params = array("sessionName"=>$sessionId, "operation"=>'create',"element"=>$encodedParameters, "elementType"=>"Contacts");
$channel3 = curl_init();
curl_setopt($channel3, CURLOPT_URL, $endpointUrl);
curl_setopt($channel3, CURLOPT_RETURNTRANSFER, true);
curl_setopt($channel3, CURLOPT_POST, true);
curl_setopt($channel3, CURLOPT_POSTFIELDS,$params );
curl_setopt($channel3, CURLOPT_CONNECTTIMEOUT, 100);
curl_setopt($channel3, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($channel3, CURLOPT_TIMEOUT, 1000);
$response3 = curl_exec($channel3);
$jsonResponse3 = json_decode($response3,true);

//this query gets the id of the created record so we can create Potentials or HelpDesk records related with Contacts
$query = "select * from Contacts where lastname='$lastname';";
$encodedParameters= urlencode($query);
$channel4 = curl_init();
curl_setopt($channel4, CURLOPT_URL, $endpointUrl."?operation=query&sessionName=".$sessionId."&query=".$encodedParameters);
curl_setopt($channel4, CURLOPT_RETURNTRANSFER, true);
curl_setopt($channel4, CURLOPT_POST, false);
curl_setopt($channel4, CURLOPT_CONNECTTIMEOUT, 100);
curl_setopt($channel4, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($channel4, CURLOPT_TIMEOUT, 1000);
$response4 = curl_exec($channel4);
$jsonResponse4 = json_decode($response4,true);
$valore1=$jsonResponse4['result'][0]['id'];

if($module1=='HelpDesk'){
//if we choose HelpDesk module, we create a new record
$contactvalues = array('assigned_user_id' => $userId,'ticket_title'=>$subject,'parent_id'=>$valore1,'ticketstatus'=>'Open','description'=>$conversation);
$encodedParameters=json_encode($contactvalues,true);
$params = array("sessionName"=>$sessionId, "operation"=>'create',"element"=>$encodedParameters, "elementType"=>'HelpDesk');
$channel5 = curl_init();
curl_setopt($channel5, CURLOPT_URL, $endpointUrl);
curl_setopt($channel5, CURLOPT_RETURNTRANSFER, true);
curl_setopt($channel5, CURLOPT_POST, true);
curl_setopt($channel5, CURLOPT_POSTFIELDS,$params );
curl_setopt($channel5, CURLOPT_CONNECTTIMEOUT, 100);
curl_setopt($channel5, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($channel5, CURLOPT_TIMEOUT, 1000);
$response5 = curl_exec($channel5);
$jsonResponse5 = json_decode($response5,true);
if ($jsonResponse5['success'] == true) {
$page['threadInfo'] = $thread->userName." was created successfully at Trouble Tickets (HelpDesk module)";
}
else{
$page['threadInfo'] = "Error!".$thread->userName." was not created";
}
}
Reply


Messages In This Thread
Login WebServices failed - jvillegas - 09-30-2016, 05:38 PM
RE: Login WebServices failed - joebordes - 09-30-2016, 06:12 PM
RE: Login WebServices failed - jvillegas - 09-30-2016, 06:33 PM
RE: Login WebServices failed - joebordes - 09-30-2016, 07:00 PM
RE: Login WebServices failed - jvillegas - 09-30-2016, 07:10 PM
RE: Login WebServices failed - omarllorens - 10-03-2016, 06:26 AM
RE: Login WebServices failed - jvillegas - 10-03-2016, 08:44 PM
RE: Login WebServices failed - omarllorens - 10-04-2016, 06:52 AM
RE: Login WebServices failed - kapsule - 10-04-2016, 07:54 PM
RE: Login WebServices failed - jvillegas - 10-05-2016, 01:41 PM
RE: Login WebServices failed - kapsule - 10-05-2016, 02:32 PM
RE: Login WebServices failed - jvillegas - 10-12-2016, 03:42 PM
RE: Login WebServices failed - joebordes - 10-12-2016, 04:48 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)