Search in sources :

Example 1 with HTTPOperation

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;
}
Also used : HTTPOperation(javax.wsdl.extensions.http.HTTPOperation) WSDLOperationParam(org.wso2.carbon.apimgt.core.models.WSDLOperationParam) WSDLOperation(org.wso2.carbon.apimgt.core.models.WSDLOperation)

Aggregations

HTTPOperation (javax.wsdl.extensions.http.HTTPOperation)1 WSDLOperation (org.wso2.carbon.apimgt.core.models.WSDLOperation)1 WSDLOperationParam (org.wso2.carbon.apimgt.core.models.WSDLOperationParam)1