Parsed packet doesn''t register

I’'ve been working on a SOAP transport over Jabber. I have a client working in which I can send out packets over the server. I see them leave the client via the Smack debugger. However, I cannot get my server to receive them.

I’'ve created a SoapPacket class which encapsulates the SOAP message and a SoapIQProvider class which creates SoapPackets. I did some logging and I can see that the my IQProvider is actually creating SoapPackets, but somehow they are never registering with my Listener.

The relavent code looks like this:

XMPPConnection.DEBUG_ENABLED = true;

conn = new XMPPConnection(server);

conn.login(username, password, “Echo”);

XFirePacketListener listener = new XFirePacketListener(getXFire(), conn);

conn.addPacketListener(listener, new ToContainsFilter(“xfireTestServer”));

The packet coming across the wire to my soap server looks like this:

<env:Envelope xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/”>

env:Header/

env:Body

<m:echo xmlns:m=“urn:Echo”>

<m:in0>Yo Yo</m:in0>

</m:echo>

</env:Body>

</env:Envelope>

It shows up both in the sent packets from the client and the “raw received packets” from the server, but somehow never shows under the main “All packets” window of the debugger.

I am very new to jabber so I could have some fundamentals down wrong and this is probably a real simple error :-). If you’'re interested in seeing all of the code, it is here:

http://cvs.xfire.codehaus.org/viewrep/xfire/xfire/xfire-xmpp

Thanks!

Ok, if I understand correctly (and I’'m not 100% sure I do):

The listener is listening for packets recievied by the client.

I think you’'ve got the wrong address in the ToContainsFilter - try:

conn.addPacketListener(listener, new ToContainsFilter("xfireTestClient"));

and then the client sould respond when it recieves the reply from the server (assuming one is sent).

HTH,

Pheet

Sorry if that wasn’'t clear. That code is on the server side listening for an IQ from the client. So it should be addressed to “xfireTestServer”.

Ah, sorry, my mistake.

Are you adding the listener before logging in?

I don’'t know if the ToContainsFilter is case-sensitive or not, maybe try everything (the client login and the ToContainsFilter) in lowercase.

To be honest I’‘m guessing here. If I get time I’'ll download the source and have a play.

Pheet

Message was edited by:

Pheet

Yes, I am adding the listener before I log in. I’'ve also tried changing the case of the To filter.

The real odd thing about this is that I see the packet on the raw incoming stream, but it just doesn’'t show under the list of packets in the debugger. Maybe it is a problem with my IQProvider?

http://cvs.xfire.codehaus.org/viewrep/xfire/xfire/xfire-xmpp/src/main/org/codeha us/xfire/xmpp/SoapIQProvider.java?r=1.1

Thanks for the guesses!

Dan

Turns out I was parsing beyond where I should with the PullParser. I was ending at the element instead of the soap . sigh… Thanks for your help though!