I decided to install the Avalon/Indigo March CTP, so I set up a new VM in VPC
with WinXP w/SP2, VS2005 Beta 2 Feb CTP, installed Avalon, Indigo, and the WinFX
SDK. I've already play around with Avalon because I love the idea of XAML, so
instead I tried out Indigo. First problem I ran into was a pilot error (ever
hear the phrase "read the ----- manual?"). I was working through the
How To Create a Self-Hosted Service sample and I forgot to add a config
file, which brought up a nice InvalidOperationException...
Uri baseUri =
new Uri("http://localhost/MathService");
ServiceHost<MathService>
host = new
ServiceHost<MathService>(baseUri);
// Opening the host sets
up the communications infrastructure.
host.Open();
So, I tried adding an app.config file and placed the configuration info in there
and kept getting an exception saying, "Configuration system failed to
initialize." Gosh, now I'm starting to feel like VB programmer, so I dig deeper
and
found some info in hopes of avoiding the need for the config file. I changed
the Uri to point to port 8080 at the root like so, and viola...
Uri baseUri =
new Uri("http://localhost:8080");
ServiceHost<MathService>
host = new
ServiceHost<MathService>(baseUri);
BasicProfileBinding
binding = new
BasicProfileBinding();
host.AddEndpoint(
typeof(IMathService),
binding,
"MathService"
);
// Opening the host sets
up the communications infrastructure.
host.Open();
Next, I spent a few minutes trying to find
Svcutil.exe which happens to reside in C:\Program Files\Microsoft Indigo
Preview just in case you are looking for it....

But alas, I end up with a problem trying to run the
utility...
C:\Program Files\Microsoft Indigo Preview>svcutil
/out:proxy.cs http://localhost:8080/MathService/ep1
Microsoft (R) Service Model Metadata Tool
[Microsoft(R) .NET Framework, Version 2.0.50110.20]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: WS-MetadataExchange Failed on URI:http://localhost:8080/MathService/ep1
HTTP response code: 'UnsupportedMediaType'
is not conformant to the SOAP-over-HTTP request-reply binding.
The remote server returned an error: (415) Unsupported Media Type.
Error: HTTP Get failed on URI:http://localhost:8080/MathService/ep1
There was an error downloading 'http://localhost:8080/MathService/ep1'.
The request failed with HTTP status 405: Method Not Allowed.
Error: Unable to obtain Metadata from the Uri provided
If you would like more help, please type "svcutil /?"
So I decided to get out of the console-app-only mode and put the math service
class and interface into a class library project and compile it into a DLL
assembly instead. Again, I tried using svcutil.exe which actually took a few minutes
this time because for some reason the command line utility only likes 8.3 file/folder names (yuck)...
C:\Program Files\Microsoft Indigo Preview>svcutil.exe
C:\DOCUME~1\Sean\MYDOCU~1\VISUAL~1\Projects\ConsoleApplication2\MathService\bin\Debug\MathService.dll
Microsoft (R) Service Model Metadata Tool
[Microsoft(R) .NET Framework, Version 2.0.50110.20]
Copyright (C) Microsoft Corporation. All rights reserved.
Generating Metadata Files...
C:\Program Files\Microsoft Indigo Preview\tempuri.org.wsdl
C:\Program Files\Microsoft Indigo Preview\tempuri.org1.xsd
C:\Program Files\Microsoft Indigo
Preview\schemas.microsoft.com.2003.10.Serialization.xsd
So now based on my best guess from reading
David Chappell's article, I need to create a proxy. So I tried creating a
proxy against the wsdl and xsd files and ended up with errors that said,
"Error: Schema with target namespace 'http://tempuri.org/'
could not be found" and
"Warning: No code was
generated because the metadata(s) did not contain any valid contracts/services
or because all contracts/services were discovered via /reference"*
sigh *
If anyone has any thoughts on what I'm missing, drop me a line and let me
know. I'm kind of at a dead end at this point...at least until after lunch.
:-)