Getting the deployment error "Failed to compile resource MyFormRequestService.svc_WSDL"

We have an API Proxy which has Soap Message Validation Policy. When we try to deploy this API Proxy we are getting the following error in the UI:

Error Deploying Revision1 to test
MessageValidation SOAP-Message-Validation-1:Failed to compile resource MyFormRequestService.svc_WSDL.
ContextRevision:1;APIProxy:<Proxy-name>;Organization:<org-name>;Environment:test.
0 1 227
1 REPLY 1

This error typically happens if the <ResourceURL> specified in the Soap Message Validation policy is invalid or the WSDL file contains any resources which are not accessible.

In this case, we analyzed the Management server log and found that this error occurred because there was a connection timed out error when accessing a URL provided in the WSDL file as shown below:

org:<org-name> env:uat target:/v1/organizations/<org-name>/e/uat/apis/<API-Name>/revisions/2/deployments contextId: action: qtp168957945-8293 ERROR REST - ExceptionMapper.toResponse() : Error occurred : MessageValidation MyFormRequestService-SOAP-Message-Validation: Failed to compile resource MyFormRequestService.svc_WSDL. Context Revision:2;APIProxy:<API-Name>;Organization:<org-name>;Environment:uat
com.apigee.steps.messagevalidation.MessageValidationStepValidator.validate(MessageValidationStepValidator.java:53)
com.apigee.steps.messagevalidation.MessageValidationStepValidator.validate(MessageValidationStepValidator.java:18)
com.apigee.config.validation.AbstractBeanValidator.execute(AbstractBeanValidator.java:53)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
Caused by Compilation of wsdl resource MyFormRequestService.svc_WSDL failed
com.apigee.messaging.resource.CompiledWSDLResourceContentHandler.compileWSDL(CompiledWSDLResourceContentHandler.java:157)
com.apigee.messaging.resource.CompiledWSDLResourceContentHandler.compileWSDLFromByteArrayData(CompiledWSDLResourceContentHandler.java:131)
com.apigee.messaging.resource.CompiledWSDLResourceContentHandler.getCompiledWsdlContent(CompiledWSDLResourceContentHandler.java:115)
com.apigee.steps.messagevalidation.MessageValidationStepValidator.validate(MessageValidationStepValidator.java:48)
Caused by WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'http://<hostname>:<port#>/MyFormRequestService/MyFormRequestService.svc?xsd=xsd0'.: java.net.ConnectException: Connection timed out (Connection timed out)
com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)

Ensure that all the ResourceURL provided in the Soap Message Validation policy and any URLs used in the actual resource such as WSDL file are accessible from Apigee Edge.