A non empty setPayLoadXML is causing 404 issue, any inputs?


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-MD5PLAIN

Scenario 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 more

When 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

Have you solved the issue? I am planning to use Smack with jBosh in a project:

http://fisheye.igniterealtime.org/browse/smack/branches/bosh/smack-bosh/src/main /java/org/jivesoftware/smack

Hi Michael,

I could solve this issue by sending the authentication string in the following stanza. Later, I could establish the BOSH connection for my account and it was able to handle any IQ, Presence and Message stanzas.

I will take some time to go through your reference link and see if I get something to share with you.

Thanks,

Jaya Krishna