"xmlns:xmpp" & "xmpp:xmlns" What is the Difference?
This one works Ok.
curl -H 'Content-Type: application/xml' -d " &开发者_开发问答lt;body rid='2965554435' xmlns='http://jabber.o=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh' /> " https://dashboard.onsip.com/http-bind
this one was returning an empty response
curl -H 'Content-Type: application/xml' -d " <body rid='2965554435' xmlns='http://jabber.o=utf-8' ver='1.6' xmpp:version='1.0' xmpp:xmlns='urn:xmpp:xbosh' /> " https://dashboard.onsip.com/http-bind
what is the difference ? and is the second one is appropriate to write so?
P.S. XHR xml is generated by OXJS library.
Only:
xmlns:xmpp='urn:xmpp:xbosh'
declares a namespace. The prefix xmlns:...
has a predefined meaning in XML With Namespaces, to bind use of the xmpp:...
prefix in the document.
This:
xmpp:xmlns='urn:xmpp:xbosh'
is not a namespace declaration, it's an attribute named xmlns
with the prefix xmpp
. The xmpp
prefix is not bound to any namespace in this document because there is no xmlns:xmpp
declaration and it is not a predefined prefix.
An XML With Namespaces parser will complain when it gets xmpp:...
attributes and there is no namespace declaration for xmpp
. This error will be why the web service is giving you no response.
精彩评论