public void sendMessage(MessageContext msgCtx, String targetAddress,
OutTransportInfo outTransportInfo) throws AxisFault {
XMPPConnection xmppConnection = null;
XMPPOutTransportInfo xmppOutTransportInfo = null;
XMPPConnectionFactory connectionFactory;
//if on client side,create connection to xmpp server
if(msgCtx.isServerSide()){
xmppOutTransportInfo = (XMPPOutTransportInfo)msgCtx.getProperty(org.apache.axis2.Constants.OUT_TRANSPORT_INFO);
connectionFactory = xmppOutTransportInfo.getConnectionFactory();
}else{
getConnectionDetailsFromClientOptions(msgCtx);
connectionFactory = defaultConnectionFactory;
}
synchronized (this) {
xmppConnection = connectionFactory.getXmppConnection();
if(xmppConnection == null){
connectionFactory.connect(serverCredentials);
xmppConnection = connectionFactory.getXmppConnection();
}
}
Message message = new Message();
Options options = msgCtx.getOptions();