Hi,
I’m trying to use JBosh to implement the XMPP over BOSH.
Sample code is as follows:
Scenario Type 1
BOSHClientConfig cfg;
// try block starts here…
cfg = BOSHClientConfig.Builder.create(
new URI(“http://jwa.cisco.com/httpbinding”), “example.com”).setFrom("jwtest0@example.com").build();
BOSHClient client = BOSHClient.create(cfg);
// other logic flows here…
ComposableBody cb = ComposableBody.builder().setPayloadXML("").build(); //This works fine and the status code is 200 OK
client.send(cb);
// catch blocks here…
**
**
Request in string:
Response in string:
DIGEST-MD5PLAINScenario Type 2
BOSHClientConfig cfg;
// try block starts here…
cfg = BOSHClientConfig.Builder.create(
new URI(“http://jwa.cisco.com/httpbinding”), “example.com”).setFrom("jwtest0@example.com").build();
BOSHClient client = BOSHClient.create(cfg);
// other logic flows here…
String reqXML = "<message to='jwtest1@example.com' type='chat' xml:lang='en'><body>Hello World...</body></message>";
ComposableBody cb = ComposableBody.builder().setPayloadXML(reqXML).build(); //Here, I’m getting 404 error…
client.send(cb);
//catch blocks here…
Request in string:
Hello World...Response in string:
Hello World... Inside connectionEvent...com.kenai.jbosh.BOSHException: Could not parse body: Not FoundNot Found com.kenai.jbosh.BOSHException: Could not parse body: Not FoundNot Found at com.kenai.jbosh.BodyParserXmlPull.parse(BodyParserXmlPull.java:132) at com.kenai.jbosh.StaticBody.fromString(StaticBody.java:114) at com.kenai.jbosh.XLightWebResponse.awaitResponse(XLightWebResponse.java:195) at com.kenai.jbosh.XLightWebResponse.getBody(XLightWebResponse.java:166) at com.kenai.jbosh.BOSHClient.processExchange(BOSHClient.java:1031) at com.kenai.jbosh.BOSHClient.processMessages(BOSHClient.java:976) at com.kenai.jbosh.BOSHClient.access$000(BOSHClient.java:97) at com.kenai.jbosh.BOSHClient$1.run(BOSHClient.java:215) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.IllegalStateException: Root element was not 'body' in the '[http://jabber.org/protocol/httpbind](http://jabber.org/protocol/httpbind)' namespace. (Was 'html' in '') at com.kenai.jbosh.BodyParserXmlPull.parse(BodyParserXmlPull.java:96) ... 8 moreWhen I check the response status, I could find 404 NOT FOUND error is occuring.
Could someone please let me know how to get rid of the issue?
Thanks,
Jaya Krishna