Maybe this is a well known, or even documented issue, but I’m jotting it down so I don’t forget it -
If you have a reference set to Microsoft Web Service Enhancments (WSE 2.0), and you add a web reference to a project in VS.NET, by default the proxy class will inherit from Microsoft.Web.Services2.WebServicesClientProtocol. This is so that you get the WSE 2.0 Enhancements.
However, by default, the URL Behavior is set to “static”, which means the URL is hardcoded in the proxy…
But this is not too handy for moving things between dev / test / production. But VS lets you change the URL Behavior to “Dynamic”
It re-creates the proxy class when you do this. Only now, it inherits from System.Web.Services.Protocols.SoapHttpClientProtocol, which is not what you wanted. (Because you’re doing something with SOAP Attachements or other WSE niceties).
Anyhow, you can solve this problem by right-clicking on the web reference in the Solution Explorer, and selecting “Update Web Reference”, which will respect both the WSE2 and the URL Behavior. Just remember to do this after you select dynamic, otherwise you code blows up all over the place.