No one has responded to this discussion for at least a year, so this information may be out of date. If you're looking for information about this topic, please search for a more recent discussion or post a new question.

Not able to access People.asmx web service

  • Hi

     

    I am getting exception "The HTTP request was forbidden with client authentication scheme 'Anonymous'." while trying to access people.asmx web service.

    My code is

    ClientContext clientContext = ClaimClientContext.GetAuthenticatedContext(TargetSite);

    clientContext.Load(clientContext.Web);
    clientContext.ExecuteQuery();

    SPPeopleService.PeopleSoapClient ps = new SPPeopleService.PeopleSoapClient();

    ps.Endpoint.Address = new System.ServiceModel.EndpointAddress(TargetSite+"_vti_bin/People.asmx");

    //searchTxt is a textbox in which i am taking the value of the user

    SPPeopleService.PrincipalInfo[] userlist=ps.SearchPrincipals(SearchTxt.Text, 50,SPPeopleService.SPPrincipalType.User);

    string userid = userlist[0].UserInfoID.ToString();

     

    Thanks in advance

    Alam

  • Hi Alam,

    This is Jonis from Microsoft SharePoint Online Support.

    When working with SharePoint Online for Office 365, you can create custom developed solutions.  While Microsoft allows custom developed solutions, we ask that you support any custom solutions you develop. It is possible that your people.asmx web service request is not allowed in the multi-tenant environment of SharePoint Online. To resolve this error, I recommend the following links to the SharePoint Online Developers Guide and the SharePoint Online Developer Resource Center:

    SharePoint Online for Office 365 Developer Guide

    SharePoint Online Developer Resource Center

    Download: SharePoint Online for Office 365 Developer Guide

    If that does not answer your question please let me know as I will continue to monitor this thread for a few days and will reply to any additional posts or questions.

  • Hi Jonis,

    Thanks for replying.

    How can we know that our office 365 environment supports people.asmx web service request or not?

    Thanks

    Alam

  • Hi Alam,

    This is Jonis from Microsoft SharePoint Online Support.

    WebSvcPeople is an early ASP.NET web service, that is available in SharePoint Online.  External data connections of this type are not available for use in sandboxed solutions.  You should be able to access it with a client application such as Microsoft Silverlight and ECMAScript (JavaScript, JScript).

    If that does not answer your question please let me know as I will continue to monitor this thread for a few days and will reply to any additional posts or questions.