/** * Gets the WSDL definition for the provided endpoint reference. * @param manager - the WSDL manager * @param ref - the endpoint reference * @return Definition the wsdl definition * @throws WSDLException */ public static Definition getWSDLDefinition(WSDLManager manager, EndpointReferenceType ref) throws WSDLException { if (null == manager) { return null; } MetadataType metadata = ref.getMetadata(); String location = getWSDLLocation(ref); if (null != location) { //Pick up the first url to obtain the wsdl defintion return manager.getDefinition(location); } for (Object obj : metadata.getAny()) { if (obj instanceof Element) { Element el = (Element)obj; if (StringUtils.isEqualUri(el.getNamespaceURI(), WSDLConstants.NS_WSDL11) && "definitions".equals(el.getLocalName())) { return manager.getDefinition(el); } } } return null; }
/** * Gets the WSDL definition for the provided endpoint reference. * @param manager - the WSDL manager * @param ref - the endpoint reference * @return Definition the wsdl definition * @throws WSDLException */ public static Definition getWSDLDefinition(WSDLManager manager, EndpointReferenceType ref) throws WSDLException { if (null == manager) { return null; } MetadataType metadata = ref.getMetadata(); String location = getWSDLLocation(ref); if (null != location) { //Pick up the first url to obtain the wsdl defintion return manager.getDefinition(location); } for (Object obj : metadata.getAny()) { if (obj instanceof Element) { Element el = (Element)obj; if (StringUtils.isEqualUri(el.getNamespaceURI(), WSDLConstants.NS_WSDL11) && "definitions".equals(el.getLocalName())) { return manager.getDefinition(el); } } } return null; }
private static String findNamespaceHack(EndpointReferenceType ref, Bus bus) { //probably a broken version of Xalan, we'll have to //try a hack to figure out the namespace as xalan //dropped the namespace declaration so there isn't //a way to map the namespace prefix to the real namespace. //This is fixed in xalan 2.7.1, but older versions may //be used if (bus == null) { return ""; } String wsdlLocation = getWSDLLocation(ref); if (StringUtils.isEmpty(wsdlLocation)) { return ""; } if (bus != null) { WSDLManager manager = bus.getExtension(WSDLManager.class); if (manager != null) { try { Definition def = manager.getDefinition(wsdlLocation); return def.getTargetNamespace(); } catch (WSDLException e) { //ignore } } } return ""; }
private static String findNamespaceHack(EndpointReferenceType ref, Bus bus) { //probably a broken version of Xalan, we'll have to //try a hack to figure out the namespace as xalan //dropped the namespace declaration so there isn't //a way to map the namespace prefix to the real namespace. //This is fixed in xalan 2.7.1, but older versions may //be used if (bus == null) { return ""; } String wsdlLocation = getWSDLLocation(ref); if (StringUtils.isEmpty(wsdlLocation)) { return ""; } if (bus != null) { WSDLManager manager = bus.getExtension(WSDLManager.class); if (manager != null) { try { Definition def = manager.getDefinition(wsdlLocation); return def.getTargetNamespace(); } catch (WSDLException e) { //ignore } } } return ""; }