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
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?
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.
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.