web service (*.svc) - pb to create context...

2 posts, 0 answers
  1. Marchand
    Marchand avatar
    15 posts
    Member since:
    Sep 2008

    Posted 23 Feb 2011 Link to this post


    I create a web site with use the ORM component of telerik.
    To create the context, I use the recommandation describe in the document "Best practices in webdevelopement with OpenAcess".
    ==> It works.

    And now, in my web site, I implement a Web serrvice that use the same component to acess to the database, that use the ORM componenent.
    ==> And it does not works !! Because the context is not create, because the system does not generate a "httpmodule" event...and the system does not passed in the code :

           /// <summary>
           /// _Context_PreRequestHandlerExecute
           /// </summary>
           /// <param name="sender"></param>
           /// <param name="e"></param>
           void _Context_PreRequestHandlerExecute(object sender, EventArgs e)
               if (HttpContext.Current.Session != null)
                   HttpContext.Current.Session[SCOPE_KEY] = new ISYS_Qualification_BO.ISYS_QUALIFICATION_Diagram();



    Techinical information :
    - My project use the framework 4.0
    - The web service is "svc". I think that use the WCF.

    Have you got a solution ?

    In advance, Thanks.

  2. TSE
    TSE avatar
    381 posts
    Member since:
    Sep 2008

    Posted 25 Feb 2011 Link to this post

    Hi Marchand,

    The practices described in the document "Best practices in webdevelopement with OpenAcess" are targeted against WEB development and not WCF development... While they are (or can be in case of WCF) both hosted on IIS they use different request pipelines to handle incoming requests. This is the short technical reason for WCF requests not working...

    For WCF I have come up with some guidelines to manage the scope... the context in your case... Although the blog article(s) are targeted at the classic scope approach they can still be used (with minimal rewriting) as the concepts are the same...

    Take a look at how it is handled here.

    And yeah... I REALLY need to update those articles to the Context (visual designer) approach instead... + write a few more articles... time you know :-)


  3. DevCraft banner
Back to Top