views:

81

answers:

1

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.

A: 

Check this question - it was asked for the same purpose. Mind you that service compatibility is a tricky issue and comparing even WSDL would only mean that you are guarding against syntactical changes. There is no way to detect semantical changes in service contract/implementation - only correct way would service offers versioning and then providing method to see if client is version compatible or not.

VinayC
Ah, so the answers they come to there are pretty much my proposed solution - create a WSDL from the endpoint, and compare it to your existing WSDL. Useful to know that there is an MS tool for comparing XML.I agree with your comments about semantic changes. But I'm in a position where I can do nothing but check for syntactic change, and count on the testers to pick up semantic change. I don't have the power to influence web service development.Thanks.
SamStephens