I’m using SmartConnect 2018 and using the WCF Web Services to call the different endpoints. When I call any of the SmartConnect Web Service endpoints, they all fail with the same error:
<Message>Failed to create SmartConnect session factory : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)</Message>
I’ve verified that my SmartConnect UI can log in fine, and I can run any map successfully from within SmartConnect itself or the scheduler service – they just all fail from the SmartConnect web services.
This issue happens in SmartConnect 2018 because the configuration for each web service is stored in the web.config for each web service and not in the configuration file for the SmartConnect application itself.
Therefore, it is possible for the SmartConnect UI/Windows Service to be able to log into the SmartConnect database properly and for the web services to fail due to an incorrect server or expired/invalid credentials defined in the web.config.
The solution to this is to run the SmartConnect 2018 configuration tool and update the web.config for the WCF or Legacy web service (whichever is failing) by following this blog article.
Per the article, make sure to select the individual web.config files so that saving the main configuration settings also updates the proper web.config and the web services will function as expected.