dmitri wrote: |
you have to return SOAP exception in this case and set its fields with error info. |
Hmm, thanks a lot for this. I've looked around, but don't really understand what you mean.
Basic problems are being handled like this:
// number of rows returned
$numRows2 = pg_num_rows($results2);
if (!$numRows2)
{
return new soap_fault('Server', '', 'No data found!');
} |
But I don't see why in any case SOAP is supposed to spit out the SQL query. Which it does if the SQL is wrong:
HTTP/1.1 200 OK
Date: Tue, 03 Nov 2009 09:31:04 GMT
Server: Apache/2.2.11 (Unix) PHP/5.2.8
X-Powered-By: PHP/5.2.8
Content-Length: 843
Connection: close
Content-Type: text/html
<br />
<b>Warning</b>: pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: syntax error at or near "ORDER"
LINE 10: (d.year_start = 2006 ) AND d.id_country = ORDER BY 1...
^
QUERY:
SELECT
COALESCE(c.name, '') AS name,
d.year_start AS year,
d.value AS value
FROM
cereals_production AS d
RIGHT JOIN
countries_view AS c ON c.id = d.id_country WHERE
(d.year_start = 2006 ) AND d.id_country = ORDER BY 1,2; in <b>/www/xxxx.php</b> on line <b>335</b>
<br />
<br />
<b>Catchable fatal error</b>: Object of class soap_fault could not be converted to string in <b>/www/etc/nusoap/lib/nusoap.php</b> on line <b>3615</b>
<br /> |
How can I suppress this kind of warning? Thanks a lot for any help/adivce!
Stef