This is a migrated thread and some comments may be shown as answers.

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

1 Answer 46 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marchand
Top achievements
Rank 1
Marchand asked on 23 Feb 2011, 10:31 AM
Hi,

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.
Richard.




1 Answer, 1 is accepted

Sort by
0
IT-Als
Top achievements
Rank 1
answered on 25 Feb 2011, 09:11 AM
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.

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

Regards

Henrik
Tags
Development (API, general questions)
Asked by
Marchand
Top achievements
Rank 1
Answers by
IT-Als
Top achievements
Rank 1
Share this question
or