php 肥皂信封命名空间 <soap:Envelope 和 <SOAP-ENV:Envelope [英] php soap envelope namespace <soap:Envelope and <SOAP-ENV:Envelope

查看:47
本文介绍了php 肥皂信封命名空间 <soap:Envelope 和 <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 肥皂信封命名空间 &lt;soap:Envelope 和 &lt;SOAP-ENV:Envelope的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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