You'll need to create a special header class to output the soap XML to match the required structure. Look at this blog post for the code you need to implement.
Basically, you need to create the class to output the required XML and then use that class as follows:
// %< snipped >%
var specialHeader = GovMsgHeader.CreateHeader( /* any parameters */ );
request.Headers.Add(specialHeader);
// %< snipped >%
The special class would look something like this:
public class GovMsgHeader : MessageHeader {
protected override void OnWriteStartHeader(
System.Xml.XmlDictionaryWriter writer,
MessageVersion messageVersion) {
base.OnWriteStartHeader(writer, messageVersion);
// Write your custom XML using the XmlDictionaryClass:
//TODO: add the 'param' XML namespace to the writer...
//TODO: add the container element with something like this:
writer.WriteElementString("SaglikNetParameters", "param", "");
writer.WriteElementString("parameter", "param", "2");
writer.WriteAttributeString("name", "", "islemKodu");
//TODO: complete the rest of the XML ...
}
}