<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi,</p>
<p>I have an external php script who programmatically check a vtiger
6.4. In order to do so, I've used the vtwsclib library. Now I need
to get the records that have been deleted in the crm (records
which have deleted = 1 in vtiger_crmentity table). Unfortunately,
the vtwsclib doQuery() function works only with modules and not
directly with tables. So I tried to use the vtwsclib doInvoke()
with a custom webservice: <br>
</p>
<p>- I added my webservice in the operation table: <br>
</p>
<pre class="lang-php prettyprint prettyprinted" style=""><code><span class="pln">INSERT INTO </span><span class="str">`vtiger_ws_operation`</span><span class="pln"> </span><span class="pun">(</span><span class="pln"> </span><span class="str">`name`</span><span class="pun">,</span><span class="pln"> </span><span class="str">`handler_path`</span><span class="pun">,</span><span class="pln"> </span><span class="str">`handler_method`</span><span class="pun">,</span><span class="pln"> </span><span class="str">`type`</span><span class="pun">,</span><span class="pln"> </span><span class="str">`prelogin`</span><span class="pun">)</span><span class="pln"> VALUES </span><span class="pun">(</span><span class="str">'my_webservice_method'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'include/Webservices/WbsWebserviceMethod.php'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'vtws_my_webservice_method’, '</span><span class="pln">GET</span><span class="str">', 0);</span></code></pre>
<p>- I added the only parameter I need in the parameters table: <br>
</p>
<pre class="lang-php prettyprint prettyprinted" style=""><code><span class="pln">INSERT INTO </span><span class="str">`vtiger_ws_operation_parameters`</span><span class="pln"> </span><span class="pun">(</span><span class="str">`operationid`</span><span class="pun">,</span><span class="pln"> </span><span class="str">`name`</span><span class="pun">,</span><span class="pln"> </span><span class="str">`type`</span><span class="pun">,</span><span class="pln"> </span><span class="str">`sequence`</span><span class="pun">)</span><span class="pln"> VALUES </span><span class="pun">(</span><span class="lit">35</span><span class="pun">,</span><span class="pln"> </span><span class="str">'key'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'String'</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span></code></pre>
<p>- I created the 'include/Webservices/WbsWebserviceMethod.php':</p>
<pre class="lang-php prettyprint prettyprinted" style=""><code><span class="pun"><?</span><span class="pln">php
</span><span class="kwd">function</span><span class="pln"> vtws_my_webservice_method</span><span class="pun">(</span><span class="pln">$key</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"></span><span class="pln">
</span><span class="kwd">return</span><span class="pln"> </span><span class="str">true</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">?></span></code></pre>
<p>- I call the custom webservice from my external php: <br>
</p>
<pre class="lang-php prettyprint prettyprinted" style=""><code><span class="pun"><?</span><span class="pln">php
</span><span class="kwd">function</span><span class="pln"> vtws_my_webservice_method</span><span class="pun">(</span><span class="pln">$key</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{
// some other code and login. Login is successful.
</span><span class="pln">Â $results = $client->doInvoke('</span></code><code><span class="pln"><code><span class="str">vtws_my_webservice_method</span></code>', ['key' => $key], 'GET');
var_dump($results);</span><span class="pun"></span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">?></span></code></pre>
<p>but it doesn't work, the doInvoke() returns false. Did I miss
something?</p>
<p>Thanks</p>
<p><br>
</p>
<p><code></code><br>
</p>
</body>
</html>