Rafael Zuniga, Stephen Cave
Summary:
Summary:
First we create a service contract as service.cs with a single operation and implement it, adding contract attributes to the interface portions, adding a service type to implement the "HelloIndigo" function, and compiling to check completeness.

Next we create a host application named Host, that references our stuff in the HelloIndigo project and System.ServiceModel. Book code was used to write the main function as a ServiceHost instance and endpoint for the service.
Lastly we create a new console app to test the service, adding a Client project with a System.ServiceModel reference. The service contract is copied into a proxy for the client, and code is copied into the program.cs, that uses ChannelFactory for invoking the service. An endpoint is also initialized.
The program is run, host then client after compiling successfully. The output looks correct.
Notes on Usefulness:
This lab is quite useful for understanding the basic code that goes into creating and consuming a service programatically.
Problems/Mistakes/Differences -> troubleshooting encountered:
Problems/Mistakes/Differences -> troubleshooting encountered:
-When creating the Host, debugging the program led to a System.ServiceModel.AddressAccessDeniedException being thrown. This was fixed eventually by running visual studio as administrator.
-copy pasting code from the book source to the program isn't 1 to 1, random spaces seem to be inserted, so some review and adjustment was required to correct the errors.


No comments:
Post a Comment