Java SOAP Message getPrefix(String namespaceURI, SOAPElement contextElem)

Here you can find the source of getPrefix(String namespaceURI, SOAPElement contextElem)

Description

get Prefix

License

Open Source License

Declaration

public static String getPrefix(String namespaceURI, SOAPElement contextElem) 

Method Source Code


//package com.java2s;
/*/*w w  w .j a v  a 2s  . c  o  m*/
 * JBoss, Home of Professional Open Source
 * Copyright 2005, JBoss Inc., and individual contributors as indicated
 * by the @authors tag.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
 * published by JBoss Inc.; either version 1.0 of the License, or
 * (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */

import java.util.Iterator;

import javax.xml.soap.SOAPElement;

public class Main {
    public static String getPrefix(String namespaceURI, SOAPElement contextElem) {
        Iterator prefixIt = contextElem.getVisibleNamespacePrefixes();
        while (prefixIt.hasNext()) {
            String prefix = (String) prefixIt.next();
            if (namespaceURI.equals(contextElem.getNamespaceURI(prefix)))
                return prefix;
        }
        return null;
    }
}

Related

  1. getNamespacePrefix(SOAPElement element, String nsURI)
  2. getNamespacePrefixes(SOAPElement element)
  3. getNamespaceURIs(SOAPMessage soap)
  4. getNode(Node node, String nodeName)
  5. getPrefix(Name name)
  6. getSOAPData(SOAPMessage soapMessage)
  7. getSoapFaultExceptionMessage(SOAPFaultException sfe)
  8. getSOAPHeader(SOAPMessageContext smc)
  9. getSOAPHeaderElement(SOAPMessage message, String headerName, String nameSpace)