ORA-12154: TNS:could not resolve service name -- WebServices

J

jstmehr4u3

I just installed ODP.net 10.2.02 on my local machine (Windows XP Pro)
running IIS.

I have created a sample webservice in VS2003, connecting to localhost.
I am getting:
Oracle.DataAccess.Client.OracleException ORA-12154: TNS:could not
resolve the connect identifier specified at
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
at Oracle.DataAccess.Client.OracleConnection.Open()
at Oracle.DataAccess.Client.OracleConnection.Open()
at MikesWebservice.Service1.GetNumberOfLogons() in
c:\inetpub\wwwroot\webservices\MikesWebservice\Service1.asmx.vb:line 69



1- I am using tnsnames.ora file that is in the install path for
ODP.net: C:\oracle\product\10.2.0\client_1\network\ADMIN

2- My SQLNET.ora contents:
TRACE_LEVEL_CLIENT = OFF
#sqlnet.authentication_services = (NONE)
names.directory_path = (TNSNAMES, HOSTNAME)
#names.default_domain = world
name.default_zone = world
automatic_ipc = off

3- My TNSNames.ora file as needed for my connection:
NPD1.world=(DESCRIPTION=(ADDRESS_LIST =(ADDRESS =(COMMUNITY =
TCP.world)(PROTOCOL = TCP)(Host = neolynx.neopostinc.com)(PORT =
1521)))(CONNECT_DATA=(SID=NPD1)(SERVER=DEDICATED)))

4- My Code related to the Connection open:
Dim connectionString As String = "User Id=webmgr;Password=hayward1;Data
Source=npd1.world"
Dim oraCon As OracleConnection
Dim returnNumber As Double
oraCon = New OracleConnection
oraCon.ConnectionString = connectionString
oraCon.Open()

Dim oraCmd As OracleCommand
oraCmd = oraCon.CreateCommand()
oraCmd.CommandText = "select count(*) from
nweb_customer_logons;"
Dim oraReader As OracleDataReader
oraReader = oraCmd.ExecuteReader()
While (oraReader.Read)
returnNumber = oraReader.GetDouble(0)
End While
oraReader.Dispose()
oraCmd.Dispose()
oraCon.Dispose()

I can use TNSPing from the \bin\ directory under the OPD.net install. I
have verified there are no paranthesis in any of the folder paths, and
have verified that Authenticated Users, and the ASP_NET user have
access to those folders.

I have no clue where to go from here. Thanks for any insight.
 
J

jstmehr4u3

Sorry.. Was searching the net for the error message, and found this
group. My code is vb.net, not c#. Hope that doesn't make a difference
in you guys helping me. :)
 
N

Nicholas Paldino [.NET/C# MVP]

This is most likely an issue with running the webservice under the local
ASPNET account. You will probably want to look at impersonating a user with
the appropriate credentials to connect to the database.
 
M

Michael Nemtsev

Hello Nicholas Paldino [.NET/C# MVP],

or probably with NetworkSystem account that need to have appropriate access
to see oracle folder

N> This is most likely an issue with running the webservice under
N> the local ASPNET account. You will probably want to look at
N> impersonating a user with the appropriate credentials to connect to
N> the database.
N>
N> N>---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
J

jstmehr4u3

I have added permissions for the Network Service account, without luck.
It still doesn't work.

Any other ideas?
 
M

Michael Nemtsev

Hello (e-mail address removed),

grand full righst to the asp.net account or impersonate it as Nicholas suggested
I have added permissions for the Network Service account, without
luck. It still doesn't work.

Any other ideas?
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top