本文整理了Java中javax.xml.soap.SOAPElement.getNamespaceURI()
方法的一些代码示例,展示了SOAPElement.getNamespaceURI()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SOAPElement.getNamespaceURI()
方法的具体详情如下:
包路径:javax.xml.soap.SOAPElement
类名称:SOAPElement
方法名:getNamespaceURI
[英]Returns the URI of the namespace that has the given prefix.
[中]返回具有给定前缀的命名空间的URI。
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
public String getNamespaceURI(final String prefix) {
return currentElement.getNamespaceURI(prefix);
}
public String getPrefix(final String namespaceURI) {
代码示例来源:origin: apache/servicemix-bundles
@Override
public String getNamespaceURI(String prefix) {
return currentElement.getNamespaceURI(prefix);
}
@Override
代码示例来源:origin: apache/servicemix-bundles
@Override
public String getNamespaceURI(final String prefix) {
return currentElement.getNamespaceURI(prefix);
}
@Override
代码示例来源:origin: com.hynnet/xws-security
public static boolean isEncryptedKey(SOAPElement elem) {
if (MessageConstants.XENC_ENCRYPTED_KEY_LNAME.equals(elem.getLocalName()) &&
MessageConstants.XENC_NS.equals(elem.getNamespaceURI())) {
return true;
}
return false;
}
代码示例来源:origin: com.hynnet/xws-security
public static boolean isBinarySecret(SOAPElement elem) {
if (MessageConstants.BINARY_SECRET_LNAME.equals(elem.getLocalName()) &&
WSTrustConstants.WST_NAMESPACE.equals(elem.getNamespaceURI())) {
return true;
}
return false;
}
代码示例来源:origin: org.n52.metadata/smarteditor-api
private void addNamespaceDeclaration(Attr attr, SOAPElement parent) throws SOAPException {
String value = attr.getNodeValue();
String name = attr.getLocalName();
if (value.equals(parent.getNamespaceURI())) {
return;
}
parent.addNamespaceDeclaration(name, value);
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
/**
* Returns the URI of the namespace that has the given prefix.
*
* @param prefix a String giving the prefix of the namespace for which to search
* @return a String with the uri of the namespace that has the given prefix
*/
public String getNamespaceURI(String prefix)
{
String nsURI = element.getAttribute("xmlns:" + prefix);
if (nsURI.length() == 0 && getParentElement() != null)
return getParentElement().getNamespaceURI(prefix);
return (nsURI.length() > 0 ? nsURI : null);
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
public boolean getMustUnderstand()
{
final String headerURI = getParentElement().getNamespaceURI();
return DOMUtils.getAttributeValueAsBoolean(this, new QName(headerURI, Constants.SOAP11_ATTR_MUST_UNDERSTAND));
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
public String getRole()
{
final String headerURI = getParentElement().getNamespaceURI();
if (Constants.NS_SOAP11_ENV.equals(headerURI))
throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "SOAP11_NOT_SUPPORT_ROLE"));
Attr roleAttr = getAttributeNodeNS(headerURI, Constants.SOAP12_ATTR_ROLE);
return roleAttr != null ? roleAttr.getValue() : null;
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
public boolean getRelay()
{
final String headerURI = getParentElement().getNamespaceURI();
if (Constants.NS_SOAP11_ENV.equals(headerURI))
throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "SOAP11_NOT_SUPPORT_ROLE"));
return DOMUtils.getAttributeValueAsBoolean(this, new QName(headerURI, Constants.SOAP12_ATTR_RELAY));
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
public String getActor()
{
final String headerURI = getParentElement().getNamespaceURI();
if (!Constants.NS_SOAP11_ENV.equals(headerURI))
return getRole();
Attr actorAttr = getAttributeNodeNS(headerURI, Constants.SOAP11_ATTR_ACTOR);
return actorAttr != null ? actorAttr.getValue() : null;
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
private static SOAPElement addChildValueElement(SOAPElement codeElement) throws SOAPException
{
return codeElement.addChildElement("Value", codeElement.getPrefix(), codeElement.getNamespaceURI());
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
public void setRelay(boolean relay)
{
final SOAPElement header = getParentElement();
final String headerURI = header.getNamespaceURI();
if (Constants.NS_SOAP11_ENV.equals(headerURI))
throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "SOAP11_NOT_SUPPORT_ROLE"));
setAttributeNS(headerURI, header.getPrefix() + ":" + Constants.SOAP12_ATTR_RELAY, Boolean.toString(relay));
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
public void setRole(String roleURI)
{
final SOAPElement header = getParentElement();
final String headerURI = header.getNamespaceURI();
if (Constants.NS_SOAP11_ENV.equals(headerURI))
throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "SOAP11_NOT_SUPPORT_ROLE"));
setAttributeNS(headerURI, header.getPrefix() + ":" + Constants.SOAP12_ATTR_ROLE, roleURI);
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
public void setMustUnderstand(boolean mustUnderstand)
{
final SOAPElement header = getParentElement();
final String headerURI = header.getNamespaceURI();
setAttributeNS(headerURI, header.getPrefix() + ":" + Constants.SOAP11_ATTR_MUST_UNDERSTAND, mustUnderstand ? "1" : "0");
}
代码示例来源:origin: net.servicegrid/jp.go.nict.langrid.commons
@Override
public SOAPElement addChildElement(SOAPElement arg0) throws SOAPException {
String uri = arg0.getNamespaceURI();
if(uri == null) return null;
String value = arg0.getValue();
if(value == null) value = arg0.getNodeValue();
if(value == null) return null;
headers.add(new RpcHeader(uri, arg0.getLocalName(), value));
return arg0;
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
public void setActor(String actorURI)
{
final SOAPElement header = getParentElement();
final String headerURI = header.getNamespaceURI();
if (Constants.NS_SOAP11_ENV.equals(headerURI))
setAttributeNS(headerURI, header.getPrefix() + ":" + Constants.SOAP11_ATTR_ACTOR, actorURI);
else
setRole(actorURI);
}
代码示例来源:origin: org.apache.ws.commons.axiom/saaj-testsuite
@Override
protected void runTest() throws Throwable {
SOAPElement root = newSOAPFactory().createElement("root", "p", "urn:test");
SOAPElement element = root.addChildElement("child");
assertThat(element.getLocalName()).isEqualTo("child");
assertThat(element.getNamespaceURI()).isNull();
assertThat(element.getPrefix()).isNull();
assertThat(element.getParentNode()).isSameAs(root);
assertThat(element.getAttributes().getLength()).isEqualTo(0);
}
}
代码示例来源:origin: org.apache.axis2/axis2-saaj
public SOAPElement addChildElement(SOAPElement soapElement) throws SOAPException {
OMNamespace ns = omTarget.getOMFactory().createOMNamespace(soapElement.getNamespaceURI(),
soapElement.getPrefix());
SOAPHeaderBlock headerBlock = ((SOAPFactory)this.omTarget.getOMFactory()).createSOAPHeaderBlock(
soapElement.getLocalName(), ns, omTarget);
SOAPHeaderElementImpl soapHeaderElement = new SOAPHeaderElementImpl(headerBlock);
soapHeaderElement.setParentElement(this);
return soapHeaderElement;
}
代码示例来源:origin: apache/axis2-java
public SOAPElement addChildElement(SOAPElement soapElement) throws SOAPException {
OMNamespace ns = omTarget.getOMFactory().createOMNamespace(soapElement.getNamespaceURI(),
soapElement.getPrefix());
SOAPHeaderBlock headerBlock = ((SOAPFactory)this.omTarget.getOMFactory()).createSOAPHeaderBlock(
soapElement.getLocalName(), ns, omTarget);
SOAPHeaderElementImpl soapHeaderElement = new SOAPHeaderElementImpl(headerBlock);
soapHeaderElement.setParentElement(this);
return soapHeaderElement;
}
内容来源于网络,如有侵权,请联系作者删除!