AnsweredAssumed Answered

Getting error while creating membership

Question asked by girishb on Oct 28, 2009
Hi,

I have created a web site and users on Alfresco and I am trying to add created web site to the user. The code snippet is as below,

          Person person = new Person();
         
          HttpClient http = new HttpClient("http://localhost:8080/alfresco/service/api/");
          http.TransportSettings.Credentials = new NetworkCredential("admin", "ADMIN");
         
          AddUserToWebSite addUserToWebSite = new AddUserToWebSite();
          addUserToWebSite.ListPerson.Add(person);
         
          string jsonSite = JsonConvert.SerializeObject(addUserToWebSite);
          HttpResponseMessage resp = http.Post("memberships", HttpContent.Create(jsonSite, "application/json"));
          string value = resp.Content.ReadAsString();

I am getting following exception in the response,
POST http://localhost:8080/alfresco/service/api/memberships NotFound 404)

Please help me ASAP.

Outcomes