php soap envelope namespace <soap:Envelope and <SOAP-ENV:Envelope

本秂侑毒 提交于 2019-12-12 17:18:36

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/18826463/php-soap-envelope-namespace-soapenvelope-and-soap-envenvelope

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!