How can i send a message from my plugin to my remote client?

Hi all!

I have created a plugin just for learning , i have a java client connecting to wildfire using Socket what i have achieved so far is

  1. using a user name registered with my wildfire i can login to wildfire (admin page shows my user as loged in)

  2. using my client i can send a message to my plugin registered as a component as MyBroadcast.

But when from my plugin I send message back to my client using

componentManager.sendPacket(this,message);

I cant get it on my client dont know y ? am i missing something here

here is my plugin’'s processPacket method

public void processPacket(Packet packet) {

System.out.println("==========>message from client "+packet.toXML());

JID from = packet.getFrom();

JID to = packet.getTo();

Message message = new Message();

message.setTo(from);

message.setFrom(to);

message.setBody("%%%%%%%%%%%%%%%%%%%%%%%%%Yahoo Message Received At Client%%%%%%%%%%%%%%%%%%%%%%");

try {

componentManager.sendPacket(this, message);

System.out.println("

Which doesn?t reach to my client I don?t know what I am doing wrong here please help me to get rid of this problem ASAP.

I’‘m having the same problem… Any idea is welcome, because I’'ve tried everything… When I remove my plugin Wildfire replies immediately with an error. My simplified code is:

public IQ handleIQ(IQ pacote) throws UnauthorizedException {

IQ resultIQ = IQ.createResultIQ(pacote);

Element elemPai = pacote.getChildElement().createCopy();

resultIQ.setChildElement(elemPai);

resultIQ.setError(PacketError.Condition.bad_request); // Returning error to simplify

return resultIQ;

}

Hello, Sajjad

Now that I have a good environment to develop for Wildfire, I debuged and discovered my problem, that can be the same the you are facing: in the “initialize” method of your plugin, you should call “super.initialize”.

Regards,

Rodrigo