Search in sources :

Example 1 with WSDLBinding

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

the class WSDLResource method getWSDLBindings.

@GET
@Path("/{wsdlUrl}/bindings")
public List<WSDLBinding> getWSDLBindings(@PathParam("wsdlUrl") String wsdlUrl) throws UnsupportedEncodingException {
    List<WSDLBinding> result = new ArrayList<WSDLBinding>();
    WSDLParser parser = new WSDLParser();
    Definitions definition = parser.parse(wsdlUrl);
    for (Binding binding : definition.getBindings()) {
        List<String> operationNames = new ArrayList<String>();
        for (BindingOperation operation : binding.getOperations()) {
            operationNames.add(operation.getName());
        }
        result.add(new WSDLBinding(binding.getName(), operationNames));
    }
    return result;
}
Also used : WSDLBinding(io.irontest.models.WSDLBinding) Binding(com.predic8.wsdl.Binding) BindingOperation(com.predic8.wsdl.BindingOperation) WSDLBinding(io.irontest.models.WSDLBinding) Definitions(com.predic8.wsdl.Definitions) ArrayList(java.util.ArrayList) WSDLParser(com.predic8.wsdl.WSDLParser) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

Binding (com.predic8.wsdl.Binding)1 BindingOperation (com.predic8.wsdl.BindingOperation)1 Definitions (com.predic8.wsdl.Definitions)1 WSDLParser (com.predic8.wsdl.WSDLParser)1 WSDLBinding (io.irontest.models.WSDLBinding)1 ArrayList (java.util.ArrayList)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1