Search in sources :

Example 1 with WSDLValidationResponseWsdlInfoDTO

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

the class APIMappingUtil method fromWSDLValidationResponseToDTO.

/**
 * Converts a WSDL validation response model to DTO.
 *
 * @param validationResponse validation response model
 * @return Converted WSDL validation response model to DTO
 */
public static WSDLValidationResponseDTO fromWSDLValidationResponseToDTO(WSDLValidationResponse validationResponse) {
    WSDLValidationResponseDTO wsdlValidationResponseDTO = new WSDLValidationResponseDTO();
    WSDLInfo wsdlInfo;
    if (validationResponse.isValid()) {
        wsdlValidationResponseDTO.setIsValid(true);
        wsdlInfo = validationResponse.getWsdlInfo();
        WSDLValidationResponseWsdlInfoDTO wsdlInfoDTO = new WSDLValidationResponseWsdlInfoDTO();
        wsdlInfoDTO.setVersion(wsdlInfo.getVersion());
        List<WSDLValidationResponseWsdlInfoEndpointsDTO> endpointsDTOList = fromEndpointsMapToWSDLValidationResponseEndpointsDTO(wsdlInfo.getEndpoints());
        wsdlInfoDTO.setEndpoints(endpointsDTOList);
        wsdlValidationResponseDTO.setWsdlInfo(wsdlInfoDTO);
    } else {
        wsdlValidationResponseDTO.setIsValid(false);
        wsdlValidationResponseDTO.setErrors(getErrorListItemsDTOsFromErrorHandler(validationResponse.getError()));
    }
    return wsdlValidationResponseDTO;
}
Also used : WSDLInfo(org.wso2.carbon.apimgt.impl.wsdl.model.WSDLInfo) WSDLValidationResponseDTO(org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WSDLValidationResponseDTO) WSDLValidationResponseWsdlInfoEndpointsDTO(org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WSDLValidationResponseWsdlInfoEndpointsDTO) WSDLValidationResponseWsdlInfoDTO(org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WSDLValidationResponseWsdlInfoDTO)

Aggregations

WSDLInfo (org.wso2.carbon.apimgt.impl.wsdl.model.WSDLInfo)1 WSDLValidationResponseDTO (org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WSDLValidationResponseDTO)1 WSDLValidationResponseWsdlInfoDTO (org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WSDLValidationResponseWsdlInfoDTO)1 WSDLValidationResponseWsdlInfoEndpointsDTO (org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WSDLValidationResponseWsdlInfoEndpointsDTO)1