|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionThere is no doubt that .NET is much advanced than SWING, So if you need to make a Desktop application. Best Choice is .NET. Java has some advantages in different areas on server side, one of them is JMS. (Many people will not agree). I have tried to use the power of .NET as a client and integrated Java Webserices asynchronously with it, More over I have used JMS on webservices side to send messages to .NET client. Its just the beginning of a small framework which can be extended to make a full-fledged .NET, JMS interaction framework BackgroundI had a SWING client/JMS application in java. My other application was in .NET, which also needed to receive messages from the JMS. Technologies Used
How to run the application?The Java web service is made using JBuilderX and is tested on JBoss 3.x. To run the application you need to run in the applications in the following sequence
Architecture Diagram
Using the codeJava side codeNOTE: The code is not optimized and no design patterns are included in it. public String getJMSChatPublisher() {
JMSChatSubscriber jmsChatSubscriber = null;
jmsChatSubscriber = new JMSChatSubscriber();
return jmsChatSubscriber.getSynchronousMessage();
}
.NET side codeClient calls the webservice asynchronously using
public void RegisterJMS(NotifyMessage function)
{
em = new ReceiverWebServiceService ();
AsyncCallback cb = new AsyncCallback(ServiceCallback);
IAsyncResult ar = em.BegingetJMSChatPublisher(cb,em);
this.callFunction = function;
}
public void ServiceCallback(IAsyncResult ar)
{
string str = em.EndgetJMSChatPublisher(ar);
callFunction(str);
RegisterJMS(callFunction);
}
ConclusionI have not implemented or showed the following cases, as they are pretty straight forward.
Points of InterestThis application shows how we can receive messages from JMS to .NET Client, with out using any bridging technology, which is not only expensive but a big overhead. I am not a very good writer, so I hope everything will be understood by the architecture diagrams and code :) History01-14-2005:
|
||||||||||||||||||||||