Hi Everyone,

I am writing a web service program to fetch the record of a person based upon his ID.

When i try to fetch the record of a person using a user defined method getInfoFromID() in the web service program,I am getting some exception.I am using oracle (SQL plus) as the database.

When i execute the web service program, everything works fine. i.e. i get the http://localhost/InfoService/Records.asmx and when i click on the "getInfromFromID" link, i get http://localhost/InfoService/Records...=getInfoFromID page. When i enter a valid ID value and say invoke i get http://localhost/InfoService/Records.asmx/getInfoFromID with the following exception:

System.ApplicationException: Failed to connect to data source ---> System.DllNotFoundException: Unable to load DLL (oci.dll).
at System.Data.OracleClient.DBObjectPool.GetObject(Ob ject owningObject, Boolean& isInTransaction)
at System.Data.OracleClient.OracleConnectionPoolManag er.GetPooledConnection(String encryptedConnectionString, OracleConnectionString options, OracleConnection owningObject, Boolean& isInTransaction)
at System.Data.OracleClient.OracleConnection.OpenInte rnal(OracleConnectionString parsedConnectionString, Object transact)
at System.Data.OracleClient.OracleConnection.Open()
at PersonInfo.PersonDatabase.getInfoFromID(Int32 id) in c:\doc\info\personinfo\persondatabase.cs:line 30
--- End of inner exception stack trace ---
at PersonInfo.PersonDatabase.getInfoFromID(Int32 id) in c:\doc\info\personinfo\persondatabase.cs:line 64
at InfoService.Records.getInfoFromID(Int32 id) in C:\DOC\Info\InfoService\Records.asmx.cs:line 88

Following is my code:

Records.asmx.cs
----------------------------------------------------------------------------------------------------------------------------
using System.Data;

using System.Diagnostics;

using System.Web;

using System.Web.Services;

using PersonInfo;

namespace InfoService

[WebService(Description="<b>This service lets universities Update and lookup student status with the fictitious security department infoBase</b>",Namespace="http://www.cs.uh.edu/cosc4319")]

public class Records : System.Web.Services.WebService

{

public Records()

{

InitializeComponent();

}

..................

[WebMethod(Description="<i>Returns the Person with the given unique (int) ID</i>")]

public Person getInfoFromID(int id)

{

Person thePerson = new Person();

PersonDatabase personDB = new PersonDatabase();

personDB.getInfoFromID(id); //---------------------------Line 88

return thePerson;

}

}

}

---------------------------------------------------------------------------------------------------------------------

PersonDatabase.cs is in PersonInfo class library

----------------------------------------------------------------------------------------------------------------------

using System;

using System.Data.OracleClient;

namespace PersonInfo

public class PersonDatabase

{

public PersonDatabase()

{

}

public Person getInfoFromID(int id)

{

OracleConnection nwindConn = null;

OracleDataReader oReader = null;

nwindConn = new OracleConnection("Data Source=Oracle;UID=system;PWD=cougar;Integrated Security=yes;");


Person thePerson = new Person();

try

{

nwindConn.Open(); //---------------------------Line 30


OracleCommand cmd = nwindConn.CreateCommand();

cmd.CommandText = "select LastName,EntryDate,WithdrawalDate,FirstName,ID,Sta tus,VisaDate,RegistrationDate from PersonInfo where ID =" + id;

oReader = cmd.ExecuteReader();

// while(oReader.Read())

// {

//

//

// }

}

catch (Exception ex)

{

throw new ApplicationException("Failed to connect to data source",ex); //-----Line 64

}

finally

{

if(nwindConn != null)

{

nwindConn.Close();

nwindConn = null;

}

if(oReader != null)

{

oReader.Close();

oReader = null;

}

}

return thePerson;

}


}

}

I have checked references and other things.Everything seems to be fine.

I got the data source name from control panel -> Administrative tools -> Data Sources (ODBC) -> System DSN (tab).

It says:

System Data Sources

Name Driver

Oracle Oracle in OraHome 92

I would really appreciate if some one helps me with this.I have been struggling with this for hours.

Thanks and Regards.

novice