Showing posts with label SOA. Show all posts
Showing posts with label SOA. Show all posts

Wednesday, January 16, 2008

WCF Brain Fart (and why you "need" base addresses)

Well, you don't really need them, unless you are using the basicHTTPBinding and want to see the WCF help page.

Or want to create a proxy from metadata.

Hmm... OK, maybe you DO NEED base addresses!

Maybe I should back up.

The other day I was showing someone how to throw together a quick WCF service hosted in a console application. This was strictly a "Hello World" type of service, and I got everything written and wired up in about 5 minutes. I didn't worry about setting up a metadata behavior or endpoint, just wanted to get the service up an running as fast as I could. I started the app and fired up IE to show the person the WCF help page (a sure sign that it works and I'm brilliant) but instead of the help page I got this error:

<faultcode >a:ActionNotSupported</faultcode>

<faultstring xml:lang="en-US">The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</faultstring>

That really sucked.

In my haste, and my eagerness to show how fast and easy it was to get a service up and running, I forgot one minor but important thing; if you want to see the help page, you need to specify the base address if you are using the basicHttpBinding.

It makes sense; if you don't use a base address, you are sending an HTTP Get to your endpoint. Unless your endpoint knows what to do with it, it throws a fault. The wsHttpBinding is able to handle it, but the basic binding rely's on the Service Host which has some internal functionality that gives you the help page.

But since you need base addresses to use the service metadata behavior, you're just better off making sure you use it.

Saturday, October 20, 2007

Reliable Messaging with WCF at Day of .NET

Thanks to everyone who came to my session this morning. I really enjoyed presenting it and hope you all enjoyed it and got some valuable information. I would love to hear from you all in the future about how you are using WCF, and how the information I presented has helped you design your services infrastructure.

As promised, here is a link to a zip file with my slide deck and the two demos I presented. If you are running Vista the MSMQ demo will have to be run in Visual Studio running with elevated privileges the first time you use it. This is because, as I pointed out, if the queue it uses does not exist it will try to create it. As I mentioned I DO NOT condone this as a best practice in an actual application, but it made the demo easier.

Thanks again for coming out!