You should be able to use the OperationContext for the current client channel that you want to work with:
using(var scope = new OperationContextScope(_client.InnerChannel)){
Now that you have the operation context created for your client channel, you can add the headers of outgoing messages:
using(var scope = new OperationContextScope(_client.InnerChannel)){ var header = MessageHeader.CreateHeader("x-client-type", "http://www.myapp.com", "WP8"); OperationContext.Current.OutgoingMessageHeaders.Add(header);
After that, you can get the header using the IncomingMessageHeaders property for OperationContext.Current .
These are all basic parts of WCF services, so they should be available (hopefully).
Mono has support for WCF services, but you will need to verify that they have implemented. EG: Perhaps they don't have MessageHeader.Create , and you will need to use var header = new MessageHeader<string>("x-client-type"); and var untypedHeader = header.GetUntypedHeader("x-client-type", "http://www.myapp.com"); instead, to create your own title to add.
Justin
source share