i am using webHttpBinding to expose the wcf serivces and return JSON format, i want to make some security authentication in header like:
CustomerServiceClient client = new CustomerServiceClient();
using (OperationContextScope scope = new OperationContextScope(client.InnerChannel))
{
MessageHeader header = MessageHeader.CreateHeader("username", "http://tempuri.org", "testuser");
OperationContext.Current.OutgoingMessageHeaders.Add(header);
}
but i got this error message: Envelope Version 'EnvelopeNone (http://schemas.microsoft.com/ws/2005/05/envelope/none)' does not support adding Message Headers.
i google long time but no result for me.
thanks.