Add element without namespace in smack message

為{幸葍}努か 提交于 2019-12-11 04:24:02

问题


I wants to add node element in smack Message .

Eg. <myID> is the custom tag which i wants to add in message. like below structure

<message to='username@domain' id='12345'><body>Hello</body><myID>33e6cf03-90aa-4281-a36e-902ccdf0657f</myID></message>

What i tried so far By creating CustomExtension by implementing DefaultExtensionElement but here its creating message with some namespace specified.

<message to='username@domain' id='12345'><body>Hello</body><myID xmlns='somenamespace'>33e6cf03-90aa-4281-a36e-902ccdf0657f</myID></message>

But i wants to add without namespace as a element.

Any help ?

I checked already asked and answered questions but all are with namespace.


回答1:


XMPP expects you to qualify custom extensions with a namespace. That's why Smack doesn't make it easy to work around that requirement.



来源:https://stackoverflow.com/questions/40512507/add-element-without-namespace-in-smack-message

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