On Wed, Jun 4, 2008 at 11:21 AM, Nishant Joshi <[EMAIL PROTECTED]> wrote:
> Thanks Ant, > I have composed client for WS Here is the snippet of the client.... > > > ------------------------------------------------------------------------------------------------------------------------- > > public class HelloWorldClientImpl { > > @Reference > protected HelloWorldService serviceA; > > public String sayHello(String name) { > System.out.println("HelloWorldClientImpl.serviceA = "+serviceA); > return serviceA.sayHello(name); > } > > } > > ------------------------------------------------------------------------------------------------------------------------- > @Remotable > public interface HelloWorldService { > String sayHello(String name); > } > > > ------------------------------------------------------------------------------------------------------------------------- > public class JMSClient { > public static void main(String[] args) throws NodeException { > SCANode node = SCANodeFactory.createNodeWithComposite("client.composite"); > HelloWorldClientImpl client = > node.getDomain().getService(HelloWorldClientImpl.class, > "HelloWorldClient"); > > System.out.println(client.sayHello("World")); > } > > } > > > ------------------------------------------------------------------------------------------------------------------------- > > <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" > name="RPCComposite"> > > <component name="HelloWorldClient"> > <implementation.java class="helloworld.HelloWorldClientImpl"/> > <reference name="serviceA" /> > </component> > > <reference name="serviceA" promote="HelloWorldClient/serviceA"> > <interface.java interface="helloworld.HelloWorldService" /> > <binding.jms > initialContextFactory="com.ibm.websphere.naming.WsnInitialContextFactory" > jndiURL="iiop://localhost:2809"> > <destination name="HelloWorldService"/> > <response> > <destination name="HelloWorldService"/> > </response> > </binding.jms> > </reference> > </composite> > > ------------------------------------------------------------------------------------------------------------------------- > jndi.properties > > # START SNIPPET: jndi > > java.naming.factory.initial = > com.ibm.websphere.naming.WsnInitialContextFactory > > # use the following property to configure the default connector > java.naming.provider.url = vm://localhost?broker.persistent=false > > # use the following property to specify the JNDI name the connection > factory > # should appear as. > #connectionFactoryNames = connectionFactory, queueConnectionFactory, > topicConnectionFactry > connectionFactoryNames = ConnectionFactory > > # register some queues in JNDI using the form > # queue.[jndiName] = [physicalName] > # queue.RequestQueue = RequestQueue > # queue.ResponseQueue = ResponseQueue > queue.HelloWorldService = HelloWorldService > > # register some topics in JNDI using the form > # topic.[jndiName] = [physicalName] > #topic.MyTopic = example.MyTopic > > # END SNIPPET: jndi > > > Here Service is deployed successfuly, i can test with hello.jsp....It was > working fine in WS. > Now when i run above code I m getting "HelloWorldClientImpl.serviceA = > null" > and gettign NPE.... > I m using "HelloWorldService" for both Request and Response queue... > > any idea ? > > Thanks > Nishant Joshi I'll give it a try but it will take a while as I'm still recovering from a harddrive crash last week so will need to find and reinstall WebSphere. Anyone else with WAS installed able to give this a try in the meantime with the helloworld-jms-webapp sample? ...ant