473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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.HandleErr orHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleErr or(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\Ser vice1.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.

Aug 15 '06 #1
5 17087
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. :)

Aug 15 '06 #2
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<js********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>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.HandleErr orHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleErr or(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\Ser vice1.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.

Aug 15 '06 #3
Hello Nicholas Paldino [.NET/C# MVP],

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

NThis is most likely an issue with running the webservice under
Nthe local ASPNET account. You will probably want to look at
Nimpersonating a user with the appropriate credentials to connect to
Nthe database.
N>
N<js********@gmail.comwrote in message
Nnews:11**********************@b28g2000cwb.googleg roups.com...
N>
>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.HandleEr rorHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleErr or(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\Se rvice1.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.
---
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
Aug 15 '06 #4
I have added permissions for the Network Service account, without luck.
It still doesn't work.

Any other ideas?

Aug 15 '06 #5
Hello js********@gmail.com,

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
Aug 15 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ashish Namdeo | last post by:
I get the following error: ORA-00904: invalid column name When I run the following insert command: INSERT INTO XXCUS_VGL_VST_MSTR...
0
by: wqhdebian | last post by:
It was said the ORA-02085 error result from the mismatch of database name and database link name ,and setting glabal_names=false can resolve . but I want to try the other solution,let global_names...
1
by: Doron | last post by:
I'm getting a ORA-00600 error on SYS.EXU8REF (see trace file below). SYS.EXU8REF is a view so the problem should be with one of the underlaying tables. i didnt run oerr12700 yet. can i find the...
0
by: J.Bijleveld | last post by:
Hello colleagues, At this moment we have a real big problem using a .NET application with an Oracle database (v8.1.6). I hope someone has encountered this problem before and is able to help me...
2
by: J.Bijleveld | last post by:
Hello colleagues, At this moment we have a real big problem using a .NET application with an Oracle database (v8.1.6). I hope someone has encountered this problem before and is able to help me...
1
by: jkstexas2001 | last post by:
Could someone be of assistance and show me the problem with the following code? I have researched Metalink regarding ORA-29531, and the most common cause of this error is the failure to declare the...
2
by: Dwie | last post by:
Dear All, I'm a new in Oracle DB. I'm using Windows 2000 as server and Windows XP as client. I installed Oracle Enterprise on server and Oracle 8.1 on clients. I have some client with 2 different...
4
by: raccoon | last post by:
keep getting an ora-04020: deadlock detected while trying to lock object XDB. XDNDBKDJjilnd The statement I'm trying to issue is: REVOKE execute on abc."descript_T" FROM PUBLIC; I am not...
0
by: s.kapitza | last post by:
Hi, try M$S servicebug 3 regards s.kapitza alghaden@alumni.fdu.edu (Ahmad) wrote in message news:<4a75f4b7.0308080649.49105373@posting.google.com>...
0
by: wolfee | last post by:
I'm running 10gR2 RAC in Prod, Test and DEV and after doing a clone to the DEV environment I'm getting a wierd ORA-12514 error for only one node. I can tnsping the node and it comes back fine. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.