本文整理了Java中javax.xml.soap.SOAPElement.setValue()
方法的一些代码示例,展示了SOAPElement.setValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SOAPElement.setValue()
方法的具体详情如下:
包路径:javax.xml.soap.SOAPElement
类名称:SOAPElement
方法名:setValue
暂无
代码示例来源:origin: com.hynnet/xws-security
public void setValue(String string) {
delegateElement.setValue(string);
}
代码示例来源:origin: org.springframework.ws/org.springframework.ws
@Override
public void setText(SOAPElement element, String content) {
element.setValue(content);
}
代码示例来源:origin: org.springframework.ws/org.springframework.ws
@Override
public void setText(SOAPElement element, String content) {
element.setValue(content);
}
代码示例来源:origin: com.hynnet/xws-security
public void setValue(String arg0) {
delegateElement.setValue(arg0);
}
代码示例来源:origin: com.hynnet/xws-security
public void setValue(String arg0) {
delegateHeader.setValue(arg0);
}
代码示例来源:origin: com.hynnet/xws-security
public void setValue(String arg0) {
delegateElement.setValue(arg0);
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
/** Set the qname value to the given element.
* @param value a namespace qualified name; its namespace name MUST NOT be empty
*/
public static void setQualifiedElementValue(SOAPElement element, QName value) throws SOAPException
{
String prefix = ensureNamespaceDeclared(element, value.getPrefix(), value.getNamespaceURI());
element.setValue(prefix + ':' + value.getLocalPart());
}
代码示例来源:origin: de.holisticon.util.tracee/tracee-jaxws
/**
* Renders a given context map into a given soapHeader.
*/
public void renderTo(Map<String, String> context, SOAPHeader soapHeader) throws SOAPException {
// create soap header element for tracee entries
final SOAPHeaderElement soapHeaderElement = soapHeader.addHeaderElement(
TraceeWsHandlerConstants.TRACEE_SOAP_HEADER_QNAME);
// loop over context attributes and add them to the header
for (final Map.Entry<String, String> entry : context.entrySet()) {
final SOAPElement traceeSoapHeaderElement = soapHeaderElement.addChildElement(entry.getKey());
traceeSoapHeaderElement.setValue(entry.getValue());
}
}
}
代码示例来源:origin: nl.psek.fitnesse/psek-fitnesse-fixtures-general
private void addElementToElement(String parentIdentifier, String childIdentifier, Name childElementName, String value) throws SOAPException {
SOAPElement parentElement = findElement(parentIdentifier);
SOAPElement childElement = parentElement.addChildElement(childElementName);
if (!attributes.isEmpty()) {
for (HashMap.Entry<QName, String> entry : attributes.entrySet()) {
childElement.addAttribute(entry.getKey(), entry.getValue());
}
}
//clear the attributes HashMap after they have been used
clearAttributes();
if (value != null && value.length() > 0) {
childElement.setValue(value);
}
this.elements.put(parentIdentifier.concat(".").concat(childIdentifier), childElement);
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
private void setFaultStringInternal(String faultString) throws SOAPException
{
if (faultstring == null)
{
findFaultStringElement();
if (faultstring == null)
faultstring = addUnqualifiedFaultElement("faultstring");
}
faultstring.setValue(faultString);
}
代码示例来源:origin: com.vmware.photon.controller/photon-vsphere-adapter-util
@Override
public boolean handleMessage(SOAPMessageContext smc) {
if (isOutgoingMessage(smc)) {
try {
SOAPHeader header = getSOAPHeader(smc);
SOAPElement vcsessionHeader =
header.addChildElement(new javax.xml.namespace.QName("#",
"vcSessionCookie"));
vcsessionHeader.setValue(this.vcSessionCookie);
} catch (DOMException e) {
throw new RuntimeException(e);
} catch (SOAPException e) {
throw new RuntimeException(e);
}
}
return true;
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
public void setFaultRole(String uri) throws SOAPException
{
if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "NOT_SUPPORT_ROLE"));
if (faultactor == null)
{
findRoleElement();
if (faultactor == null)
faultactor = addQualifiedFaultElement("Role");
}
faultactor.setValue(uri);
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
public void setFaultNode(String uri) throws SOAPException
{
if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "NOT_SUPPORT_NODE"));
if (faultnode == null)
{
findNodeElement();
if (faultnode == null)
faultnode = addQualifiedFaultElement("Node");
}
faultnode.setValue(uri);
}
代码示例来源:origin: org.fabric3/fabric3-binding-ws-metro
/**
* Per the SCA WS Binding spec, returns WSA ReferenceParameters from the original message if present.
*
* @param soapContext the SOAP context
* @param workContext the work context
* @throws SOAPException if there is an error setting the parameters header.
*/
@SuppressWarnings("unchecked")
private void handleReferenceParameters(SOAPMessageContext soapContext, WorkContext workContext) throws SOAPException {
Map<QName, String> parameters = workContext.getHeader(Map.class, CallbackConstants.REFERENCE_PARAMETERS);
if (parameters == null) {
return;
}
SOAPHeader soapHeader = soapContext.getMessage().getSOAPHeader();
for (Map.Entry<QName, String> entry : parameters.entrySet()) {
SOAPElement headerElement = soapHeader.addHeaderElement(entry.getKey());
headerElement.setValue(entry.getValue());
}
}
代码示例来源:origin: net.servicegrid/jp.go.nict.langrid.commons
@Override
public boolean add(RpcHeader e) {
try {
header.addChildElement(e.getName(), "ns", e.getNamespace()).setValue(e.getValue());
} catch (SOAPException e1) {
throw new RuntimeException(e1);
}
return true;
}
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
/** Sets this SOAPFault object with the given fault actor.
*/
public void setFaultActor(String faultActor) throws SOAPException
{
if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI()))
{
if (faultactor == null)
{
findFaultActorElement();
if (faultactor == null)
faultactor = addUnqualifiedFaultElement("faultactor");
}
faultactor.setValue(faultActor);
}
else setFaultRole(faultActor);
}
代码示例来源:origin: org.switchyard.components/switchyard-component-soap
private void copyToSOAPHeader(SOAPHeader soapHeader, Property property) throws IOException, SOAPException {
if ((property != null) && (matches(property.getName(), getIncludeRegexes(), new ArrayList<Pattern>()))) {
String v = property.getValue().toString();
QName qname = new QName(HEADER_NAMESPACE_PROPAGATION, property.getName());
if (SOAPHeadersType.XML.equals(_soapHeadersType)) {
try {
Element xmlElement = new ElementPuller().pull(new StringReader(v));
Node xmlNode = soapHeader.getOwnerDocument().importNode(xmlElement, true);
soapHeader.appendChild(xmlNode);
} catch (Throwable t) {
soapHeader.addChildElement(qname).setValue(v);
}
} else {
soapHeader.addChildElement(qname).setValue(v);
}
}
}
}
代码示例来源:origin: org.fabric3/fabric3-binding-ws-metro
/**
* Per the SCA WS Binding spec, sends a RelatesTo based on the original message id if one was sent.
*
* @param soapContext the SOAP context
* @param workContext the work context
* @throws SOAPException if there is an error setting the relatesTo header.
*/
private void handleRelatesToHeader(SOAPMessageContext soapContext, WorkContext workContext) throws SOAPException {
String messageId = workContext.getHeader(String.class, CallbackConstants.MESSAGE_ID);
if (messageId == null) {
return;
}
SOAPHeader soapHeader = soapContext.getMessage().getSOAPHeader();
SOAPElement relatesToHeader = soapHeader.addHeaderElement(WSA_RELATES_TO);
relatesToHeader.setValue(messageId);
relatesToHeader.addAttribute(WSA_RELATIONSHIP_TYPE, SCA_CALLBACK_RELATIONSHIP);
}
代码示例来源:origin: stackoverflow.com
SOAPMessage sm = MessageFactory.newInstance().createMessage();
sm.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
sm.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "UTF-8");
SOAPPart sp = sm.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
se.setEncodingStyle("http://schemas.xmlsoap.org/soap/encoding/");
se.setAttribute("xmlns:SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/");
se.setAttribute("xmlns:soa", "http://www.sbg.com");
SOAPBody sb = sm.getSOAPBody();
SOAPBodyElement el = sb.addBodyElement(new QName("http://www.sbg.com", "response", "soa"));
el.setAttribute("_ctxID", "cid=xref_members,cn=admin");
el.setAttribute("status", "OK");
SOAPElement in = el.addChildElement("response_code");
in.setValue("0000");
sm.writeTo(System.out);
代码示例来源:origin: org.keycloak/keycloak-saml-adapter-core
private void createEcpRequestHeader(SOAPEnvelope envelope) throws SOAPException {
SOAPHeader headers = envelope.getHeader();
SOAPHeaderElement ecpRequestHeader = headers.addHeaderElement(envelope.createQName(JBossSAMLConstants.REQUEST.get(), NS_PREFIX_PROFILE_ECP));
ecpRequestHeader.setMustUnderstand(true);
ecpRequestHeader.setActor("http://schemas.xmlsoap.org/soap/actor/next");
ecpRequestHeader.addAttribute(envelope.createName("ProviderName"), deployment.getEntityID());
ecpRequestHeader.addAttribute(envelope.createName("IsPassive"), "0");
ecpRequestHeader.addChildElement(envelope.createQName("Issuer", "saml")).setValue(deployment.getEntityID());
ecpRequestHeader.addChildElement(envelope.createQName("IDPList", "samlp"))
.addChildElement(envelope.createQName("IDPEntry", "samlp"))
.addAttribute(envelope.createName("ProviderID"), deployment.getIDP().getEntityID())
.addAttribute(envelope.createName("Name"), deployment.getIDP().getEntityID())
.addAttribute(envelope.createName("Loc"), deployment.getIDP().getSingleSignOnService().getRequestBindingUrl());
}
内容来源于网络,如有侵权,请联系作者删除!