Intercept messages in a WCF Client

帅比萌擦擦* 提交于 2019-11-28 00:17:19

John is right, you can intercept the messages on the client using a custom client behavior that implements IClientMessageInspector. See How To: Inspect or Modify Messages on the Client on MSDN.

The only thing 'tricky' about it is that if you plan on modifying the message body then you will need to create a copy of the original message first. See Using the Message Class for the gooey details.

Chances are you want to get some rest.

You don't ever want to use WSE. WSE is obsolete.

You don't want to be using ASMX Web Services - Microsoft now considers them to be "legacy" technology, and will not be fixing bugs. BTW, WSE is based on ASMX, so what's that make it?


You only want to work with Windows Communication Foundation. The WCF Development Center on MSDN is at http://msdn.microsoft.com/wcf/.

Have fun, and stay away from the nasty, ancient, obsolete stuff.

Yup - I was too tired.

I think the Web Service Extensions work with "Web references" (.net 2), not "Service references" (.net 3).

So I guess to alter my question - how do I intercept the request and response for a .net 3 "Service reference" connected to a legacy web service?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!