Hi,
I have written a service with interface,
public interface Sender
{
    public int send(String msg, String queueName);
}

I have implemented it as
package Sender_pkg;

import javax.jms.*;
import javax.naming.*;

public class msr implements Sender_pkg.Sender
{
    public int send(String msg, String queueName)
    {
        Context jndiContext = null;
        QueueConnectionFactory qcFactory = null;
        QueueConnection conn = null;
        QueueSession session = null;
        QueueSender sender = null;
        Queue monitorQueue = null; 

        try
        {
            // Create JNDI context
            jndiContext = new InitialContext();
            // Create JNDI context
            jndiContext = new InitialContext();

            // Look up connection factory and
monitor-queue-name
            qcFactory = (QueueConnectionFactory)
               
jndiContext.lookup("QueueConnectionFactory");
            monitorQueue = (Queue)
jndiContext.lookup(queueName);
  
            // Create connection, session, an
unidentified sender and a receiver
            conn = qcFactory.createQueueConnection();
            session = conn.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
            sender =
session.createSender(monitorQueue);

            // Hints for optimizing the message
            sender.setDisableMessageTimestamp(true);
            sender.setDisableMessageID(true);

            TextMessage stream =
session.createTextMessage();
            stream.setText(msg);
            sender.send(stream);
            conn.close();
        }
        catch(Exception e)
        {
            e.printStackTrace();
            return -1;
        }

        return 1;
    }
}

And deployed the service. But I couldn't view the
service, following "View" link on axis homepage at my
machine. When I reimplement msr.java as
package Sender_pkg;

public class msr implements Sender_pkg.Sender{
    public int send(java.lang.String in0,
java.lang.String in1) throws java.rmi.RemoteException
{
        return -3;
    }
}

service is getting visible. Is something wrong with my
using JMS code in implementation? I would appreciate
if anybody can help me. I need to send a series of JMS
messages over the execution of web service. If there
is an alternative design please mail me.

tia,
Srinivas


=====
I am not afraid of losing. But I don't like it.

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Reply via email to