Hello Domi
Let me explain you the problem we are facing:
1. We are importing structures along with some meta data and other attributes into the database using the REST web services.
2. Since the SD file does not have SMILE strings, we are generating SMILE strings on the fly, so that the imported/generated database table is structure searchable.
3. While we are importing the SD file, there are certain structures that will return the SMILE string, the record will get added into the database table and the process will move on. However, the web service often returns error. There is no definite pattern. At times, it will stop at second record and on re-running the code, it will execute the second record and return error at the ninth record.
4. The function that is misbehaving is stringMolExport.
5. CODE EXCERPT:
$client = new
Client($_SESSION['Settings']['DOMAIN_NAME'].'/webservices/rest-v0/');
$request =
$client->post('util/calculate/stringMolExport', null, json_encode(array(
"structure"
=> $structure,
"parameters"
=> 'smiles'
)));
6. DEBUG WINDOW EXCERPT:
C4H2Cl2N2
cdxl130010051317142D
8 8 0 0 0 0 0 0 0 0999 V2000
0.0000 0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7145 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7145 -0.4125 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 -0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7145 -0.4125 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-0.7145 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.4289 0.8250 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0
1.4289 0.8250 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0
1 2 2 0 0
2 3 1 0 0
3 4 2 0 0
4 5 1 0 0
5 6 2 0 0
1 6 1 0 0
6 7 1 0 0
2 8 1 0 0
M END
Processed
Fatal error: Uncaught exception 'Guzzle\Http\Exception\ServerErrorResponseException' with message 'Server error response [status code] 500 [reason phrase] Internal Server Error
http://deepak-pc:8180/webservices/rest-v0/util/calculate/stringMolExport' in D:\xampp\htdocs\package\class\vendor\guzzle\guzzle\src\Guzzle\Http\Exception\BadResponseException.php:44
Stack trace:
#0 D:\xampp\htdocs\package\class\vendor\guzzle\guzzle\src\Guzzle\Http\Message\Request.php(145): Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Message\Response))
#1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event))
#2 D:\xampp\htdocs\package\class\vendor\symfony\event-dispatcher\Symfony\Component\EventDispatcher\EventDispatcher.php(164): call_user_func(Array, Object(Guzzle\Common\Event))
#3 D:\xampp\htdocs\package\class\vendor\symfony\event-dispatcher\Symfony\Component\EventDispatcher\EventDispatcher.php(53): Symfony\Component\Eve in D:\xampp\htdocs\package\class\vendor\guzzle\guzzle\src\Guzzle\Http\Exception\BadResponseException.php on line 44
Domi, Please note that when we passed the same structure (mentioned in the DEBUG WINDOW), manually on the webservice page, the stringMolExport function generated the SMILE string without any errors. Please refer to the attachment.
We are urgently looking for a solution here, since this problem is extremely critical. We have already spent two days arriving to a conclusion that our piece is code is not the culprit here, but there may be something wrong with the webservice.
I again implore you to please provide us with a solution ASAP.
Thanks
Ashish Dugar