SOAP/REST Webservices XML case sensitivity

2019-04-28 03:44发布

问题:

I just got a doubt whether the XMLs we are using for our SOAP/REST-based web services are case-sensitive or or not? How does it work exactly?

Tell me both for the default soap envelope as well as for payload XMLs.

回答1:

SOAP is a specific instance of an XML language.

As such, it adheres to all the rules of XML.

One of these rules is that XML is case-sensitive.

Therefore SOAP is case sensitive as well.

Same is true for REST



回答2:

XML is always case-sensitive; it's defined that way by the W3C (see the definition for “match” where it says that no case folding is performed). SOAP uses XML for both envelope and payload, so those are by definition case-sensitive.

(Note that this is different from HTML, which is case-insensitive for element and attribute names. That's because HTML is built on top of SGML, itself a much-more-complex predecessor to XML.)