Saturday, 3 May 2008

Sofware, a factory approach - Host

This is the sixth and second to last post in this series, you can find the landing page here
The code for this step of the series can be downloaded here.

While the code for the models is created, we still have one more step to go.

Add project

First off, add a new model to the Tracker factory, this time choosing a Host model template.  This gives you a somewhat different editor, as there's no design surface this time.  Right click the Host Model node and add a new Host application. 

1. add implementation project


Rename the Host application to IIS, and configure the properties to those in the image (the implemenation project is the Host project under the test directory).

2. Host application

Now, right click the IIS node and add a new Service reference, configure it as per the image below:

3. add service reference

Now, in the final step add a new Endpoint, call it HttpPickup and set the binding to BasicHttp.
You'll notice that the address on the Endpoint is empty, but it's not a problem..

Generate

Select the Pickup Service node and click the "Generate Service" label in the left side of the screen, this will add the .svc file to the generation target (the host project in the test directory).

Next up, select the solution explorer and go and build the Host project. Afterwards right click the svc and choose Browse.  Copy the address from the service, return to the host explorer and paste it in the endpoint address textbox. 

4. endpoint configuration

Adding a client

Adding a client is very similar to adding a host.  Right click the Host Model node, add a Client Application and configure it as per the image below.

5 client configuration

Last step in the Client Application is to add a proxy to Host's endpoint.
After configuration, click the generate proxy label in the left hand screen.
Rebuild the entire application and presto.. you have created your first WSSF application!

 

0 comments: