• Advertisement
Sign in to follow this  

[web] Accessing a Database from a Web Service?

This topic is 4649 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! Im quite new on this topic and is writing a very simple web service witch is containing three Web Methods. One is the predefined Hello World that is autogenerated(just to test if any of the functions is working) and the two remaining is for getting information from a database, using a few Stored Procedures that I have written. I have made a SQL Server(using MS SQL Server 2000 Evaluation), IIS, then I made a database from the Server Explorer in VisualStudio.Net, made a table, and stored some information in it. Then I made a Data Set of it, for use in my Classes. I write in C#. Then I added this Web Service, and tried to run it using only the method that was auto genereated(Hello World) and everything went well when I pushed "Invoke". Then I made some precdures that was going to access my database, using a stored procedure for selecting all information in the table. And tried to run it, everything went well, except for the two new procedures, So I made some changes in Web.config: <add key="ConnectionString" value="Integrated Security=SSPI;database=TestDatabase;server=localhost"/> for using Integrated Security and <identity impersonate="true" userName="" password="" /> When the configuration is like this I get access to the web service, the HelloWorld is working but when I push Invoke on the two methods that should access the database, I get: "This page could not be dispalyed""HTTP 500 Internal server error" but if I place a username/password in the config.web i get this error before the web methods that the web service contains get listed: "Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Unspecified error '" What username and password are requred here? Why am I getting "This page cannot be displayed" ehrn I push Invoke on the database methods? Hope the problem was made clear and that somebody can help me, if there are any questions about me problem, please ask =) Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement