Reputation: 919
In SOAP UI Web service testing, User imports the Project in to the work space and mentions the End point. Enters the required data in the Request xml and runs to get the resulting response in xml format.
Is there a way we can achieve this using Java only without using the SoapUI tool. I guess the steps should be:
Please help me how to do this using Java only(without using SOAP UI tool). Any links/code will be greatly helpful.
Thanks, Mike
Upvotes: 1
Views: 5318
Reputation: 31
Use soapUI API. ; Here are some useful links: http://www.soapui.org/Developers-Corner/integrating-with-soapui.html http://pritikaur23.wordpress.com/2013/06/16/saving-a-soapui-project-and-sending-requests-using-soapui-api/
I used the following code to create a project:
File projectFile = new File(filePath);
SoapUI.setSoapUICore(new StandaloneSoapUICore(true));
WsdlProject project = new WsdlProject();
project.setName(projectName);
WsdlInterface[] wsdls = WsdlImporter.importWsdl(project, url);
for (WsdlInterface wsdl : wsdls) {
int c = wsdl.getOperationCount();
String reqContent = "";
for (int j = 0; j < c; j++) {
WsdlOperation op = wsdl.getOperationAt(j);
reqContent = op.createRequest(true);
WsdlRequest req = op.addNewRequest(requestName);
req.setRequestContent(reqContent );
}
}
project.saveIn(projectFile);
SoapUI.shutdown();
Upvotes: 3
Reputation: 103397
You can create client and pass in HTTP Request test request populated with needed parameter for testing purpose, below mention question has some useful insights.
Upvotes: 1