<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6396.0">
<TITLE>RE: [JDEV] Formatting pt. 2 - JAJC</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Courier New">Ok, I *think* I'm getting close, but I get the SendMessageFailedException.</FONT>
<BR><FONT SIZE=2 FACE="Courier New">SendMessageFailedException.getLocalizedMessage() returns this: The element "message" could not be added as a child of "message": The element already has an existing parent (the document root)</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">--Code--</FONT>
<BR><FONT SIZE=2 FACE="Courier New">JabberChatMessage msg = new JabberChatMessage(JabberChatMessage.TYPE_CHAT);</FONT>
<BR><FONT SIZE=2 FACE="Courier New">msg.setTo(jabTo);</FONT>
<BR><FONT SIZE=2 FACE="Courier New">msg.setHTMLBody(message);</FONT>
<BR><FONT SIZE=2 FACE="Courier New">msg.setSynchronized(false);</FONT>
<BR><FONT SIZE=2 FACE="Courier New">jabberSession.sendMessage(msg);</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">Steven Cunningham</FONT>
<BR><FONT SIZE=2 FACE="Courier New">Database Management Group</FONT>
<BR><FONT SIZE=2 FACE="Courier New">Liberty Mutual</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Courier New">-----Original Message-----</FONT>
<BR><FONT SIZE=2 FACE="Courier New">From: Chris Chen [</FONT><A HREF="mailto:ckchris@idream.net"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">mailto:ckchris@idream.net</FONT></U></A><FONT SIZE=2 FACE="Courier New">] </FONT>
<BR><FONT SIZE=2 FACE="Courier New">Sent: Wednesday, August 13, 2003 4:00 PM</FONT>
<BR><FONT SIZE=2 FACE="Courier New">To: Cunningham, Steven</FONT>
<BR><FONT SIZE=2 FACE="Courier New">Subject: Re: [JDEV] Formatting pt. 2 - JAJC</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Courier New">Hi,</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier New">That is not how you utilize the jabber chat service's sendPrivateMessage().. You should read the javadocs for the method.</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">JabberChatService.sendPrivateMessage() accepts a recipient JID and the "body" of the message, NOT the XML representation of the message.</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">As I mentioned before, please read my previous post on how to send a chat message that contains HTML. I replied to your message yesterday.</FONT></P>
<P><FONT SIZE=2 FACE="Courier New">Thanks,</FONT>
<BR><FONT SIZE=2 FACE="Courier New">Chris</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Courier New">----- Original Message ----- </FONT>
<BR><FONT SIZE=2 FACE="Courier New">From: "Cunningham, Steven" <Steven.Cunningham@LibertyMutual.com></FONT>
<BR><FONT SIZE=2 FACE="Courier New">To: <jdev@jabber.org></FONT>
<BR><FONT SIZE=2 FACE="Courier New">Sent: Wednesday, August 13, 2003 12:35 PM</FONT>
<BR><FONT SIZE=2 FACE="Courier New">Subject: RE: [JDEV] Formatting pt. 2 - JAJC</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Courier New">> Can someone tell me if I'm doing this wrong?</FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> -- Java Code --</FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> String jabMessage = "<message><body>OMG, i'm green with</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> envy!</body><html xmlns='<A HREF="http://jabber.org/protocol/xhtml-im'">http://jabber.org/protocol/xhtml-im'</A>><body><p</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> style='font-size:large'>OMG, i'm <span </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> style='color:green'>green</span> with </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> <em>envy</em>!</p></body></html></message>";</FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> JabberChatService chat = jabberSession.getChatService();</FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> chat.sendPrivateMessage(to, message);</FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> -- End Java Code --</FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Steven Cunningham</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Database Management Group</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Liberty Mutual</FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> -----Original Message-----</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> From: David 'TheRaven' Chisnall [</FONT><A HREF="mailto:theraven@sucs.org"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">mailto:theraven@sucs.org</FONT></U></A><FONT SIZE=2 FACE="Courier New">]</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Sent: Wednesday, August 13, 2003 11:41 AM</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> To: jdev@jabber.org</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Subject: Re: [JDEV] Formatting pt. 2 - JAJC</FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> JAJC does support some form of XHTML, although it claims to be <html</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> xmlns="<A HREF="http://www.w3.org/TR/xhtml-basic">http://www.w3.org/TR/xhtml-basic</A>">, rather than the recommended </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> <html xmlns="<A HREF="http://jabber.org/protocol/xhtml-im">http://jabber.org/protocol/xhtml-im</A>"> from JEP-71, so I </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> don't know how compatible it is with other implementations.</FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Cunningham, Steven wrote:</FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> > Formatting pt. 2 - JAJC</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> ></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> > I got responses on formatting messages with the Exodous client, but</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> > it seems that it's not possible.</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> ></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> > Now I'd like to ask how/if it's possible to do so with the JAJC</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> > client?</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> ></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> > * Steven Cunningham *</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> > Database Management Group</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> > Liberty Mutual</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> ></FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> _______________________________________________</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> jdev mailing list</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> jdev@jabber.org</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT><A HREF="http://mailman.jabber.org/listinfo/jdev"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">http://mailman.jabber.org/listinfo/jdev</FONT></U></A>
<BR><FONT SIZE=2 FACE="Courier New">> _______________________________________________</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> jdev mailing list</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> jdev@jabber.org</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT><A HREF="http://mailman.jabber.org/listinfo/jdev"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">http://mailman.jabber.org/listinfo/jdev</FONT></U></A>
<BR><FONT SIZE=2 FACE="Courier New">></FONT>
</P>
<BR>
<BR>
<BR>
<P><B><FONT COLOR="#000080" SIZE=2 FACE="Arial">Steven Cunningham</FONT></B>
<BR><FONT COLOR="#808080" SIZE=2 FACE="Verdana">Database Management Group</FONT>
<BR><FONT COLOR="#808080" SIZE=2 FACE="Verdana">Liberty Mutual</FONT>
</P>
</BODY>
</HTML>