XML/WSDL Comparison tool

前端 未结 3 2002
情歌与酒
情歌与酒 2021-02-02 14:06

There is no surprise for those who work with web-services a lot that they get updated from time to time. And you always need to track changes of these updates.

In my par

3条回答
  •  佛祖请我去吃肉
    2021-02-02 14:17

    The raised question is actually very common for any system that is built on top of SOA. You typically have a few consumers for a WSDL, or a few services that use the same WSDL, and now that WSDL needs to be updated.

    • Do we have to update all clients and server at the same time (that is expensive!)
    • If we do a staged deployment, what operations in the WSDL are affected (broken) if the updated client calls a non-updated service?
    • And other way around, can some clients be updated later?
    • How the XML structure changes? Can those changes be tolerated by some parsers (for example, some parsers do not break if they find a new element in the end of the sequence, but do break if it is found in the middle).

    And no, neither diff for WSDL nor diff for generated XML can reliably help.

    In addition to schema changes, WSDL can change the way the payload is structured (body/header), encoding/qualification, SOAP Action, binding properties - any of which can cause the loss of interoperability.

    To make things even more tricky, some types of changes made in input break the "updated to old" scenario, while in the output they should be considered non-breaking. For instance, a new optional element in request would break the old service if passed, but the same element in response will not be generated by the old service (because it doesn't know about it), and the element lack will be tolerated by the updated client because the element is optional.

    My team faces these tasks roughty once a week. Up until recently we did a manual diff of the WSDL/schema files and tried to figure out the impact. Sometimes it is obvious, but sometimes our approach led to mistakes. We needed a better way.

    Membrane SOA was some help. Unfortunately, in some occasions it fails to detect the changes in schema, erroneously reporting an operation as not impacted, while in fact it is broken. It is also not immediately clear from the output what scenario ("old to updated" or "updated to old") is reported.

    So after a couple of years of pain I had to write my own code that answers the questions above in a way I can directly provide to our BAs/PMs as supporting documentation for the impact assessment.

    See here: https://wsdldiff.mockmotor.com/

    1. Upload your WSDL and schemas:

    Upload WSDLs

    1. The service will give you the impact summary: are the changes breaking, and what deployment scenario will be affected:

    Upload WSDLs

    1. Each operation is marked as having a breaking or non-breaking change in both ports and bindings:

    Upload WSDLs

    1. You can take a look at the details of a breaking change (i.e. what schema/wsdl change causes it). Here for example a mandatory element was added into the middle of a sequence:

    Upload WSDLs

    That is not to say that one should blindly rely on tools such as this one, but it saves a lot of time when doing the impact assessment.

提交回复
热议问题