Intercept messages in a WCF Client

后端 未结 3 1829
小蘑菇
小蘑菇 2020-12-10 19:03

Has anyone got any experience with Web Service Extensions? I spent time trying to make a web service extension from the MS examples.

I have an .net 3.5 web service

3条回答
  •  眼角桃花
    2020-12-10 19:32

    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.

提交回复
热议问题