====== Troubleshooting with Postman ====== If you're getting an error message from the SAP Business One Service Layer API despite everything being configured correctly, you can make use of the free-of-cost tool Postman to make sure that the issue is not caused by COBI.wms: https://www.postman.com/downloads/ Once you've installed and started the program for the first time, you can **skip the account creation process** by clicking the small button at the bottom of the login screen of Postman. ===== Importing the Service Layer Collection ===== Afterwards you can import this Service Layer **Collection** file into Postman: {{COBI.wms:servicelayer.postman_collection.json}} To open the Import screen of Postman, go to File -> Import or press Ctrl + O. ===== Creating an Environment for Service Layer ===== For the Service Layer Collection to work, you have to create an **Environment** in Postman. You can open the Environments tab from the left side of the Postman window to create a new one. You can name the environment however you like, for example "Service Layer." You must then add the following variables: ^ Name ^ Value ^ | SLROOT | The Service Layer base-URL, such as: **http://sbo-server:50001/b1s/v1** | | COMPANY | The name of the SAP Business One company database to which you want to connect | | USERNAME | The username of a valid SAP Business One user | | PASSWORD | The password of the SAP Business One user | **Note:** If any value contains a back-slash " **\** " symbol in it, you have to duplicate each back-slash to be two back-slashes. For example if the username is **"MyDomain\testuser"** then you must write **"MyDomain\\testuser"** instead. (This does not apply to forward-slash " **/** " symbols, only back-slashes. And it is **not** needed in the COBI.wms Android App, only in Postman.) After saving the environment, you have to **activate it by selecting it from the drop-down towards the top-right corner** of the Postman window, where it normally says **No Environment**. ===== Logging in to Service Layer ===== You can now open the Service Layer Collection by opening the **Collections** tab from the left side of the Postman window, and choosing **Service Layer**. If you've done everything correctly, you should be able to select the **Login** request in the Service Layer collection and click on the blue **Send** button to test the login process. A successful login to Service Layer will yield an output such as the following: { "@odata.context": "http://192.168.178.254:50001/b1s/v2/$metadata#B1Sessions/$entity", "SessionId": "878d6bfc-e06e-11eb-8000-000c29fb30d8", "Version": "1000150", "SessionTimeout": 60 } ===== Testing attachment upload ===== Sometimes uploading attachments with Service Layer doesn't work even though attachments work fine in the SAP Business One client. If you get an error while sending attachments from COBI.wms, it's a good idea to check whether the problem is with Service Layer itself. To test attachment uploads, just select the **Attachment Upload** query from the Service Layer Collection and send it without making any changes. A successful attachment upload will result in a response such as the following: { "@odata.context": "http://192.168.178.254:50001/b1s/v2/$metadata#Attachments2/$entity", "AbsoluteEntry": 7, "Attachments2_Lines": [ { "SourcePath": "C:\\Windows\\TEMP\\ServiceLayer\\Attachments2/", "FileName": "my_photo", "FileExtension": "png", "AttachmentDate": "2021-07-09", "Override": "tNO", "FreeText": null, "CopyToTargetDoc": "tNO" } ] } If you receive an error instead, it means attachment uploading doesn't work with Service Layer, so the problem isn't related to COBI.wms. At this point please consult your SAP Partner or open an SAP ticket.