Alert boxes are the standard way for debugging javascript but firefox allows printing to console using debug() function. This way we don't need to keep adding and removing alerts to the code.
For how to enable dump() function please see :
http://www.davekb.com/browse_programming_tips:firefox_dump:txt
Openfire act as a client for SynchronaWS. In the previous blog post i have explained how a client can be written using SAAJ client implementation method. when we dig more in to the details on client implementation we found that there are technologicaly more advance client side implemenations availale for webservices, those are JAXM and client implementation using AXIS2. i have explained the steps for implementing client using axis2 for Synchrona webservice.
create a dynamic webproject called SynchronaWebService
File - > new -> Other -> select web -> select dynamic webproject.
crealte packe stucture com.synchrona.communication and four classes Communication.java , Synchrona.java , Twitter.java and Bloger.java as in the following image.
(--
for creating dynamic webproject follow the following tutorial
http://24bytes.com/helloworlds/WebService/hellowebservice.html
--)
Make sure to use apache tomcat 6.0 and axis2 1.4 for tutorial Make sure to set Dynamic web module version to 2.4 Make sure to click on default configuration and select axis2 from the pop up window and apply the settings in the process of crating dynamic web project
Now you have created dynamic webproject !!!
----------------------------------------------------------------------------------------------------------------------------------------
next step is to convert it in to webservice.
File -> new -> other -> select webservices -> select webservice and clieck OK
in the pop up window set the following configuration details.
set the service implementation :- com.synchrona.communicaton.Communication check whether server is tomcat :- 6.0 check whether axis :- 1.4 check whether serviceProject - SynchronaWebService click on webservice runtime and select the option :- start axis before tomcat server
click next -> next -> ...
you will find a button to start server click on it and click finish.
Right Click on SynchronaWebService -> select run -> select run on server
Now You Have Created SynchronaWS !!!
you will get following out put on eclipse browser window
Click on Communication , you will get the wsdl file generated for your webservice.
http://localhost:8080/SynchronaWebService/services/Communication?wsdl
you will need if for creating client stubs.
----------------------------------------------------------------------------------------------------------------------------------------
Creating Stubs for SynchronaWS
start terminal
if you haven't set the $JAVA_HOME
type following command in the terminal
$export $JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.16
if you haven't set the $AXIS_HOME
type following command in the terminal
$export $AXIS_HOME=/home/kapila/Desktop/axis2-1.4.1
now follow the following steps to create client stubs
sh $AXIS2_HOME/bin/wsdl2java.sh -uri http://localhost:8080/SynchronaWebService/services/Communication?wsdl
-o SynchronaClient -u
kapila@kapila-laptop:~$ sh $AXIS2_HOME/bin/wsdl2java.sh -urigo to home folder and find the generated stub in SynchronaClient folder.
http://localhost:8080/SynchronaWebService/services/Communication?wsdl
-o SynchronaClient -u
Using AXIS2_HOME: /home/kapila/Desktop/axis2-1.4.1
Using JAVA_HOME: /usr/lib/jvm/java-6-sun-1.6.0.16
Retrieving document at 'http://localhost:8080/SynchronaWebService/services/Communication?wsdl'.
kapila@kapila-laptop:~$
Stub will be saved to a folder called SynchronaClient
before importing generated stubs in to openfire test it on simple java applicatoin as follows.
File -> new -> Other -> JavaPrject
name the project as SynchronaClientTester
copy the src folder in the stubs generated folder to the SynchronaClientTester folder.
Refresh the SynchronaClientTester project
you should get following output

right click on the SynchronaClientTester Package and add new class called Tester.java
YOU WILL GET BUNCH OF ERRORS
right click on SynchronaClientTester and select properties and select buildpath and select libraries tab and click on add external jars. add libraries which are there in AXIS2 lib folder in to SynchronaClientTester.
if you still get the errors , go to Project -> Clean -> select SynchronaClientTester and click clean
now put following code in to the class (just copy paste)
public static void main(String arg[]) {
try {
CommunicationStub sample1ServiceStub = new CommunicationStub();
sample1ServiceStub
._getServiceClient()
.getOptions()
.setProperty(Constants.Configuration.TRANSPORT_URL,
"http://localhost:8080/SynchronaWebService/services/Communication");
sample1ServiceStub._getServiceClient().getOptions().setProperty(
HTTPConstants.CHUNKED, Constants.VALUE_FALSE);
SynchronizeData syncData = new SynchronizeData();
syncData.setUpdate("Synchrona Test with new webservice");
SynchronizeDataResponse response = sample1ServiceStub
.synchronizeData(syncData);
System.out.println("Got param ==> " + response.get_return());
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
} catch (java.rmi.RemoteException e) {
e.printStackTrace();
}
}Tester class should look like follows

Run it and see the output
you will get following output on eclipse console , YOU HAVE DONE THE HARD PART !!!
WARN No appenders could be found for logger (org.apache.axis2.description.AxisService).
log4j:WARN Please initialize the log4j system properly.
Got param ==> Synchrona Test with new webservice
right click on motd package and select refactor and copy the package stuructur
org.jivesoftware.openfire.plugin
go back to SynchronClientTester and click on package and select refactor and paste the org.jivesoftware.openfire.plugin there. now SynchronaClientTester will get package structre similar to motd in openfire.
Copy copy and paste following classes in to motd package. YES DO IT
YOU WILL AGAIN GET BUNCH OF ERRORS!!!
now go to motd implementation folder and creae lib foder there
add all the libraries in axis2/lib folder in to that folder.
right click on project openfire -> select properties -> select build path -> select libraries -> click on add external jars -> all all the libraires that you put in to motd lib folder
affter this is done copy the code in inside Tester class in to MotdPlugin.java 's packetIntercepter method.
NOW EVERY THIS IS DONE!!!
you shoudl get a window as follows

Run -> External Tools -> motd
this will create motd jar in the following works folder of openfire project.
upload that jar to openfire server and enjoy!!!!
Synchrona System has three main subsystems named as SynchronaWS, Openfire extension and Browser plugin,
In this Blog post i have described how we crated the communication path between openfire server and webservice.
I took 2 main approches for creating client for a webservice, following is the tutorial which explains how to setup a Simple webserive and Clinet. But My focus was to develop a client which can act as a client for Synchrona WebService and also it can act as a plugin for Openfire Server.
When implementing client which handles soap mesages, all the tutorials you find in the web explains that clinet need to be running as a dynamic webservice , which in turn hilight the fact that clinet will be running on server such as tomcat or jboss or any other supporting server for WS. This fact rais the question of modeling the client implementation as a openfire plugin which has predefined structre for plugin development. This means that we should have some other way where it can run as a normal jara program without all of this servers and java libraries.
Solution we found was called SCCJClient. Client side of the openfire server is implemented according to the specification of SCCJClient
You can find more information on implementation of SCCJClinet form Here
...
Posted by Harini Sirisena | Posted on 10:47 AM
Category:
Synchrona will provide two main functions to its users.
Openfire which is an implementation of Extensible Messaging and Presence Protocol (XMPP), a set of open XML technologies for presence and real-time communication developed by the Jabber open-source community. What is IM gateway plug in and how it relates to openfire? These are the primary questions that comes first in to account, following gives primary objective of IM gateway plug-in and how IM gateway plug-in enhance functionality of openfire.
The IM Gateway plug-in for Openfire provides connectivity to other IM networks (AIM, ICQ, IRC, MSN, Yahoo, etc). Project synchrona is not aiming at providing the functionality with is provided by IM networks, it's major goal is to enhance the functionality or services of existing internet services through real time messaging and data synchronization among services. That is how synchrona is different form others. So what basic question is how IM gateways can help synchrona for achieving this objective. currently we can find IM gateways which are working well with Openfire and some are currently in developement. These existing and working IM gateways allow openfire to retrive a given users friend list , basically you will be able to see your friends in Facebook in opefire client like spark, samePlace.
IM gate way for twitter.
http://blog.wolfspelz.de/2008/09/twix-twitter-to-jabber-xmpp-gateway.html
IM gate way for facebook and MySpace
But for with these implementations synchrona will provide IM gate way plugin for moodle and blogger and many other services.