dhiresh
15 years agoNew Contributor
SOAPUI execution from Java
Hi All,
I have created a SOAP project, added test suite, added test case, added test step. I used the java jars from eviware3.6.1 (/bin and /lab) folders. Using the API I am using the SOAP methods in the following manner :
public class SoapExecution {
public SoapExecution() {
super();
}
public void testTestCaseRunner() throws Exception {String projectFile = System.getProperty("user.dir")
+ "\\src\\com\\soapautomation\\resources\\SOAP_Project.xml";
if (!new File(projectFile).exists())
throw new Exception("soapUI project file [" + projectFile
+ "] not found");
WsdlProject project = new WsdlProject(projectFile);
WsdlTestSuite inboundTestSuite = project.getTestSuiteByName("InboundTestSuite");
WsdlTestCase getEventTestCase = inboundTestSuite.getTestCaseByName("TestCase 1");
WsdlTestStep putEventTestStep = getEventTestCase.getTestStepByName("PutEvent");
WsdlTestCaseRunner runPutEvent = new WsdlTestCaseRunner(getEventTestCase, new StringToObjectMap());
TestStepResult eventResult = runPutEvent.runTestStep(putEventTestStep);
WsdlTestRequestStepResult eventWSDL = (WsdlTestRequestStepResult) eventResult;
}
}
I am getting a proper response from the above code, but the control goes to an uncaught exception. The daemon thread keeps on running. Can any anybody help me out on how to end the process once the SOAP execution is done.
Let me know what other methods can be used to make it an async call if required.
Thanks in Advance
Dhiresh
I have created a SOAP project, added test suite, added test case, added test step. I used the java jars from eviware3.6.1 (/bin and /lab) folders. Using the API I am using the SOAP methods in the following manner :
public class SoapExecution {
public SoapExecution() {
super();
}
public void testTestCaseRunner() throws Exception {String projectFile = System.getProperty("user.dir")
+ "\\src\\com\\soapautomation\\resources\\SOAP_Project.xml";
if (!new File(projectFile).exists())
throw new Exception("soapUI project file [" + projectFile
+ "] not found");
WsdlProject project = new WsdlProject(projectFile);
WsdlTestSuite inboundTestSuite = project.getTestSuiteByName("InboundTestSuite");
WsdlTestCase getEventTestCase = inboundTestSuite.getTestCaseByName("TestCase 1");
WsdlTestStep putEventTestStep = getEventTestCase.getTestStepByName("PutEvent");
WsdlTestCaseRunner runPutEvent = new WsdlTestCaseRunner(getEventTestCase, new StringToObjectMap());
TestStepResult eventResult = runPutEvent.runTestStep(putEventTestStep);
WsdlTestRequestStepResult eventWSDL = (WsdlTestRequestStepResult) eventResult;
}
}
I am getting a proper response from the above code, but the control goes to an uncaught exception. The daemon thread keeps on running. Can any anybody help me out on how to end the process once the SOAP execution is done.
Let me know what other methods can be used to make it an async call if required.
Thanks in Advance
Dhiresh