SOAPClient Issues
tobysaville Oct 18, 2007 11:10 AMHello,
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