Question

I am working with WCF Services in Ektron(rrot/Workarea/Services). When i am trying to consume the ContentService.svc service in a client using the following code,

   ContentManagerClient cClient = new ContentManagerClient();
   UpdatedContentService.ContentData data = new UpdatedContentService.ContentData();
   data.m_strTitle = "test";
   data.m_strHtml = "test";
   data.m_intFolderId = 72;
   data.m_intUserId = 1;
   cClient.Add(data);

I am getting the following error ' The current user does not have permission to carry out this request'. How can i authenticate an ektron user to perform this action from a client?

Was it helpful?

Solution

The answer you received on the ektron dev forums was a good one. (prior discussion for anyone with the same problem: http://developer.ektron.com/forums/?v=t&t=1280)

You will need to use the Auth service, not the content service. this can be done using the following steps:

  1. Create a proxy object for the web service: Run .Net tool wsdl.exe against your webservice address, e.g. http://localhost:/Workarea/webservices/AuthService.asmx
  2. Compile into DLL by running “csc /t:library AuthenticationService.cs”: Add the DLL as a reference to your DLL or console app Copy the DLL to a Lib folder in your project
  3. Add the DLL as a reference to your DLL or console app Copy the DLL to a Lib folder in your project Right click “Add reference” and browse to your created proxy DLL. Add System.Web.Services as a reference to your DLL or console app
  4. Call the proxy code from your app:

    AuthenticationService auth = new AuthenticationService();
    IAsyncResult response = auth.BeginisValidUser(username, password, etc...);

a working code example of this can be found at: http://developer.ektron.com/Templates/CodeLibraryDetail.aspx?id=1036&blogid=116

This example was adapted from the VooDoo engineering example of pulling in the content service: http://ektroneering.blogspot.com/2011/01/accessing-ektron-from-dll-or-console.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top