Last post Aug 06, 2013 10:07 PM by Steven Cheng - MSFT
Jul 29, 2013 06:46 AM|Chithra_Iyer|LINK
In the WCF service which iam developing am using custom fault exception to throw an exception as below .
Now in the response only am getting only <s:envelope> , <s:body> and <s:fault>.
In the response i want to append Soap Header(<s:header>) also from the request .
How can i do that?
Please help me out
Jul 29, 2013 10:09 AM|kushalrdalal|LINK
Check this links-
Aug 06, 2013 10:07 PM|Steven Cheng - MSFT|LINK
The WCF FaultException (and FaultContract) data are all encapsulated via some certain fragment within the SOAP body (for SOAP XML format message). Therefore, it's not quite straightforward to add custom message headers for your SOAP Fault response. One method
I can think is using custom message inspector. You can use message inspector to intercept the response message and check if it is a fault message. If it is a fault message, you can try adding some custom message headers into the outgoing response message.
Here are some web reference about programmtically add message headers in WCF service (including using message inspector):
#Adding Custom Message Headers to a WCF Service using Inspectors & Behaviors
#Add Custom Message Header in WCF 4 Calls