This post explains main steps which required to configure WSO2 ESB with XMPP transport support. For this I am using Openfire, Instant Messaging chat server that implements the XMPP protocol. Here I am working on Linux OS and you have to change commands according to your OS.
- First you can download openfire from the following link.
- Then Extract the openfire distribution and go to the folder "openfire/bin".
- Now you can run the openfire server using following command in command prompt./openfire start
- After that you can setup openfire. For that you have to use type following URL in your browser.
- With this setup you can add server settings including domain, database settings, Profile Settings, and Administrator Account. Following are the settings with my setup.Domain – localhostdatabase settings – Embedded databaseProfile Settings – DefaultAdministrator Account – Username: admin Password: admin
- Now the openfire setup is completed and if you want you can do any configuration changes by logging in to openfire admin console. (For this you need to restart openfire server)
- Lets configure ESB with XMPP transport by editing axis2 xml file in ESB. For this you have to add following configuration to ESB_HOME/repository/conf/axis2.xml (You need to change xmpp credentials according to xmpp your account)
<transportReceiver name="xmpp" class="org.apache.axis2.transport.xmpp.XMPPListener">
<parameter name="MyServer">
<parameter name="transport.xmpp.ServerUrl">localhost</parameter>
<parameter name="transport.xmpp.ServerAccountUserName">admin</parameter>
<parameter name="transport.xmpp.ServerAccountPassword">admin</parameter>
<parameter name="transport.xmpp.ServerType">transport.xmpp.ServerType.Jabber</parameter>
</parameter>
</transportReceiver>
<transportSender name="xmpp" class="org.apache.axis2.transport.xmpp.XMPPSender">
<parameter name="transport.xmpp.ServerUrl">localhost</parameter>
<parameter name="transport.xmpp.ServerAccountUserName">admin</parameter>
<parameter name="transport.xmpp.ServerAccountPassword">admin</parameter>
<parameter name="transport.xmpp.ServerType">transport.xmpp.ServerType.Jabber</parameter>
</transportSender>
- Then add smack-3.0.4.jar and smackx-3.0.4.jar libs to ESB_HOME/repository/components/lib folder.
- Thats all about initial configuration. Start the ESB server and check the status.
Good instructions, they are working for me but where to find example on the usage?
ReplyDeleteI would like to:
- intercept messages written in a chat room, transform them with an xslt and send as soap message
- Receive a soap message, unwrap the content and publish it on a char room.
thanks in advance
Vincenzo
Hi,
ReplyDeleteFirst of all sorry for the late reply. I wanted to share this post because it can be helpful if someone writing a carbon component which using xmpp as the transport medium for any purpose. These instruction not targeting any specific sample.But of course if you are interested you can write your own carbon components based on carbon platform and contribute to the community too.
Cheers,
Ranga.
Hi,
ReplyDeletethanks for the instructions!
So far I've set up a WSDL based proxy and could configure XMPP as a transport.
The endpoint looks like: xmpp://wso2@null/services/GlobalWeather
How to configure the correct server instead of "null"?
In openfire the ressource is shown as: wso2@robovm/soapserver326927531 such that I can send an IQ to that ressource but not to the WSo2 endpoint giving me an IQ reply with "feature-not-implemented".
Is there any possiblity to trace what's going on inside WSo2 when an XMPP arrives (if it really arrives?).
Another - not that important question - would be how to use the newest smack version 4.0?
Thanks,
Chris.