locked
HTTP status 403: Forbidden While accessing a web service

    Question

  • Hi,

    I am facing a problem when accessing  a webservice in browswer. 

    The webservice is hosted in IIS in a directory. A certificate is also installed on the web site.

    After enableing the SSL option for website, I am able to access the webservice in browser.
    The problem occurs if the web.config file residing in the virtual directory of webservice is edited in a way that there is no change, just opened saved and closed the file. The webservice stops appearing in the browser and gives the 403 forbidden error. And if we just disable the SSL option and then again enable, the webservice starts to respond again. 

    Another issue is that this webservice is installed via  a installer in the website. On accessing it first time 403 forbidden error occurs. But 
    again if we disable and then again enable the SSL option on the website, webservice starts to respond again. 
    This is a very strange problem where webservice is responding in some occasions and not responding in others.

    Regards,
    Haris
    Wednesday, April 29, 2009 12:37 PM

Answers

  • Haris,
             Did you check event viewer and find any error/info messages when this happens? Sometimes these messages provide more details than seen in error. You can check application and security events to get more information here. One thing you could check is to ensure your application directory has execute permission. Link [1] could help you understand this problem and guide you to solutions. KB Article [2] could be what you are seeing.

    [1] http://www.checkupdown.com/status/E403.html
    [2] http://support.microsoft.com/default.aspx/kb/822322 
    Utkarsh[MSFT]
    Wednesday, April 29, 2009 7:20 PM
    Moderator
  • I think you should all ask on the Dynamics CRM forum. In particular, this happens after an AppDomain reset caused by your modifying web.config. After a reset, any Session and Cache objects may be empty. If CRM expects to find authentication information in Session state, it won't find it after a reset, and might respond with a 403.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects
    Monday, July 13, 2009 1:33 PM
    Moderator

All replies

  • Haris,
             Did you check event viewer and find any error/info messages when this happens? Sometimes these messages provide more details than seen in error. You can check application and security events to get more information here. One thing you could check is to ensure your application directory has execute permission. Link [1] could help you understand this problem and guide you to solutions. KB Article [2] could be what you are seeing.

    [1] http://www.checkupdown.com/status/E403.html
    [2] http://support.microsoft.com/default.aspx/kb/822322 
    Utkarsh[MSFT]
    Wednesday, April 29, 2009 7:20 PM
    Moderator
  • Hi, 
    Thanks for the reply....

    I've tried with giving Execution rights to application directory but it did not help me. Here is the full detail of what Application events record when this happens.

    Event code: 3005 
    Event message: An unhandled exception has occurred. 
    Event time: 4/30/2009 11:03:03 AM 
    Event time (UTC): 4/30/2009 6:03:03 AM 
    Event ID: 9c0b9118b07541f9a7312a9b769c75bd 
    Event sequence: 7 
    Event occurrence: 6 
    Event detail code: 0 
     
    Application information: 
        Application domain: /LM/w3svc/2/Root/ISV/Abc/Xyz/SS/WorkflowService-15-128854834675937500 
        Trust level: Full 
        Application Virtual Path: /ISV/Abc/Xyz/SS/WorkflowService 
        Application Path: C:\Program Files\Microsoft Dynamics CRM\CRMWeb\ISV\Abc\Xyz\SS\WorkflowService\ 
        Machine name: Abc-SVR-33 
     
    Process information: 
        Process ID: 2728 
        Process name: w3wp.exe 
        Account name: NT AUTHORITY\NETWORK SERVICE 
     
    Exception information: 
        Exception type: WebException 
        Exception message: The request failed with HTTP status 403: Forbidden. 
     
    Request information: 
        Request URL: https://Abc-svr-33:443/ISV/Abc/Xyz/SS/WorkflowService/SomeService.asmx 
        Request path: /ISV/Abc/Xyz/SS/WorkflowService/SomeService.asmx 
        User host address: 192.168.25.18 
        User: Domain\Administrator 
        Is authenticated: True 
        Authentication Type: Negotiate 
        Thread account name: NT AUTHORITY\NETWORK SERVICE 
     
    Thread information: 
        Thread ID: 1 
        Thread account name: NT AUTHORITY\NETWORK SERVICE 
        Is impersonating: True 
        Stack trace:    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at Microsoft.Crm.Metadata.MetadataWebService.GetDataSet()
       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadDataSetFromWebService(Guid orgId)
       at Microsoft.Crm.Metadata.DynamicMetadataCacheLoader.LoadCacheFromWebService(LoadMasks masks, Guid organizationId)
       at Microsoft.Crm.Metadata.DynamicMetadataCacheFactory.LoadMetadataCache(LoadMethod method, CacheType type, IOrganizationContext context)
       at Microsoft.Crm.Metadata.MetadataCache.LoadCache(IOrganizationContext context)
       at Microsoft.Crm.Metadata.MetadataCache.GetInstance(IOrganizationContext context)
       at Microsoft.Crm.BusinessEntities.BusinessEntityMoniker..ctor(Guid id, String entityName, Guid organizationId)
       at Microsoft.Crm.Caching.UserDataCacheLoader.LoadCacheData(Guid key, ExecutionContext context)
       at Microsoft.Crm.Caching.ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context)
       at Microsoft.Crm.Caching.BasicCrmCache`2.CreateEntry(TKey key, IOrganizationContext context)
       at Microsoft.Crm.Caching.BasicCrmCache`2.LookupEntry(TKey key, IOrganizationContext context)
       at Microsoft.Crm.BusinessEntities.SecurityLibrary.GetUserInfoInternal(WindowsIdentity identity, IOrganizationContext context, UserAuth& userInfo)
       at Microsoft.Crm.BusinessEntities.SecurityLibrary.GetCallerAndBusinessGuidsFromThread(WindowsIdentity identity, Guid organizationId)
       at Microsoft.Crm.Authentication.CrmWindowsIdentity..ctor(WindowsIdentity innerIdentity, Boolean publishCrmUser, Guid organizationId)
       at Microsoft.Crm.Authentication.WindowsAuthenticationProvider.Authenticate(HttpApplication application)
       at Microsoft.Crm.Authentication.AuthenticationStep.Authenticate(HttpApplication application)
       at Microsoft.Crm.Authentication.AuthenticationPipeline.Authenticate(HttpApplication application)
       at Microsoft.Crm.Authentication.AuthenticationEngine.Execute(Object sender, EventArgs e)
       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Regards,
    Haris
    Thursday, April 30, 2009 6:26 AM
  • i got the same error , can anyone help?
    韓建興 http://jamson.cnblogs.com
    Monday, July 13, 2009 8:57 AM
  • I think you should all ask on the Dynamics CRM forum. In particular, this happens after an AppDomain reset caused by your modifying web.config. After a reset, any Session and Cache objects may be empty. If CRM expects to find authentication information in Session state, it won't find it after a reset, and might respond with a 403.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects
    Monday, July 13, 2009 1:33 PM
    Moderator
  • Hello ,

    Did you find any solution?

    Cause i had a page running fine in CRM before we made it in https, and now i get this exact error when i try to open it.

    When i remove the ssl then it runs fine!!

    Any help would be appriciated!! :)

     

    Find it.... the serverurl in the registry of the server was not in https....

    Wednesday, March 31, 2010 1:46 PM