2 Replies Latest reply on Oct 19, 2007 9:59 AM by tobysaville

    SOAPClient Issues

    tobysaville

      Hello,

      I want to perform an integration test of my service which includes a SOAPClient action. However, when i call the initialise method of the SOAPClient, i get the following exception:

      java.util.NoSuchElementException
       at java.util.AbstractList$Itr.next(AbstractList.java:427)
       at org.jboss.mx.util.MBeanServerLocator.locate(MBeanServerLocator.java:79)
       at org.jboss.mx.util.MBeanServerLocator.locate(MBeanServerLocator.java:92)
       at org.jboss.soa.esb.actions.soap.SoapUIInvoker.<init>(SoapUIInvoker.java:45)
       at org.jboss.soa.esb.actions.soap.SOAPClient.initialise(SOAPClient.java:275)
       at com.easynet.om.esb.actions.TestO2FmpfAction.getSoapClient(TestO2FmpfAction.java:76)
       at com.easynet.om.esb.actions.TestO2FmpfAction.testActions(TestO2FmpfAction.java:45)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at junit.framework.TestCase.runTest(TestCase.java:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      


      The test code is:
      ConfigTree tree = getConfigTree("ws-client");
      tree.setAttribute("wsdl", env.getString("ws.url.o2fmpf"));
      tree.setAttribute("SOAPAction", "ZZZ");
      tree.setAttribute("operation", "updateOption2FMPFStatus");
      
      SOAPClient action = new SOAPClient(tree);
      action.initialise();
      


      The MBeanServerLocator code that raises the exception is:
      MBeanServer server = (MBeanServer)
       MBeanServerFactory.findMBeanServer(agentID).iterator().next();
      


      findMBeanServer is
      ...
      return new ArrayList(serverMap.values());
      

      where serverMap is an empty HashMap

      I had a look at the SOAPClient unit test accompanying the ESB distribution, but they only test the processResponse method.

      Any suggestions?

      Cheers,
      Toby

        • 1. Re: SOAPClient Issues
          tfennelly

          Hey Toby, the SOAPClient action relies on the "soapui-client" mbean to be deployed in the local MBean container. So, I'm not sure how you'd use that from outside an MBean container (if that's what you're doing). Outherwise, deploy your soapui-client.sar to your container, if you already haven't.

          • 2. Re: SOAPClient Issues
            tobysaville

            great, thanks Tom.

            so i take it that i cant run a JUnit test case to test that the SOAPClient connects to a web service correctly.

            Is there anyway to point my JUnit test case to the MBean server running within my JBoss AS?

            thanks again,
            Toby