Troubleshooting Communication Between LS Nav/Central and Commerce
If an error returns when you ping the web service, the first thing to do is look at the error log file. The error logfile.txt is always located in the C:\LS Retail\Commerce\CommerceService\logs folder. By default, it logs all the errors and the XML going between IIS and LS Central.
Tip: Look at the end of the file for the last error.
The most common error after installation is the “Unauthorized” error:
2014-05-01 11:38:43.7945 |tid:11| Error | [MACBOOKJIJ-IIS APPPOOL\DefaultAppPool] | LSRetail.Mobile.WebService.BLL.ContactBLL.Login | Failed to login tom | LSRetail.Mobile.WebService.HOSP.Common.Util.HospServiceException: Error:GeneralErrorCode:The request failed with HTTP status 401: Unauthorized. ---> System.Net.WebException: The request failed with HTTP status 401: Unauthorized.
The “Unauthorized” error always means that the LS Central Windows account (domain/user/pwd) specified in the AppSettings.config file does not have permission to execute the LS Central Web Service. Make sure the domain, user name, and password are valid in the AppSettings.config file.
Problem | Action |
---|---|
Unauthorized - Ping works from mobile browser but not from mobile app | By default, the setup program enables anonymous authentication, other authentications are disabled. If you can ping CommerceService from a mobile browser on the mobile device, but get the message Unauthorized in the Mobile Application, then check the IIS Authentication. Make sure that the Basic Authentication is not set. |
Get the correct LS Central URL | The LS Central URL that goes into AppSettings.config is often incorrect. You can get this URL from Web Service Setup in LS Central. Copy and paste the URL into a browser and validate that it works. It should show XML data. A valid URL looks like this: http://localhost:7047/DynamicsNAV110/WS/CRONUS LS 1100 W1 Demo/Codeunit/RetailWebServices http://NavWebServiceName:PORTNO Also try the same URL with OmniWrapper ending, so replace ...Codeunit/RetailWebServices with ....Codeunit/OmniWrapper. |
Unauthorized error | Check URL and Username and Password are correct in AppSettings.config for BOConnection.Nav values. For SaaS environment use Web Key as Password and check that Protocol is set to Tls12. |
I can ping locally but not from my phone or other computers | This is most likely a firewall issue. Make sure port 80 is open on your IIS machine. |
Service "Codeunit/OmniWrapper" was not found! | Make sure that LS Central version is 14 or higher and OmniWrapper Codeunit has been published under Web Requests 2.0 Task page in LS Central. |