How to troubleshoot “(400) Bad Request” errors in Shop Floor Insight

Home/Shop Floor Insight/Having Issues?/How to troubleshoot “(400) Bad Request” errors in Shop Floor Insight

How to troubleshoot “(400) Bad Request” errors in Shop Floor Insight

You are here:

This article describes how to troubleshoot error messages in the Shop Floor Insight application that stem from misconfigurations of the Shop Floor Insight service config file. In some cases, the error messages will state “(400) Bad Request” and in other situations the error message will not reference this.

The config file works in pair with the Shop Floor Insight service to ensure proper communication with Business Central. This file has three areas where specific URLs are required and if there is any sort of error in any of the URLs, the users will have errors in the Shop Floor Insight application.

Examples of error messages

The following error messages were displayed on the Shop Floor Insight application. All these errors are result of incorrect, incomplete or erroneous URLs found in the config file.

Failed to load UI language Failed to load UI language

The remote server returned an unexpected response: (400) Bad Request. – The remote server returned an error: (400) Bad Request.

Operation Failed Operation failed – read. Store – Custom Field Definitions

Exception has been thrown by the target of an invocation. – The value of the property ‘address’ cannot be parsed. The error is: Invalid URI: The hostname could not be parsed.

Custom Field Definitions Operation failed – read. Store – Custom Field Definitions

Exception has been thrown by the target of an invocation. – The given URI must be absolute. Paramter name: uri

Failed to load UI language Failed to load UI language

The provided URI scheme ‘http’ is invalid; expected ‘https’. Parameter name: via

Operation Failed Operation failed – read. Store – Setup

Page TCMSetup Failed to get filters from https://api.businesscentral.dynamics.com/…

The remote server returned an error: (400) Bad Request.

State Provider Request Failed State provider request failed

Service “CRONUS Canada Inc./Codeunit/TCMClientState” was not found!

These error messages are just some examples of the types of error messages that users might get if the config file is incorrectly configured. Other error messages are also possible. The error messages might also look differently depending on the browser, operating system, version of Shop Floor Insight, version of Business Central, etc.

How to identify the SOAP URI

The SOAP URI will be used to configure the three URLs in the Shop Floor Insight config file. Before modifying the config file, the user must first identify the correct SOAP URI. Reminder that the URI is company specific.

  • Navigate to “Web Services” in Business Central.
  • Find an entry that has something in the “SOAP URI” column on the right-hand side.
  • Click on a link – do not copy the link as it is not the same thing.
Web Services
  • This will open a browser.
Browser

For On-premise installations, the SOAP URI will typically look like this:

https://your_server_name:1234 / OptionalTenant / WS / CompanyName

The value “1234” above indicates the port, “OptionalTenant” is the optional tenant, and “CompanyName” is the URI encoded company name.

For SaaS installations, the SOAP URI is typically:

https://api.businesscentral.dynamics.com / version / tenant / WS / CompanyName

Upon clicking the SOAP URI, the user will be prompted to log in. There is no need to do so for this exercise. SaaS installations use HTTPS and the URL will always start with “api.businesscentral.dynamics.com”

  • Copy the required portion of URL in the browser address. The copied URL should include the beginning as displayed in the browser and should end with the company name. Do not copy the slash. Take note if the URL is HTTP or HTTPS.

With this copied URL, the config file can now be modified. In the image above, the URL that is required is:  http://Server_Name:1234/BC150/WS/CRONUS%20Canada%2C%20Inc.

Location of the three URLs in the config file

The first two URLs are found one underneath the other and are both located near the top of the config file.

The first URL can be found by searching for “TCMClientState”. The URL must be placed in the “endpoint address” section as depicted in the image below. The second URL is located just below the first one. See the image below that shows the first two URLs.

Time Collection Module

The highlighted text in red is the URL identified in the previous step and the highlighted text in yellow indicates the required values for each URL.

The third URL is located near the end of the config file. It can be found by searching for “DynamicsNavUri”. The URL must be placed in the “value” section as indicated in this image below.

DynamicsNavUri

Required syntax of the three URLs

The first two URLs that are required for the config file are composed of two things. The copied URL and a specific “codeunit” value. The third URL does not have any specific “codeunit” value.

First URL:             “copied URL” + “/Codeunit/TCMClientState”

Second URL:       “copied URL” + “/Codeunit/TCMCustomFieldMgmt”

Third URL:           “copied URL”

Using the example above, the three URLs would be:

http://Server_name:1234/BC150/WS/CRONUS%20Canada%2C%20Inc./Codeunit/TCMClientState

http://Server_name:1234/BC150/WS/CRONUS%20Canada%2C%20Inc./Codeunit/TCMCustomFieldMgmt

http://Server_name:1234/BC150/WS/CRONUS%20Canada%2C%20Inc.

    • Place the three URLs in the config file in the correct location
    • Save and close the config file
    • Restart the Shop Floor Insight Service
    • Refresh the Shop Floor Insight application page on the scanning stations and try again.
Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Need help?

Leave A Comment

Go to Top