WebServicePortal Implementation

WebServicePortal Implementation

Old forum URL: forums.lhotka.net/forums/t/9741.aspx


adesoji posted on Wednesday, November 10, 2010

I'm relatively new to OOD, and I'm consolidating my knowledge with a step-by-step, chapter-by-chapter implementation of CSLA (Expert VB 2005 BO). I'm at Chapter 4, and I'm somewhat stumped by the implementation of the WebServicePortal. The only guide I could find to implement the portal is in sidebar (pg 211) that says:

"Setting up the web services was a little tricky. Before creating the WebServicesProxy, I had to implement the WebServicePortal class ... and temporarily host Csla.dll in a virtual root. That allowed me to add a web reference from the Csla project. Once that web reference was established, I was able to create WebServicesProxy ..."

I'd be most grateful for an outline of the steps to implement this portal, please.

ade

RockfordLhotka replied on Wednesday, November 10, 2010

This part of CSLA has little to do with OOD, and more to do with the mechanics of implementing a service. But I can explain what I did.

With services, there's the service and the consumer. Typically the consumer is created by adding a service reference to the service - which implies that the service already exists. With Csla.dll this is a little tricky since the service and consumer code are in the same assembly. So you are sort of adding a service reference to yourself.

Still, this implies that the service be created first, so that's what I did - implement the host part of the data portal. But you still need to actually host the service in order to add the service reference.

  1. Implement the host part of the data portal
  2. Compile the project so you have a Csla.dll
  3. Open a new instance of VS and create a temporary web project to actually host Csla.dll and expose the service, and run that web project
  4. Back in the Csla project (original instance of VS) add a service reference to your temporary service, thus adding the client code for the service into the Csla project
  5. Save the Csla project
  6. Close and discard the temporary web project

 

 

adesoji replied on Thursday, November 11, 2010

Ta, very much, for your response and patience, Rocky. My reference to consolidating OOD knowledge pertained to the book in its entirety (not just the portal implementation). By the time I complete the Csla project and the ProjectTracker, I hope to have consolidated all the OOD knowledge I've gleaned from here, there and everywhere; the book is priceless in that regard. And, contrary to what my earlier post may suggest, I honestly find the book intuitive and easy to follow.

Thanks

Copyright (c) Marimer LLC