use of org.wso2.carbon.apimgt.impl.wsdl.WSDL11SOAPOperationExtractor in project carbon-apimgt by wso2.
the class SOAPOperationBindingUtils method getSoapOperationMapping.
/**
* Gets soap operations to rest resources mapping for a wsdl byte content
*
* @param wsdlContent WSDL byte content
* @return swagger json string with the soap operation mapping
* @throws APIManagementException if an error occurs when generating swagger
*/
public static String getSoapOperationMapping(byte[] wsdlContent) throws APIManagementException {
WSDL11SOAPOperationExtractor processor = APIMWSDLReader.getWSDLSOAPOperationExtractor(wsdlContent);
WSDLInfo wsdlInfo = processor.getWsdlInfo();
return getGeneratedSwaggerFromWSDL(wsdlInfo);
}
use of org.wso2.carbon.apimgt.impl.wsdl.WSDL11SOAPOperationExtractor in project carbon-apimgt by wso2.
the class SOAPOperationBindingUtils method getWSDL11SOAPOperationExtractor.
/**
* Gets WSDL processor used to extract the soap binding operations
*
* @param content WSDL content
* @param wsdlReader WSDL reader used to parse the wsdl{@link APIMWSDLReader}
* @return {@link WSDLProcessor}
* @throws APIManagementException
*/
public static WSDL11SOAPOperationExtractor getWSDL11SOAPOperationExtractor(byte[] content, APIMWSDLReader wsdlReader) throws APIManagementException {
WSDL11SOAPOperationExtractor wsdl11SOAPOperationExtractor = new WSDL11SOAPOperationExtractor(wsdlReader);
wsdl11SOAPOperationExtractor.init(content);
return wsdl11SOAPOperationExtractor;
}
use of org.wso2.carbon.apimgt.impl.wsdl.WSDL11SOAPOperationExtractor in project carbon-apimgt by wso2.
the class APIMWSDLReader method getWSDLSOAPOperationExtractor.
/**
* Returns a WSDL11SOAPOperationExtractor for the WSDL byte content {@code content}. Only WSDL 1.1 is supported.
*
* @param content WSDL byte[] content
* @return WSDL11SOAPOperationExtractor for the provided URL
* @throws APIManagementException If an error occurs while determining the processor
*/
public static WSDL11SOAPOperationExtractor getWSDLSOAPOperationExtractor(byte[] content) throws APIManagementException {
WSDL11SOAPOperationExtractor processor = new WSDL11SOAPOperationExtractor();
processor.init(content);
return processor;
}
use of org.wso2.carbon.apimgt.impl.wsdl.WSDL11SOAPOperationExtractor in project carbon-apimgt by wso2.
the class APIMWSDLReader method getWSDLSOAPOperationExtractorForUrl.
/**
* Returns a WSDL11SOAPOperationExtractor for the url {@code url}. Only WSDL 1.1 is supported.
*
* @param url WSDL url
* @return WSDL11SOAPOperationExtractor for the provided URL
* @throws APIManagementException If an error occurs while determining the processor
*/
public static WSDL11SOAPOperationExtractor getWSDLSOAPOperationExtractorForUrl(URL url) throws APIManagementException {
WSDL11SOAPOperationExtractor processor = new WSDL11SOAPOperationExtractor();
processor.init(url);
return processor;
}
use of org.wso2.carbon.apimgt.impl.wsdl.WSDL11SOAPOperationExtractor in project carbon-apimgt by wso2.
the class SOAPOperationBindingTestCase method testGetWSDLProcessor.
@Test
public void testGetWSDLProcessor() throws Exception {
APIMWSDLReader wsdlReader = new APIMWSDLReader(Thread.currentThread().getContextClassLoader().getResource("wsdls/phoneverify.wsdl").toExternalForm());
byte[] wsdlContent = wsdlReader.getWSDL();
WSDL11SOAPOperationExtractor processor = SOAPOperationBindingUtils.getWSDL11SOAPOperationExtractor(wsdlContent, wsdlReader);
Assert.assertNotNull(processor);
Assert.assertTrue("Failed to get soap binding operations from the WSDL", processor.getWsdlInfo().getSoapBindingOperations().size() > 0);
}
Aggregations