I'm in the unfortunate situation where I need to consume web services that do not have a contract defined, as per normal SOA practices. This means that I need to guard against changes in the web services that break my web references. In the past, breaking changes in new web services versions such as the alteration of enumeration values have caused difficult to debug failures.
I'm using Web References to access the web services. I'm mostly consuming ASMX end points.
The sensible way to guard against breaking changes seems to be to check the endpoint for each web service, ensuring that the WSDL defined for the service matches the current endpoint schema. I'd like to do this at build time, and possibly also upon the application start up. Preferably the check would only fail for breaking changes, meaning that the addition of new elements to the endpoint schema would be okay.
One way to do this would be to generate a temporary WSDL from the endpoint, and verify that each XML element in the existing WSDL is contained within the temporary WSDL. But this seems fiddly, and I wonder if there is existing tooling, or a better way of doing this.
Thanks for your help and suggestions.