AnsweredAssumed Answered

Problem in receiving streaminitialization(si) data in IQ packet using asmack android

Question asked by pooja mandir on Jan 14, 2016

          In my chat application I use following function for send file information in si tag in IQ which is done successfully,but on get response I don't get si tag in IQ packet instead of that client send me respond with  si tag in IQ packet like follow and for that I used asamck-android-19-0.8.10.jar library,


<iq xmlns="jabber:client" type="result" id="474BB437-B57B-4EC2-8066-88BF4DC02BAE" from="sender_id" to="receiver_id"><si xmlns="" id="A8905C1F-5217-4550-8BB2-92D28C8A2FD4"><feature xmlns=""><x xmlns="jabber:x:data" type="submit"><field var="stream-method"><value></value></field></x></feature><globalid>A8905C1F-5217-4550-8BB2-92D28C8A2FD4</gl obalid></si><globalid>A8905C1F-5217-4550-8BB2-92D28C8A2FD4</globalid></iq>


// My IQ which I get in response


<iq xmlns="jabber:client" type="result" id="474BB437-B57B-4EC2-8066-88BF4DC02BAE" from="sender_id" to="receiver_id">A8905C1F-5217-4550-8BB2-92D28C8A2FD4</iq>



//method which I used for file information send

public void sendfile(String filenm,String filereceiverid,int filesize,String myid)


        String onlyfilenm = " ";


                 StreamInitiation si = new StreamInitiation();


                 String filename=filenm.substring(filenm.lastIndexOf("/")+1);



                    StreamInitiation.File siFile = new StreamInitiation.File(filename,filesize);






                    si.setTo(filereceiverid + "" + filereceiverid);



                    UUID uuid = UUID.randomUUID();

                    String uuidInString = uuid.toString();



                    PacketCollector collector = connection

                            .createPacketCollector(new PacketIDFilter(si.getPacketID()));



//Here I get receiver response IQ


                    Packet siResponse = collector.nextResult(SmackConfiguration.getPacketReplyTimeout())                  


                    if (siResponse instanceof IQ) {


                        IQ iqResponse = (IQ) siResponse;

                        if (iqResponse.getType().equals(IQ.Type.RESULT)) {

                            StreamInitiation response = (StreamInitiation) siResponse;


                            System.out.println("response result" + iqResponse.toXML());


                            try {



                            } catch (XMPPException e) {

                                // TODO Auto-generated catch block


                                System.out.println("catch clause call of xmpp senfile method");



                        else if (iqResponse.getType().equals(IQ.Type.ERROR)) {

                            throw new XMPPException(iqResponse.getError());



                        else {

                            throw new XMPPException("File transfer response unreadable");





          How I solve this problem , can anyone help me?