Connect with me
Search
Twitter Feed
Navigation

Entries in WCF (7)

Thursday
Jun032010

Adding custom http header to all WCF requests

I needed to add a customer http header to the outgoing request of a web service call (for authentication purposes). With old web services it was easy to do this, but with WCF it’s a bit tricker. The good thing is that WCF is *very* extensible.

To do this, we need to create a custom WCF behavior and message inspector.

The solution file is available in the resources section of the post.

Click to read more ...

Wednesday
May052010

401.1 Unauthorized - IIS & WCF using custom host headers and host entry

I ran into a bit of a issue today at a client with Windows Authentication and WCF services (it seems like a very common problem) where I was using a host header in IIS to test a web application I was working on. To do this, I added an entry to the hosts file in %windir%\system32\drivers\etc to map the custom host name (e.g. testapp.com) to 127.0.0.1

Accessing the web application worked fine, but trying to access the WCF services hosted under IIS (also using Windows Authentication) kept prompting the login dialog and then eventually failing with the dreaded 401.1 - Unauthorized

Adrian Foyn pointed me to a registry hack to enable loopbacks by setting the registry key:

Click to read more ...

Friday
Apr092010

Getting the physical folder path of a virtual path or directory in WCF

I had a request from a client today to save something uploaded through WCF to the local disk to a particular sub folder.

Normally this is easy in ASP.NET with Server.MapPath but this isn’t available in the WCF application.

Click to read more ...

Monday
Feb162009

Debug cryptic WCF errors with WCF Tracing and the Microsoft Service Trace Viewer

While working on a project involving Silverlight and WCF REST I ran into some errors that didn’t give me much insight into the actual problem.

The error I got was:

System.Net.WebException: The remote server return an error: NotFound

Click to read more ...

Wednesday
Aug202008

Presentation - Sydney .NET User Group - LINQ to SQL and WCF

Today I presented at the Sydney .NET User Group. The topic was using LINQ to SQL with WCF in a three tiered architecture.

It was quite a good turn out and I had lots of good audience feedback during the session. Thank you to all those who attended the session. I hope you all found it useful.

Click to read more ...