php 肥皂信封命名空间 <soap:Envelope 和 <SOAP-ENV:Envelope [英] php soap envelope namespace <soap:Envelope and <SOAP-ENV:Envelope
问题描述
和
有什么区别
和
我该如何在它们之间切换?
如何更改 < 的响应?SOAP-ENV:Envelope 使用 <肥皂:信封?
没有区别.
XML 命名空间由 xmlns
属性引用作为它的值 ("http://schemas.xmlsoap.org/soap/envelope/"
),并且该引用的快捷方式紧跟在 xmlns
后面,在您的一种情况下是 soap
,在另一种情况下是 SOAP-ENV
.>
该快捷方式现在被一致用作 XML 命名空间中定义的元素的前缀.由于元素
与定义的命名空间"http://schemas.xmlsoap.org/soap/envelope/"
的连接,它的特殊含义是底层 XML 解析器已知.
快捷方式可以是任何允许的字符串 - 只要给出了正确的命名空间 URL,XML 解析器就无关紧要.
我猜你有一个潜在的问题,让你认为命名空间很重要 - 你应该在你的问题中解释那个问题,或者可能会问一个新的问题.
What is the difference between
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" ...>
and
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ...>
and how can I switch between them?
How can I change the response from < SOAP-ENV:Envelope to use < soap:Envelope ?
There is no difference.
The XML namespace is referenced by the xmlns
attribute as it's value ("http://schemas.xmlsoap.org/soap/envelope/"
), and the shortcut to that reference is following right behind the xmlns
, which is soap
in your one case, and SOAP-ENV
in the other.
That shortcut is now being used consistently as the prefix to the elements that are defined in the XML namespace. Because of the connection of the element <Envelope>
with the defined namespace "http://schemas.xmlsoap.org/soap/envelope/"
, it's special meaning is known to the underlying XML parser.
The shortcut can be any allowed string - it does not matter to the XML parser as long as the correct namespace URL has been given.
I guess you have an underlying problem that makes you think that the namespace matters - you should rather explain THAT problem in your question, or probably ask a new one instead.
这篇关于php 肥皂信封命名空间 <soap:Envelope 和 <SOAP-ENV:Envelope的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!