public static QName getQName(String prefixedValue, Element contextEl, Definition def) throws WSDLException { int index = prefixedValue.indexOf(':'); String prefix = (index != -1) ? prefixedValue.substring(0, index) : null; String localPart = prefixedValue.substring(index + 1); String namespaceURI = getNamespaceURIFromPrefix(contextEl, prefix); if (namespaceURI != null) { registerUniquePrefix(prefix, namespaceURI, def); return new QName(namespaceURI, localPart); } else { String faultCode = (prefix == null) ? WSDLException.NO_PREFIX_SPECIFIED : WSDLException.UNBOUND_PREFIX; WSDLException wsdlExc = new WSDLException(faultCode, "Unable to determine " + "namespace of '" + prefixedValue + "'."); wsdlExc.setLocation(XPathUtils.getXPathExprFromNode(contextEl)); throw wsdlExc; } }
public static QName getQName(String prefixedValue, Element contextEl, Definition def) throws WSDLException { int index = prefixedValue.indexOf(':'); String prefix = (index != -1) ? prefixedValue.substring(0, index) : null; String localPart = prefixedValue.substring(index + 1); String namespaceURI = getNamespaceURIFromPrefix(contextEl, prefix); if (namespaceURI != null) { registerUniquePrefix(prefix, namespaceURI, def); return new QName(namespaceURI, localPart); } else { String faultCode = (prefix == null) ? WSDLException.NO_PREFIX_SPECIFIED : WSDLException.UNBOUND_PREFIX; WSDLException wsdlExc = new WSDLException(faultCode, "Unable to determine " + "namespace of '" + prefixedValue + "'."); wsdlExc.setLocation(XPathUtils.getXPathExprFromNode(contextEl)); throw wsdlExc; } }