Please help to solve the problem. I have application. It calls SharePoint web-service List.asmx to get list elements. Here the code:
Lists listService = new Lists();
NetworkCredential credentials = new NetworkCredential();
credentials.UserName = serviceUserName
credentials.Password = servicePassword;
credentials.Domain = domain;
listService.Credentials = credentials;
listService.Url = serviceUrl.ToString();
XmlDocument xmlDoc = new XmlDocument();
XmlNode nodeListItems = listService.GetListItems(categoryListName.ToString(), null, null, null, "10000", null, null);
The credentials user has access to the list site. If I deploy application on any server, is's ok. I get elements of List. But if I deploy application one the same server with list site, I get an Error 401: Unauthorized.
How can I solve the problem? I realy need to deploy application on the same server.