Search in sources :

Example 1 with SOAPOperationInfo

use of io.irontest.models.teststep.SOAPOperationInfo in project irontest by zheng-wang.

the class WSDLResource method getOperationInfo.

@GET
@Path("/{wsdlUrl}/bindings/{bindingName}/operations/{operationName}")
public SOAPOperationInfo getOperationInfo(@PathParam("wsdlUrl") String wsdlUrl, @PathParam("bindingName") String bindingName, @PathParam("operationName") String operationName) {
    SOAPOperationInfo info = new SOAPOperationInfo();
    WSDLParser parser = new WSDLParser();
    Definitions definition = parser.parse(wsdlUrl);
    StringWriter writer = new StringWriter();
    SOARequestCreator creator = new SOARequestCreator(definition, new RequestTemplateCreator(), new MarkupBuilder(writer));
    creator.createRequest(null, operationName, bindingName);
    info.setSampleRequest(writer.toString());
    return info;
}
Also used : RequestTemplateCreator(com.predic8.wstool.creator.RequestTemplateCreator) StringWriter(java.io.StringWriter) Definitions(com.predic8.wsdl.Definitions) MarkupBuilder(groovy.xml.MarkupBuilder) SOAPOperationInfo(io.irontest.models.teststep.SOAPOperationInfo) WSDLParser(com.predic8.wsdl.WSDLParser) SOARequestCreator(com.predic8.wstool.creator.SOARequestCreator) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

Definitions (com.predic8.wsdl.Definitions)1 WSDLParser (com.predic8.wsdl.WSDLParser)1 RequestTemplateCreator (com.predic8.wstool.creator.RequestTemplateCreator)1 SOARequestCreator (com.predic8.wstool.creator.SOARequestCreator)1 MarkupBuilder (groovy.xml.MarkupBuilder)1 SOAPOperationInfo (io.irontest.models.teststep.SOAPOperationInfo)1 StringWriter (java.io.StringWriter)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1