什么决定了 WCF WSDL 中 XML 属性的顺序? [英] What decides the order of XML attributes in WCF WSDL?

查看:29
本文介绍了什么决定了 WCF WSDL 中 XML 属性的顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之前也有人问过类似的问题,我理解在XML或schema中无法指定XML属性的顺序.但是,我想知道,WSDL 中XML 属性的顺序是WCF 随机生成的还是遵循一些规则.

Similar questions were asked by others before, and I understand that the order of XML attributes cannot be specified in XML or schema. However, I would like to know, whether the order of XML attributes in WSDL are randomly generated by WCF or they follow some rules.

例如,在一个阶段,我们在生成的 WSDL 中有以下(部分)XML 标记.

For example, at one stage we had the following (part of) XML tag in generated WSDL.

现在再次生成它成为

最小和最大的顺序交换.

with the order of min and max swapped.

另一个例子:

变成

只是想知道是什么决定了 WCF 中的这些订单?是否可以调整流程以保持相同的顺序,以便更轻松地比较两个 WSDL 文件?

Just wondering what decides such orders in WCF? Is it possible to have the process adjusted to keep the same orders to make comparing two WSDL files easier?

谢谢.

推荐答案

最后我决定使用 Xml Sorter (https://xmlsorter.codeplex.com/).在比较之前对 WSDL XML 文件进行排序,这样我可以立即发现 BeyondCompare 等中两个 WSDL 文件之间的差异,而不是慢慢向下滚动并试图从数百个差异中找出真正的差异(由于更改的 XML 属性顺序).

At the end I decided to use Xml Sorter (https://xmlsorter.codeplex.com/). WSDL XML files are sorted before comparing, this way I could immediately spot the difference between two WSDL files in BeyondCompare and alike, rather than slowly scrolling down and trying to spot real differences from hundreds of differences (due to changed XML attribute orders).

这篇关于什么决定了 WCF WSDL 中 XML 属性的顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆