London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Web-service-call; user does not have the 'Permission.WebServiceAccess' access right to access web services on the remote site, for user at EPiServer.WebServices.DataFactoryService.ValidateWebServiceAccess()

Vote:
 

In an Episerver-project a call is made from a website on one server to an ASMX-webservice at another server. The user calling has all right set in IIS 7 to write, create and retrieve files from folders.

The 401-error I had was solved ([Link][1]) and now I get another error.

The following error-message appears when the webservice-call is made:

    Referer    [url removed]
    
    System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> EPiServer.Core.EPiServerException: The user does not have the 'Permission.WebServiceAccess' access right to access web services on the remote site, for user
      at EPiServer.WebServices.DataFactoryService.ValidateWebServiceAccess()
      at EPiServer.WebServices.DataFactoryService.GetDefaultPageData(PageReference pageLink, Int32 pageTypeID)
      --- End of inner exception stack trace ---
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    
    Exception Details: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> EPiServer.Core.EPiServerException: The user does not have the 'Permission.WebServiceAccess' access right to access web services on the remote site, for user
      at EPiServer.WebServices.DataFactoryService.ValidateWebServiceAccess()
      at EPiServer.WebServices.DataFactoryService.GetDefaultPageData(PageReference pageLink, Int32 pageTypeID)
      --- End of inner exception stack trace ---
    
    Source Error:
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    
    Stack Trace:
    
    
    [SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> EPiServer.Core.EPiServerException: The user does not have the 'Permission.WebServiceAccess' access right to access web services on the remote site, for user
       at EPiServer.WebServices.DataFactoryService.ValidateWebServiceAccess()
       at EPiServer.WebServices.DataFactoryService.GetDefaultPageData(PageReference pageLink, Int32 pageTypeID)
       --- End of inner exception stack trace ---]
       System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +431766
       System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
       RemotePublishForLedigeStillinger.DataFactoryService.DataFactoryService.GetDefaultPageData(PageReference pageLink, Int32 pageTypeID) in C:\Programmering\RemotePublishTest\RemotePublishTest\Web References\DataFactoryService\Reference.cs:150
       RemotePublishForLedigeStillinger.Program.PublishPageToRemoteService(PageData pageLedigeStillingerOriginal) in C:\Programmering\RemotePublishTest\RemotePublishTest\Program.cs:143
       EPiServer.Templates.RelatePlus.Pages.JobAd.RemotePublishPage(PageData pageToPublish) in C:\Repo\Projects\dikt.intranett\www\Templates\RelatePlus\Pages\JobAd.aspx.cs:125
       EPiServer.Templates.RelatePlus.Pages.JobAd.Godkjent_OnClick(Object sender, EventArgs e) in C:\Repo\Projects\dikt.intranett\www\Templates\RelatePlus\Pages\JobAd.aspx.cs:110
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


  [1]: http://stackoverflow.com/questions/12674071/asmx-web-service-call-the-request-failed-with-http-status-401-unauthorized/12674152#comment17103554_12674152

The webservice can be browsed on its webservice-URL [/WebServices/DataFactoryService.asmx ]

 

Try for solution:


I have given the user that is calling the web-service (dr-2\epi.admin) rights to execute the web service. [under the Admin-mode of Episerver; config; security]

 

Some of my current code in web.config:

    <episerver.basicAuthentication sendBasicChallenge="true" basicRealm="" />
    <system.web>
      <httpModules>
    <add
        name="BasicAuthentication"
        type="EPiServer.Security.BasicAuthentication, EPiServer" />
        
   </httpModules>
    
      <httpRuntime maxRequestLength="1000000" />
      <authorization>
        <allow roles="Administrators,WebServices,dr-2\epi.admin, epi.admin, Everyone" />
        <!-- <deny users="*" />-->
      </authorization>
    </system.web>
    <system.webServer>
    
        <modules runAllManagedModulesForAllRequests="true">
         <add name="BasicAuthentication" type="EPiServer.Security.BasicAuthentication, EPiServer" />
        </modules>

    <handlers>
        <clear />
        <add name="webresources" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
        <add name="WebServiceHandlerFactory-Integrated" path="*.asmx" verb="GET,HEAD,POST,DEBUG" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" modules="ManagedPipelineHandler" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="integratedMode" responseBufferLimit="4194304" />
        <add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
      </handlers>
    </system.webServer>

    

#61804
Oct 02, 2012 13:06
Vote:
 

The strack trace indicates there is still a problem with 'Permission for functions > Allow the user to act as a web service user'. I would say either the user has not been granted access or the credentials are not being sent correctly with the web service call. 

Looking at the code in EPiServer.WebServices.DataFactoryService.ValidateWebServiceAccess(), the exception message should be appended with the current users name. In your message above, have you removed the users name from the message?

The user does not have the 'Permission.WebServiceAccess' access right to access web services on the remote site, for user [users name should be here]

#61812
Edited, Oct 02, 2012 14:30
Vote:
 

Thanks for your reply!

As for your question, "In your message above, have you removed the users name from the message?", the answer is no.

So your statement 'the credentials are not being sent correctly with the web service call' seems to be correct.

#61816
Oct 02, 2012 16:27
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.