Webservice - ODBC - sqlServer

T

TheMaxx

I need to access ODBC from remote computer, if there's a better way other
than WebService please let me know.

So, i am doing web service which connects on ODBC, which connects to
SqlServer 2000 (Windows auth.)
First error was:
Login failed for user 'MyComputerNmae\ASPNET'.

Then i unchecked "Anonymous acces" from IIS for this webservice

I added to web.config of webService:

<identity impersonate="true"
userName="DOMAIN\username"
password="pwd"/>

When i call method from browser directly to web service i get expected
results.
When trying from application that uses WebServices i get an error:
"The request failed with HTTP status 401: Access Denied."

What can cause this error?

p.s. call from webservice looks like this:

OdbcDataAdapter adapter = new OdbcDataAdapter(query, odbcConnectionString);
DataSet ds = new DataSet();
adapter.Fill(ds);
return ds;
 
J

John Saunders

TheMaxx said:
I need to access ODBC from remote computer, if there's a better way other
than WebService please let me know.

I would think about using .NET Remoting instead of Web Services. Web
Services are meant to be platform-independant, and there are aspects to
their use which make it difficult to use .NET-specific features. If you
don't need the platform-independence, I believe it's best to do without it.

As to your specific problem, I'd need to see the client code which calls the
web service. In particular, does the client code set the Credentials on the
web service proxy? Also, if you want to use Windows Authentication to the
web service, I believe you'll have to make sure that Anonymous access is
turned off in IIS.

Finally, out of curiosity, why ODBC instead of using the Sql Server client
classes? I'm referring to SqlConnection etc.

John
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top