Background:
I have implemented one to one chat using aSmack for XMPP on Android. I am also able to send and receive IQ messages.
The issue is:
I am unable to send and receive custom IQ messages. for example if i want to send an IQ
<iq type='get'
to='ssmack@web.mystudios.com/mack'>
<query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>
aSmack works fine for this IQ as it is not custom, but if i change the name space
here from disco#items
to Match
it will not work it will send back server a response stating
<error code='503'
type='cancel'>
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
and this response is send from my client. but i tried to debug it, i put break points on all receiving and sending packets code. but it does not enter there.
My code for receiving packet is:
connection.addPacketListener(new PacketListener() {
@Override
public void processPacket(Packet p) {
// TODO Auto-generated method stub
String fromName1 = StringUtils.parseBareAddress(p.getFrom());
Log.i("XMPPClient", "Got text [" + p.toXML() + "] from [" + fromName1 + "]");
m1=p.getFrom();
mHandler.post(new Runnable() {
public void run() {
setListAdapter();
recieve.setText(m1);
}
});
I guess i need to add some listeners to get the custom response. can somebody guide me through that?