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;
}
Aggregations