Java wsdl4J是否支持解析HTTP绑定?
我的wsdl包含SOAP11、SOAP12和HTTP绑定。 当我试图从HTTPBinding检索地址位置时,我的示例代码块抛出错误 “不支持的wsdl错误!” (我使用wsdl4j阅读wsdl) 我检索AddressLocation的示例代码如下:Java wsdl4J是否支持解析HTTP绑定?,java,wsdl,wsdl4j,Java,Wsdl,Wsdl4j,我的wsdl包含SOAP11、SOAP12和HTTP绑定。 当我试图从HTTPBinding检索地址位置时,我的示例代码块抛出错误 “不支持的wsdl错误!” (我使用wsdl4j阅读wsdl) 我检索AddressLocation的示例代码如下: private String getAddressUrl(ExtensibilityElement exElement) throws APIManagementException { if (exElement instanceo
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中是否有可用的实现?对不起,我的不好;wsdl4j中也提供了HTTP地址实现。 像这样更正我的代码
if (exElement instanceof SOAP12AddressImpl) {
return ((SOAP12AddressImpl) exElement).getLocationURI();
} else if (exElement instanceof SOAPAddressImpl) {
return ((SOAPAddressImpl) exElement).getLocationURI();
} else if (exElement instanceof HTTPAddressImpl) {
return ((HTTPAddressImpl) exElement).getLocationURI();
} else {
String msg = "Unsupported WSDL errors!";
log.error(msg);
throw new APIManagementException(msg);
}