Matt Ruwe
Matt Ruwe

Reputation: 3406

How do I retrieve headers from WCF on the client

I have a WCF service that is adding headers to the response. I would like to know how to extract those headers on the client side.

Upvotes: 0

Views: 109

Answers (1)

Matt Ruwe
Matt Ruwe

Reputation: 3406

Found the answer:

http://msdn.microsoft.com/en-us/library/ms195389.aspx

MessageHeaders.GetHeader(Of T) Method (Int32)

For example, within a IClientMessageInspector using the reply object, you get it like so:

MyObject myObj = reply.Headers.GetHeader<MyObject>(index);

Upvotes: 1

Related Questions