Exemple #1
0
 public SOAPElement addAttribute(Name name, String value) throws SOAPException {
   addAttributeBare(name, value);
   if (!"".equals(name.getURI())) {
     ensureNamespaceIsDeclared(name.getPrefix(), name.getURI());
   }
   return this;
 }
Exemple #2
0
  protected SOAPElement createElement(Name name) {

    if (isNamespaceQualified(name)) {
      return (SOAPElement)
          getOwnerDocument().createElementNS(name.getURI(), name.getQualifiedName());
    } else {
      return (SOAPElement) getOwnerDocument().createElement(name.getQualifiedName());
    }
  }
  /**
   * Clear the soap MustUnderstand.
   *
   * @param soapHeader The SOAP header.
   * @param soapHeaderElement The SOAP header element.
   */
  private void clearMustUnderstand(
      final SOAPHeader soapHeader, final SOAPHeaderElement soapHeaderElement) throws SOAPException {
    final Name headerName = soapHeader.getElementName();

    final SOAPFactory factory = SOAPFactory.newInstance();
    final Name attributeName =
        factory.createName("mustUnderstand", headerName.getPrefix(), headerName.getURI());

    soapHeaderElement.removeAttribute(attributeName);
  }
 private SOAPHeaderElement getHeaderElement(
     final SOAPHeader soapHeader, final String uri, final String name) throws SOAPException {
   if (soapHeader != null) {
     final Iterator headerIter = SOAPUtil.getChildElements(soapHeader);
     while (headerIter.hasNext()) {
       final SOAPHeaderElement current = (SOAPHeaderElement) headerIter.next();
       final Name currentName = current.getElementName();
       if ((currentName != null)
           && match(name, currentName.getLocalName())
           && match(uri, currentName.getURI())) {
         return current;
       }
     }
   }
   return null;
 }
Exemple #5
0
  protected String getSOAPNamespace() {
    String soapNamespace = null;

    SOAPElement antecedent = this;
    while (antecedent != null) {
      Name antecedentName = antecedent.getElementName();
      String antecedentNamespace = antecedentName.getURI();

      if (NameImpl.SOAP11_NAMESPACE.equals(antecedentNamespace)
          || NameImpl.SOAP12_NAMESPACE.equals(antecedentNamespace)) {

        soapNamespace = antecedentNamespace;
        break;
      }

      antecedent = antecedent.getParentElement();
    }

    return soapNamespace;
  }
 public void setFaultCode(Name faultCodeQName) throws SOAPException {
   setFaultCode(
       faultCodeQName.getLocalName(), faultCodeQName.getPrefix(), faultCodeQName.getURI());
 }
Exemple #7
0
 protected static String getAttributeValueFrom(Element element, Name name) {
   return getAttributeValueFrom(
       element, name.getURI(), name.getLocalName(), name.getPrefix(), name.getQualifiedName());
 }
Exemple #8
0
 public ElementImpl(SOAPDocumentImpl ownerDoc, Name name) {
   super(ownerDoc, name.getURI(), name.getQualifiedName(), name.getLocalName());
   elementQName = NameImpl.convertToQName(name);
 }
Exemple #9
0
 public Iterator getChildElements(final Name name) {
   return getChildElements(name.getURI(), name.getLocalName());
 }
Exemple #10
0
 public boolean removeAttribute(Name name) {
   return removeAttribute(name.getURI(), name.getLocalName());
 }
Exemple #11
0
 private void addAttributeBare(Name name, String value) {
   addAttributeBare(name.getURI(), name.getPrefix(), name.getQualifiedName(), value);
 }
Exemple #12
0
 protected boolean isNamespaceQualified(Name name) {
   return !"".equals(name.getURI());
 }