cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Queries with Service Layer returns error code 402

former_member816643
Discoverer
1,177

I add the table to allowlist in b1s_sqltable.conf file and the table is newly created

I try this:

https://service_layer_IP:50000/b1s/v1/SQLQueries

with this body:

{
 "SqlCode": "getSyncItems",
 "SqlName": "GetItems",
 "SqlText": "select ItemCode, ItemName  from SYNC"
}

And receive this response:

"error": { "code": 402, "message": { "lang": "en-us", "value": "Bad configuration in file 'b1s_sqltable.conf'" } }<br>

Accepted Solutions (0)

Answers (1)

Answers (1)

ivo_hari
Explorer
0 Kudos

We had the same problem after updating from fp2110 to sp2402. We did this (from troubleshooting note 3064927 - this part is same both on linux and windows, different folders):

    • The issue could be related to corrupted SQLQueries config file. Goto ServiceLayer Installation folder (%ProgramFiles%\SAP\SAP Business One ServerTools\ServiceLayer\Conf\).
    • Rename the file b1s_sqltable.conf to b1s_sqltable_backup.conf
    • Open b1s_sqltable.template.conf and save as b1s_sqltable.conf.
    • Restart the Service Layer Service.

After that b1s/v1/SQLQueries worked well, but we had to manually edit the b1s_sqltable.conf file and add some tables that we needed for our queries.