View Single Post
  #6 (permalink)  
Old December 28th, 2010, 08:36 PM
argyleghost argyleghost is offline
Registered User
Join Date: Dec 2010
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default OK, getting closer... :D

Thanks for the replies and help Fabio.
I just deleted the 3 previous files that were generated from the bin folder. ran the svcutil.exe on the Contracts.dll and it generated the three files again.

I then took your last code and generated the two files (Schema.cs and the output.config). Looking in the schema.cs I saw that there is a namesspace:
namespace Wrox.CarRentalService.ConsoleClient.CarRentalProxy
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "")]
    public interface ICarRentalService
        [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="")]
        double CalculatePrice(System.DateTime pickupDate, System.DateTime returnDate, string pickupLocation, string vehiclePreference);
two things now (which are not explained at all in the book).
1. [QUESTION] How did it know in the namespace to put "...consoleclient.CarRentalProxy"? I checked for code all over the Carservice app and there is nothing there referencing such client. I have the ClientConsole in a totally seperate solution. How did it know?

2. [WHAT I DID - WAS IT THE RIGHT WAY?] I created an app.config in the client Console app and copied and pasted the "output.config" in it. Then I created an ICarRentalService.cs file in the Console Client and copy and pasted the schema.cs file there.

Ran the code and the console did come up (finally! Thanks Fabio!). I did run into an Invalid Operation Exception error: "The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a valid Address specified."

But at least the console started to run. Wrox really needs to update this section of the book. It scares me what assumptions they left for the other 900 pages. :D
Reply With Quote