我的 wsdl 包含 SOAP11、SOAP12 和 HTTP 绑定。当我尝试从 HTTPBinding 检索地址位置时,我的示例代码块抛出错误
.“不支持的 wsdl 错误!”
(我使用 wsdl4j 来阅读 wsdl)
我检索 AddressLocation 的示例代码如下;
private String getAddressUrl(ExtensibilityElement exElement) throws APIManagementException {
if (exElement instanceof SOAP12AddressImpl) {
return ((SOAP12AddressImpl) exElement).getLocationURI();
} else if (exElement instanceof SOAPAddressImpl) {
return ((SOAPAddressImpl) exElement).getLocationURI();
} else {
String msg = "Unsupported WSDL errors!";
log.error(msg);
throw new APIManagementException(msg);
}
}
在这里,我看到 WSDL4J 中只有“SOAP12AddressImpl”和“SOAPAddressImpl”可用。所以,当我传递 HTTPbinding 数据时,上面的代码会抛出错误。我的示例 HTTP 绑定可扩展性元素是;
HTTPAddress ({http://schemas.xmlsoap.org/wsdl/http/}address):
required=null
locationURI=http://10.100.1.35:9000/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpEndpoint.
如何从 HTTPBinding 读取地址位置?wsdl4j 中是否有可用的实现?