Results 1 to 4 of 4

Thread: [RESOLVED] Web service problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Location
    Bonny Scotland
    Posts
    141

    Resolved [RESOLVED] Web service problem

    Hi all,

    I have another question regarding webservices. I have one set up to access the active directory. As a test i have put in the following code as a method to see if it works.

    Code:
    [WebMethod(Description="Test function to test AD access")]
    			public string testFunction(string username, string pwd)
    			{
    				string testStr = string.Empty;
    				DirectoryEntry de = new DirectoryEntry("LDAP://DC=optos,DC=eye" ,username ,pwd);
    				foreach(DirectoryEntry child in de.Children)
    				{ 
    					testStr = testStr + "<BR>" + child.Name.ToString(); 
    				}
    				
    				return testStr;
    			}
    I have a similar piece of code on the form where i call the web service for, and this is where the problem lies.

    The code runs fine on the form which calls the web service. When i call the web service however i get the following error:

    <i>"Server was unable to process request. --> The specified domain either does not exist or could not be contacted"</i>

    The security on the main form is set to impersonate=true and anonymous access has been removed from the IIS properties for the app. On the web service, again impersonte=true but this time anonymous is checked. When it is unchecked i get Access denied errors.

    Does anyone have any ideas why this is happening.

    Thanks,

    Grant

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Web service problem

    Web services don't run under the context of the logged in user. They run under the context of the caller. This means that you will need to pass credentials to the web service.

    http://support.microsoft.com/default...b;en-us;813834

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Location
    Bonny Scotland
    Posts
    141

    Re: Web service problem

    Hi Mendhak,

    That was a seriously quick response, thank you.

    I'll look over the link and see if i can't get something working. I'll post back either way to let you know.

    Cheers

    Grant

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Location
    Bonny Scotland
    Posts
    141

    Re: Web service problem

    Thanks Mendhak, that worked perfectly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width