powered by Jive Software

Gateway Interaction - How to register to Gateway

Everybody,

I am new to xiff and want to register for the Gateway Interaction.

How to send Iq format as below (JEP-0100 for Gateway registration).

thanks,

santhakumar

includes[/b]

import org.jivesoftware.xiff.data.register.RegisterExtension;

/i

to send the “get fields” request:[/b]

var regIQ:IQ = new IQ( “msn.example.jabber.org”, IQ.GET_TYPE, XMPPStanza.generateID(“reg_info_”),

“getRegistration_Fields_result”, this );

regIQ.from=_root.connection.username*"@"*_root.connection.server;

regIQ.addExtension(new RegisterExtension(regIQ.getNode()));

_root.connection.send( regIQ );

/i

to remove a gateway subscription:[/b]

var regIQ:IQ = new IQ( “msn.example.jabber.org”, IQ.SET_TYPE, XMPPStanza.generateID(“reg_info_”),

“removeRegistration_Fields_result”, this );

regIQ.from=_root.connection.username*"@"*_root.connection.server;

var re:RegisterExtension=new RegisterExtension(regIQ.getNode());

re.unregister=true;

regIQ.addExtension(re);

_root.connection.send( regIQ );

Callback function:[/b]

function getRegistration_Fields_result( resultIQ:IQ ):Void

{

var ext:RegisterExtension = resultIQ.getAllExtensionsByNS(RegisterExtension.NS)[0];

//DRAW THE FORM HERE

}

/i

to send the iq to register:[/b]

var fields=msg.getRequiredFieldNames();

var regIQ:IQ = new IQ(from, IQ.SET_TYPE, XMPPStanza.generateID(“reg_attempt_”), “sendRegistrationFields_result”,

_root.connection );

var ext:RegisterExtension = new RegisterExtension(regIQ.getNode());

for(i=0;i<fields.length;i++){

myField=fields[i];//Field name

myData=“YOURDATA”;

ext[myField] = ;

}

regIQ.addExtension(ext);

_root.connection.send( regIQ );

/i