Search in sources :

Example 1 with APIDefinitionValidationResponse_wsdlInfo_endpointsDTO

use of org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDefinitionValidationResponse_wsdlInfo_endpointsDTO in project carbon-apimgt by wso2.

the class MappingUtil method toWSDLValidationResponseDTO.

/**
 * Map WSDLInfo to APIDefinitionValidationResponseDTO
 *
 * @param info WSDLInfo object
 * @return {@link APIDefinitionValidationResponseDTO} based on provided {@link WSDLInfo} object
 */
public static APIDefinitionValidationResponseDTO toWSDLValidationResponseDTO(WSDLInfo info) {
    APIDefinitionValidationResponseDTO wsdlValidationResponseDTO = new APIDefinitionValidationResponseDTO();
    wsdlValidationResponseDTO.setIsValid(info.getVersion() != null);
    APIDefinitionValidationResponse_wsdlInfoDTO infoDTO = new APIDefinitionValidationResponse_wsdlInfoDTO();
    infoDTO.setVersion(info.getVersion());
    APIDefinitionValidationResponse_wsdlInfo_endpointsDTO endpointsDTO;
    if (info.getEndpoints() != null) {
        for (String endpointName : info.getEndpoints().keySet()) {
            endpointsDTO = new APIDefinitionValidationResponse_wsdlInfo_endpointsDTO();
            endpointsDTO.setName(endpointName);
            endpointsDTO.setLocation(info.getEndpoints().get(endpointName));
            infoDTO.addEndpointsItem(endpointsDTO);
        }
    }
    // currently operations are supported only in WSDL 1.1
    if (APIMgtConstants.WSDLConstants.WSDL_VERSION_11.equals(info.getVersion())) {
        APIDefinitionValidationResponse_wsdlInfo_bindingInfoDTO bindingInfoDTO = new APIDefinitionValidationResponse_wsdlInfo_bindingInfoDTO();
        bindingInfoDTO.setHasHttpBinding(info.hasHttpBindingOperations());
        bindingInfoDTO.setHasSoapBinding(info.hasSoapBindingOperations());
        infoDTO.setBindingInfo(bindingInfoDTO);
    }
    wsdlValidationResponseDTO.setWsdlInfo(infoDTO);
    return wsdlValidationResponseDTO;
}
Also used : APIDefinitionValidationResponse_wsdlInfo_endpointsDTO(org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDefinitionValidationResponse_wsdlInfo_endpointsDTO) APIDefinitionValidationResponse_wsdlInfoDTO(org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDefinitionValidationResponse_wsdlInfoDTO) APIDefinitionValidationResponseDTO(org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDefinitionValidationResponseDTO) APIDefinitionValidationResponse_wsdlInfo_bindingInfoDTO(org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDefinitionValidationResponse_wsdlInfo_bindingInfoDTO)

Aggregations

APIDefinitionValidationResponseDTO (org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDefinitionValidationResponseDTO)1 APIDefinitionValidationResponse_wsdlInfoDTO (org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDefinitionValidationResponse_wsdlInfoDTO)1 APIDefinitionValidationResponse_wsdlInfo_bindingInfoDTO (org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDefinitionValidationResponse_wsdlInfo_bindingInfoDTO)1 APIDefinitionValidationResponse_wsdlInfo_endpointsDTO (org.wso2.carbon.apimgt.rest.api.publisher.dto.APIDefinitionValidationResponse_wsdlInfo_endpointsDTO)1