我有一个 wsdl 存储在一个受 HTTP BasicAuth 保护的地方。我尝试从中读取 wsdl,如下所述[1];但我得到以下错误
“faultCode=OTHER_ERROR:无法解析导入的文档”
完整的错误堆栈在这里[2]。任何人都知道我如何使用 wsdl4j 从安全的地方读取 wsdl?
[1]
WSDLReader reader = getWsdlFactoryInstance().newWSDLReader();
// switch off the verbose mode
reader.setFeature(JAVAX_WSDL_VERBOSE_MODE, false);
reader.setFeature("javax.wsdl.importDocuments", false);
wsdlDefinition = reader.readWSDL(baseURI);
[2]
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Unable to resolve imported document at 'http://10.100.1.35:9763/registry/re
source/_system/governance/apimgt/wsdls/admin--aa1.0.0.wsdl'.: java.io.IOException: Server returned HTTP response code: 401 for URL: http://10.100.1.35
:9763/registry/resource/_system/governance/apimgt/wsdls/admin--aa1.0.0.wsdl
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2259)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2207)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Unable to resolve imported document at 'http://10.100.1.35:9763/registry/re
source/_system/governance/apimgt/wsdls/admin--aa1.0.0.wsdl'.: java.io.IOException: Server returned HTTP response code: 401 for URL: http://10.100.1.35
:9763/registry/resource/_system/governance/apimgt/wsdls/admin--aa1.0.0.wsdl
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2259)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2207)