1
我想知道如何在发送错误的WCF请求时WCF返回错误之前捕获异常(日志请求url)。在WCF终止客户端请求之前挂钩到WCF
例如,我使用Fiddler使用以下一个错误的操作元件来发布WCF请求:
<a:Action s:mustUnderstand="1">http://www.xxx.com/Wrong</a:Action>
WCF服务返回错误以下客户端和终止请求。如何捕获请求url,在WCF终止它之前捕获异常。
异常来自WCF返回:
http://www.w3.org/2005/08/addressing/faulturn:uuid:872ca27f-24c8-4855-8739-e36bd1d921e71e67f1d2-7550-4c41-88cf-acdf8ebd6bd4s:Sendera:ActionNotSupportedThe message with Action 'http://www.xxx.com/Wrong' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.xxx.com/Wrong</a:Action>
</a:ReplyTo>
<a:To s:mustUnderstand="1">http://www.xxx.com/Service.svc</a:To>
</s:Header>
</s:Envelope>
请注意,当我使用小提琴手,实际请求的URL可以是不同的,从一个用要的元素。
感谢您的意见。我会尝试并更新我的结果。 – Pingpong 2012-02-02 17:27:52