Custom message headers in WCF on Mono
- by TheNextman
I'm making WCF calls from a Mono client running on Ubuntu (Mono 2.6).
I can't seem to add a custom header to my messages. I have tried two different ways:
Using a [MessageContract] and [MessageHeader] attributes on a custom class
Adding the header to the outgoing messages programmatically, e.g.
MessageHeader mhg = new MessageHeader("test");
MessageHeader untyped = mhg.GetUntypedHeader("token", "ns");
OperationContext.Current.OutgoingMessageHeaders.Add(untyped);
The header is not there when the call reaches the server! It's always null.
Note that both methods work fine running on .NET in Windows. Also note that the message body gets through just fine on Mono.
I see some references online that suggest this should work:
http://forums.monotouch.net/yaf_postsm1692.aspx
https://bugzilla.novell.com/show_bug.cgi?id=551745
Also - the Mono status page shows that all the MessageHeader stuff is fully implemented...
Anyone had luck with this?
Thanks in advance, Richard