I have two Java programs - a server and a client, communicating using XMPP. The server program fetches data from a database and packages that data into an XML structure.
The server program prepares an XMPP message with the XML structure as message body. XMPP message is then sent to the client program.
Both the server and client programs use Smack library to send/receive XMPP messages.
When JabberD 1.4.x is used as the XMPP server, XML message body is correctly passed from the server program to the client program.
However, when Jive Messenger is used for XMPPP server, the last character in the XML structure (">") is removed.
Client program receives the message without the last “>”.
Example:
Server program constructs the following XML
*
<ID value = ‘‘1’’ ApplicationID = ‘‘AA1’’ ApplicantName = ‘‘User1’’/>
When Jive Messenger is used as XMPP sever, the client program receives following XML
*
<ID value = ‘‘1’’ ApplicationID = ‘‘AA1’’ ApplicantName = ‘‘User1’’/>
</Data*
With JabberD 1.4.2 as XMPP server, the client program is receiving complete XML.
I’‘d like to reproduce to problem so I can fix it. Could you post the complete packet that when a client sends to the server the other client doesn’'t receive it completely?
Any hint you can give me to reproduce the problem will be greatly appreciated.
This is not a valid XMPP packet. Valid XMPP packets are message, presence, or IQ. If you include a packet extension, it must be in it’'s own namespace. So, you could have the following:
<ID value = ‘‘1’’ ApplicationID = ‘‘AA1’’
ApplicantName = ‘‘User1’’/>
I tried the above and it worked perfectly in my test environment. Can you include the full packet you’'re trying to send back and forth?
Thanks, this gives us something to test. However, the way you’‘re sending XML isn’‘t the “proper” way according to XMPP. What you should do instead is add a packet extension – this will add XML to the message’‘s own XML instead of escaping the XML as part of the message body. We’'ll let you know what we find from testing.