In WP7 Application Accessing a WCF SoapHeader when IncomingMessageHeaders is null

431 Views Asked by At

In an Windows Phone 7.5 application, In a call to a wcf service I used the MessageIncomingHeaders property [code just below] to retrieve Message Soap Headers with my OperationContext, but the IncomingMessageHeaders is null. The service response is OK because I I can access the logs server response.

 using (OperationContextScope scope = new OperationContextScope((IContextChannel)client.InnerChannel))
            {
              MessageHeader myheader = MessageHeader.CreateHeader(....);
              OperationContext.Current.OutgoingMessageHeaders.Add(myheader);
               client.InfoAsync(request);
               client.InfoCompleted += new EventHandler<InfoCompletedEventArgs>(Info_callBack);
            }

 void Info_callBack(object sender, InfoCompletedEventArgs e)
        {
using (OperationContextScope scope = new OperationContextScope((IContextChannel)client.InnerChannel))
{
 MessageHeaders headers=OperationContext.Current.IncomingMessageHeaders;
   }

.... How to retrieve a soap header from a response? IncomingMessageHeaders is null.

0

There are 0 best solutions below