TheChaseMan's Frenetic SoapBox

Always looking for better ways to do things...

Open Solicitation for Indigo Advice: March CTP issues

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.  :-)


Digg!

posted on Saturday, March 26, 2005 12:30 PM

Feedback

# Another Open Solicitation for Indigo Advice 3/26/2005 4:18 PM TheChaseMan's Frenetic SoapBox

# re: Open Solicitation for Indigo Advice: March CTP issues 6/22/2005 10:48 AM Wei Cheng

I am facing same error right now, and I am using BETA2 of VS.NET 2005.

Now easy to beta test these thing especially when error message kind of tell you nothing helpful.

# re: Open Solicitation for Indigo Advice: March CTP issues 6/22/2005 11:13 AM Sean Chase

Kenny Wolf with Microsoft sent me the following email message about this blog entry. I haven't tried it yet, but hopefully it works out for you.


"I tried posting a comment to your blog entry about this and it didn't work. You may be missing a script mapping for .svc files (xws_reg /lk would show you what's there). If it's missing, you should use "xws_reg /r" to fix it.

Cheers,
Kenny"