Package com.google.appengine.api.xmpp

Examples of com.google.appengine.api.xmpp.MessageBuilder.asXml()


            throw new RuntimeException("You have to choose between XML and text bodies, you can't have both!");
        }

        // sets the body of the message
        if (msgAttr.containsKey(XML_BODY_ATTR)) {
            msgBuilder.asXml(true);
            Object xml = new StreamingMarkupBuilder().bind(msgAttr.get(XML_BODY_ATTR));
            msgBuilder.withBody(String.valueOf(xml));
        } else if (msgAttr.containsKey(TEXT_BODY_ATTR)) {
            msgBuilder.withBody(String.valueOf(msgAttr.get(TEXT_BODY_ATTR)));
        }
View Full Code Here


        builder.withMessageType(MessageType.valueOf("CHAT"));
        builder.withFromJid(fromJID);
        builder.withRecipientJids(toJID);
        String testBody = TEST_BODY + System.currentTimeMillis();
        builder.withBody(testBody);
        builder.asXml(false);
        Message msg = builder.build();

        SendResponse response = xmppService.sendMessage(msg);
        assertNotNull("expected a response", response);
        assertEquals(1, response.getStatusMap().size());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.