我尝试从WCF消息中删除整个SOAP标头,只想离开信封体.任何人都可以告诉我怎么做到这一点?
像这样创建一个WCF消息:
**string response = "Hello World!";
Message msg = Message.CreateMessage(MessageVersion.Soap11, "*", new TextBodyWriter(response));
msg.Headers.Clear();**
Run Code Online (Sandbox Code Playgroud)
发送SOAP消息将是:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header />
<s:Body>
<Binary>Hello World!</Binary>
</s:Body>
</s:Envelope>
Run Code Online (Sandbox Code Playgroud)
但我不想要SOAP头元素,我只需要包络体.如何从WCF消息中删除头元素?