Microsoft KB Archive/320354

From BetaArchive Wiki
Knowledge Base


BUG: Error When You Call LoadData Method in MSDN "Creating a Distributed Application" Walkthrough

Article ID: 320354

Article Last Modified on 2/12/2007



APPLIES TO

  • Microsoft Web Services Enhancements for Microsoft .NET 2.0
  • Microsoft .NET Framework Software Development Kit 1.0 Service Pack 2
  • Microsoft .NET Framework Software Development Kit 1.0 Service Pack 2



This article was previously published under Q320354

SYMPTOMS

When you call the LoadData method from the AuthorsWinClient on a remote computer according to the instructions in the Microsoft Developer Network (MSDN) "Creating a Distributed Application" walkthrough, the method is unsuccessful and you receive the following error message:

Result: Error: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand

command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand

command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at WSRepro.Service1.GetDataSet() in c:\inetpub\wwwroot\wsrepro\service1.asmx.cs:line 158
                    

CAUSE

The walkthrough does not have enough information about security to work correctly when you call a Web service method on a remote computer.

RESOLUTION

Impersonate the Microsoft SQL Server trusted domain account through Microsoft Internet Information Services (IIS).

You must configure the project by using the IIS tool.

  1. Start IIS. To locate IIS, double-click Administrative Tools in Control Panel. (For more information about how to start this tool, see your Microsoft Windows Help documentation.)
  2. Expand the node for your server.
  3. Expand the Default Web Site node.
  4. Right-click the AuthorsWebService node, and then click Properties.
  5. Click the Directory Security tab.
  6. In the Anonymous access and authentication control section, click Edit.
  7. Type the name and the password of the SQL trusted domain user in the Account used for anonymous access section.
  8. Click to clear Allow IIS to control password.
  9. Return to the project in Microsoft Visual Studio, and then double-click the Web.config file in Solution Explorer.
  10. Add the following tag on the line after the <system.web> tag to configure integrated security for your XML Web service:

    <identity impersonate="true"/>
                        


STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

REFERENCES

For additional information about ASP.NET security, click the article numbers below to view the articles in the Microsoft Knowledge Base:

306158 INFO: Implementing Impersonation in an ASP.NET Application


306590 INFO: ASP.NET Security Overview


For more information, visit the following Microsoft Developer Network (MSDN) Web site:

Keywords: kbbug kbnofix KB320354