Example #1
0
 public String getEncodingStyle() {
   String encodingStyle = encodingStyleAttribute.getValue();
   if (encodingStyle != null) return encodingStyle;
   String soapNamespace = getSOAPNamespace();
   if (soapNamespace != null) {
     Attr attr = getAttributeNodeNS(soapNamespace, "encodingStyle");
     if (attr != null) {
       encodingStyle = attr.getValue();
       try {
         setEncodingStyle(encodingStyle);
       } catch (SOAPException se) {
         // has to be ignored
       }
       return encodingStyle;
     }
   }
   return null;
 }
Example #2
0
  private static String getAttributeValueFrom(
      Element element, String uri, String localName, String prefix, String qualifiedName) {

    String nonzeroLengthUri = (uri == null || uri.length() == 0) ? null : uri;

    boolean mustUseGetAttributeNodeNS = (nonzeroLengthUri != null);

    if (mustUseGetAttributeNodeNS) {

      if (!element.hasAttributeNS(uri, localName)) {
        return null;
      }

      String attrValue = element.getAttributeNS(nonzeroLengthUri, localName);

      return attrValue;
    }

    Attr attribute = null;
    attribute = element.getAttributeNode(qualifiedName);

    return attribute == null ? null : attribute.getValue();
  }