Archive for the ‘WCF’ Category

Serve PDF as inline attachments – WCF REST style

No Comments »

Some time ago, a user with the nickname refaeldakar asked in the WCF/MSDN forum how he could serve PDFs with the WebHttpBinding so that where shown as inline attachments in the web browser.

I wrote a small test application that did what he asked for. The trick here is to add an extra HTTP header to the outgoing response to the web browser; Content-disposition: “inline; filename=filenamehere.pdf".

The code can be found on here.


Unity 1.1 Container Behavior for WCF

1 Comment »

Some time ago I needed a way to wire up an IoC container in a WCF service I was creating at that time. Since I’ve used ObjectBuilder-based containers a lot in both Composite UI Application Block and Enterprise Library, I wanted to take a closer look at the Unity container and the 2.0 version of ObjectBuilder.

To manage the creation of service instances, you have to implement the IInstanceProvider interface, and wire up the concrete type in a service behavior.

The code should be fairly documented, and a simple xUnit.NET test project is included. If you want to check out xUnit.NET, check out its CodePlex site.

I’ve put the code on a new resource page on code.msdn.microsoft.com that I have created WCF Resources. You can find the release here.


Fresh start

No Comments »

Ok, I’ve bought some wordpress.com credits and pointed one of my domains, larswilhelmsen.com to larsw.wordpress.com. To break the no-blogging spell, I hope that starting fresh on a new site will help to get my fingers moving :-)

Currently, I’m on paternity leave, and when I start working again, it will be for Miles, Norway as a senior consultant. I will mainly do Microsoft- and Agile-related work and I am really looking forward to start.

While I’m away from work, I try to help out as much as I can in the Windows Communication Foundation (“Indigo”) MSDN Forum. If you have any questions regarding WCF, feel free to post in the group, or send me an e-mail.

In this blog I will mainly focus on Connected Systems; SOA/WCF, Smart Clients (including CAB/SCSF), synchronization and Live Mesh – when the API’s are out.

Wish me luck :-)

–larsw