use of javax.wsdl.extensions.http.HTTPOperation in project carbon-apimgt by wso2.
the class WSDL11ProcessorImpl method getOperation.
/**
* Retrieves WSDL operation given the binding operation and http verb
*
* @param bindingOperation {@link BindingOperation} object
* @param verb HTTP verb
* @return WSDL operation for the given binding operation and http verb
*/
private WSDLOperation getOperation(BindingOperation bindingOperation, String verb) {
WSDLOperation wsdlOperation = null;
for (Object boExtElement : bindingOperation.getExtensibilityElements()) {
if (boExtElement instanceof HTTPOperation) {
HTTPOperation httpOperation = (HTTPOperation) boExtElement;
if (!StringUtils.isBlank(httpOperation.getLocationURI())) {
wsdlOperation = new WSDLOperation();
wsdlOperation.setVerb(verb);
wsdlOperation.setURI(APIMWSDLUtils.replaceParentheses(httpOperation.getLocationURI()));
if (log.isDebugEnabled()) {
log.debug("Found HTTP Binding operation; name: " + bindingOperation.getName() + " [" + wsdlOperation.getVerb() + " " + wsdlOperation.getURI() + "]");
}
if (APIMWSDLUtils.canContainBody(verb)) {
String boContentType = getContentType(bindingOperation.getBindingInput());
wsdlOperation.setContentType(boContentType != null ? boContentType : TEXT_XML_MEDIA_TYPE);
}
List<WSDLOperationParam> paramList = getParameters(bindingOperation, verb, wsdlOperation.getContentType());
wsdlOperation.setParameters(paramList);
}
}
}
return wsdlOperation;
}
Aggregations