RE: Oracle connection with WebService



WebService on the same machine as the application or on another machine? If
another machine, ensure the proper client bits are on the other machine.

Most likely it has to do with user context. When using a windows
application, you are logged in as yourself. WIth a web service, it is under
anonymous user in most cases.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


"MikeB" wrote:

> I wrote the following method to test connecting to an Oracle database:
>
> public static string HelloMyOracleDataWorld()
> {
> string ret = "";
> string connectString = "Integrated
> Security=false;PWD=password;UID=user;SERVER=server";
> OracleConnection connection = new OracleConnection(connectString);
> connection.Open();
> string sqlQuery = "SELECT * FROM table WHERE id = '00000'";
> OracleCommand dbCommandWrapper = new OracleCommand(sqlQuery,
> connection);
> using (IDataReader dataReader = dbCommandWrapper.ExecuteReader
> (CommandBehavior.CloseConnection))
> {
> if(dataReader.Read())
> {
> ret = dataReader["PROJ_START_DT"].ToString();
> }
> }
> return ret;
> }
>
> The method works great when used from a Windows Application, but as soon as
> I call this method from a WebService the method just hangs on the
> "connection.Open()" command. I don't have any of these problems when
> connecting to SQL from WebServices, just Oracle.
>
> Is I missing something? I'm admittedly new to this framework but I thought
> this should be straight forward, and like I mentioned, it works just fine
> from a Windows Application, why not from a WebService?
>
> Please help, I need to resolve this issue ASAP...
>
> Thanks!
.



Relevant Pages