Asynchronous
Asynchronous

Reputation: 3977

Connecting to Oracle DB from IIS. Error: The underlying provider failed on Open

I get the following error when attempting to consume a WCF Service hosted in IIS 8.5. The underlying provider failed on Open. I am using an Oracle DB 11G.

From my development environment, I am able to connect to Oracle DB with no issues. If I simply Run the WCF Service within Visual Studio and run the Client Application. I am also able to Connect to the Oracle Instance from within Visual Studio and consume the service.

I am not sure where to look. Finally, I turned off Firewall on the Development Server just to see if there was any issues. I am also able to Ping the Oracle Server with success.

Here is the Connection String from IIS:

metadata=res://*/OracleDB.csdl|res://*/OracleDB.ssdl|res://*/OracleDB.msl;provider=Oracle.ManagedDataAccess.Client;
provider connection string="DATA SOURCE=INSTANCE_TNSNAMES;PASSWORD=MyPassword;
PERSIST SECURITY INFO=True;USER ID=MyUserID"

This is the connection string added to the application via Nuget when Oracle Managed Drivers are installed in Visual Studio and it is the same string in the application.

Update: Here is a list of things I tried:

Things I have tried:

  1. Installed Oracle Instant Client on the Windows Server running IIS
  2. Create TNS_ADMIN variable in Environment Variable
  3. Set Path to Oracle Instant Client
  4. Add (install) ODBC drivers to the instant client folder
  5. Create and configured tnsnames.ora

Still getting the same error:

Upvotes: 1

Views: 5391

Answers (1)

Simon Price
Simon Price

Reputation: 3261

The server running IIS, will need to have Oracle Client installed and the TNSNames file and each other file that you have in your test system will need to match that of the webserver you are using.

you should where possible use the same oracle client version as in each system.

Upvotes: 1

Related Questions