0

I have following code

  [ServiceContract(Namespace = "http://www.myweb.com/prod")]
        public interface IBaseService
        {
    [OperationContract]
    public string GetName(IDMessageContract ID)
    }

    [ServiceContract(Namespace = "http://www.myweb.com/prod/child")]
        public interface IChildService : IBaseService
        {}

    public class BaseService 
        { public string GetName(IDMessageContract ID)}

    public class ChildService: IChildService 
        {}

    [MessageContract]
    public class IDMessageContract 
    {
      public string ID{get;set;}
    }

In above scenario I need the GetName method SOAP header containing the namespace "http://www.myweb.com/prod/child"

meetjaydeep
  • 1,752
  • 4
  • 25
  • 39

1 Answers1

0

If you need SOAP header with specified namespace you must specify that header in message contract and use its Namespace property. Something like:

[MessageContract]
public class IDMessageContract 
{
  [MessageHeader(Namespace="http://www.myweb.com/prod/child")]
  public string MyHeader { get; set;}
  [MessageBodyMember]
  public string ID{get;set;}
}
Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670