Tuesday, December 15, 2009 1:42 AM
When i try to access the Sharepoint web service from the Client side (ie) using Silverlight, i got the Exception that "Remote server returned an error : Not Found".
Apart from this when i try to access my custom webservice, it give the result back to the Clientside for non database operation. If i use the database operation in my custom webservice it also give the same exception "Remote server returned an error : Not Found.". Is there is any access permission have to set for SQL server?.
In my event viewer i got detailed error that
"Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]"
Tuesday, December 15, 2009 2:26 AM
The NT AUTHORIY\NETWORK SERVICE account is running your webservice. You should give this account permission to access your database in SQL Server Management Studio.
Don't get confused by the Not Found error. For security reasons error messages are not by default send to the client, so any exception you don't handle results in a Not Found error for the client.
Tuesday, December 15, 2009 3:53 AMSorry i don't have much knowledge in SQL Server, Can u tell how to add the NT AUTHORIY\NETWORK SERVICE account which is running in Web service to SQL server Management studio.
Tuesday, December 15, 2009 5:07 AM
Ok, here goes:
- Open Sql Server Management Studio from the start menu
- Connect to the local database server (assuming that's the one you're working with)
- Open the Security folder for the server
- Right click Logins and click New Login...
- Click the Search button
- In the box opened type the username and click Check Names
- If all is ok, click the Ok button
- Click User Mapping
- In the top list, check the database(s) that you want the account to have access too
- In the lower list, check the role(s) you want to assing to the account for the selected database. In a development scenario, assigning the db_owner role will do the trick.
- Click Ok and you're done.
Tuesday, December 15, 2009 6:05 AMIt not work for me even after i give permission . Till it shows the Exception. In VS output window i find one exception "'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll'" in the silverlight. This error is occurred after calling the Web service method
Friday, April 27, 2012 6:26 PM
Thanks ..it is best answer ..
You really saved so much headache ..