REST setup - configure that web server!

ERP10.1.500.18 - trying to get REST configured and I’m pretty sure the problem is in IIS. I tried support, but hit a wall since I’m on 10.1.500.

When I hit https://base_url/api/v1, I get this error:
The page cannot be displayed because an internal server error has occurred.

Incidentally, through the journey to get here, I saw errors about Integrated Pipelines and such. One of those recommended adding
< validation validateIntegratedModeConfiguration=“false”/>
to the < system.webserver> section. When I do that, I get a login prompt and then get this:

{“HttpStatus”:500,“ReasonPhrase”:“REST Api Exception”,“ErrorMessage”:“The type initializer for ‘Ice.TableCache.UserFileCache’ threw an exception.”,“ErrorType”:“System.TypeInitializationException”}

I really don’t know what I’m doing wrong. Any ideas?

Look into event viewer for more errors. Probably it is database not reachable from iis

Good gravy - that’s it. Where can I specify which acct it should use?

In Admin Console, the app server configuration:

Opens the config page with the database tab - including a test button.

I assume that is the question?

No sir - the event log gave me an error that [computer_name]\IUSR_% account couldn’t log into the database. So it seems the webserver’s acct is trying to make a database connection when I hit the /api/v1 URL, but there’s nothing set up for it. This is not the account that I have specified under Application Server / Database Connection in the Application Server Configuration - it’s set to Windows Authentication.

Go into IIS, Application pools select the application pool you are using for your web api. Check the user, if not a domain user with permissions then right click, advanced options, Identity Provider, select custom and enter credentials. We use a service account with permissions in the DB and epicor

The REST API Wrappers just call into the regular rich client server / WCF settings - there is nothing special in IIS unless you are using Windows Auth for all db access (check your web.config for how it is setup).
If your regular client works, nothing should be different for REST.

1 Like