public void setAttribute(String arg0, String arg1) throws DOMException { delegateElement.setAttribute(arg0, arg1); }
public void setAttribute(String arg0, String arg1) throws DOMException { delegateElement.setAttribute(arg0, arg1); }
public void setAttribute(String name, String value) throws DOMException { delegateElement.setAttribute(name, value); }
public void setAttribute(String arg0, String arg1) throws DOMException { delegateHeader.setAttribute(arg0, arg1); }
/** Set the qname value to the specified attribute of the given element. * @param value a namespace qualified name; its namespace name MUST NOT be empty */ public static void setQualifiedAttributeValue(SOAPElement element, String attributeName, QName value) throws SOAPException { String prefix = ensureNamespaceDeclared(element, value.getPrefix(), value.getNamespaceURI()); element.setAttribute(attributeName, prefix + ':' + value.getLocalPart()); }
public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs, NamespaceContext nsCtx) { SOAPFactory factory = getFactory(); SOAPElement element = null; try { String prefix = elementName.getPrefix(); String ns = elementName.getNamespaceURI(); if (ns != null && ns.length() > 0) { prefix = nsCtx.getPrefix(ns); } element = factory.createElement(elementName.getLocalPart(), prefix, ns); } catch (SOAPException e) { throw new IllegalStateException(e); } if (attrs != null) { for (int i = 0; i < attrs.getLength(); ++i) { element.setAttribute(attrs.getLocalName(i), attrs.getValue(i)); } } return element; }
SOAPHeaderElement wsseSecurity = new SOAPHeaderElement(new PrefixedQName("http://schemas.xmlsoap.org/ws/2002/07/secext","Security", "wsse")); wsseSecurity.setMustUnderstand(false); wsseSecurity.setActor(null); SOAPElement sub = wsseSecurity.addChildElement("UsernameToken"); sub.setAttribute("xmlns:wsu", "http://schemas.xmlsoap.org/ws/2002/07/utility"); SOAPElement userElement = sub.addChildElement("Username"); userElement.addTextNode("XYZ"); SOAPElement pwdElement = sub.addChildElement("Password"); pwdElement.setAttribute("Type", "wsse:PasswordText"); pwdElement.addTextNode("security"); _stub.setHeader(wsseSecurity);
private static void addHeader(Message m, Set<QName> notUnderstoodHeaders) throws SOAPException { for (QName qname : notUnderstoodHeaders) { SOAPElement soapEl = SOAP_12.getSOAPFactory().createElement(MU_HEADER_DETAIL); soapEl.addNamespaceDeclaration("abc", qname.getNamespaceURI()); soapEl.setAttribute("qname", "abc:" + qname.getLocalPart()); Header header = new DOMHeader<Element>(soapEl); m.getHeaders().add(header); } } }
private static void addHeader(Message m, Set<QName> notUnderstoodHeaders) throws SOAPException { for (QName qname : notUnderstoodHeaders) { SOAPElement soapEl = SOAP_12.getSOAPFactory().createElement(MU_HEADER_DETAIL); soapEl.addNamespaceDeclaration("abc", qname.getNamespaceURI()); soapEl.setAttribute("qname", "abc:" + qname.getLocalPart()); Header header = new DOMHeader<Element>(soapEl); m.getHeaders().add(header); } } }
private static void addHeader(Message m, Set<QName> notUnderstoodHeaders) throws SOAPException { for (QName qname : notUnderstoodHeaders) { SOAPElement soapEl = SOAP_12.getSOAPFactory().createElement(MU_HEADER_DETAIL); soapEl.addNamespaceDeclaration("abc", qname.getNamespaceURI()); soapEl.setAttribute("qname", "abc:" + qname.getLocalPart()); Header header = new DOMHeader<Element>(soapEl); m.getHeaders().add(header); } } }
public void setEncryptionMethod(String algorithmURI) throws XWSSecurityException { try { encryptionMethod = getSoapFactory().createElement( "EncryptionMethod", MessageConstants.XENC_PREFIX, MessageConstants.XENC_NS); } catch (SOAPException e) { log.log(Level.SEVERE, "WSS0351.error.setting.encryption.method", e.getMessage()); throw new XWSSecurityException(e); } encryptionMethod.setAttribute("Algorithm", algorithmURI); updateRequired = true; }
for (int x = 0; x < map.getLength(); x++) { String name = map.item(x).getNodeName(); newParent.setAttribute(name, map.item(x).getNodeValue());
/** * Given a binary token, create a {@link SOAPElement} * * @param token * * @return * * @throws SOAPException */ private SOAPElement create(String token) throws SOAPException { if (factory == null) { factory = SOAPFactory.newInstance(); } SOAPElement security = factory.createElement(Constants.WSSE_LOCAL, Constants.WSSE_PREFIX, Constants.WSSE_NS); if (valueTypeNamespace != null) { security.addNamespaceDeclaration(valueTypePrefix, valueTypeNamespace); } SOAPElement binarySecurityToken = factory.createElement(Constants.WSSE_BINARY_SECURITY_TOKEN, Constants.WSSE_PREFIX, Constants.WSSE_NS); binarySecurityToken.addTextNode(token); if (valueType != null && !valueType.isEmpty()) { binarySecurityToken.setAttribute(Constants.WSSE_VALUE_TYPE, valueType); } if (encodingType != null) { binarySecurityToken.setAttribute(Constants.WSSE_ENCODING_TYPE, encodingType); } security.addChildElement(binarySecurityToken); return security; }
/** * Given a binary token, create a {@link SOAPElement} * @param token * @return * @throws SOAPException */ private SOAPElement create(String token) throws SOAPException { if(factory == null) factory = SOAPFactory.newInstance(); SOAPElement security = factory.createElement(Constants.WSSE_LOCAL, Constants.WSSE_PREFIX, Constants.WSSE_NS); if (valueTypeNamespace != null) { security.addNamespaceDeclaration(valueTypePrefix, valueTypeNamespace); } SOAPElement binarySecurityToken = factory. createElement(Constants.WSSE_BINARY_SECURITY_TOKEN, Constants.WSSE_PREFIX, Constants.WSSE_NS); binarySecurityToken.addTextNode(token); if( valueType != null && !valueType.isEmpty()) { binarySecurityToken.setAttribute(Constants.WSSE_VALUE_TYPE, valueType); } if (encodingType != null) { binarySecurityToken.setAttribute(Constants.WSSE_ENCODING_TYPE, encodingType); } security.addChildElement(binarySecurityToken); return security; }
/** * Given a binary token, create a {@link SOAPElement} * * @param token * * @return * * @throws SOAPException */ private SOAPElement create(String token) throws SOAPException { if (factory == null) { factory = SOAPFactory.newInstance(); } SOAPElement security = factory.createElement(Constants.WSSE_LOCAL, Constants.WSSE_PREFIX, Constants.WSSE_NS); if (valueTypeNamespace != null) { security.addNamespaceDeclaration(valueTypePrefix, valueTypeNamespace); } SOAPElement binarySecurityToken = factory.createElement(Constants.WSSE_BINARY_SECURITY_TOKEN, Constants.WSSE_PREFIX, Constants.WSSE_NS); binarySecurityToken.addTextNode(token); if (valueType != null && !valueType.isEmpty()) { binarySecurityToken.setAttribute(Constants.WSSE_VALUE_TYPE, valueType); } if (encodingType != null) { binarySecurityToken.setAttribute(Constants.WSSE_ENCODING_TYPE, encodingType); } security.addChildElement(binarySecurityToken); return security; }
while(it.hasNext()) { SOAPElement elem=(SOAPElement)it.next(); elem.setAttribute("class",error.getClass().getName()); elem.removeContents(); elem.removeAttribute("note");
SOAPBody soapBody = envelope.getBody(); SOAPElement soapBodyElem = soapBody.addChildElement("Get_Workers_Request", "wd", "urn:com.workday/bsvc"); SOAPElement soapBodyElem1 = soapBodyElem.addChildElement("Request_References", "wd"); SOAPElement soapBodyElem2 = soapBodyElem1.addChildElement("Worker_Reference", "wd"); SOAPElement soapBodyElem3 = soapBodyElem2.addChildElement("ID", "wd"); soapBodyElem3.setAttribute("wd:type", "Employee_ID"); soapBodyElem3.addTextNode("123");
public SOAPElement getCipherReference(boolean create, String uri) throws XWSSecurityException { SOAPElement cipherReference = null; if (create) { try { cipherReference = getSoapFactory().createElement( "CipherReference", MessageConstants.XENC_PREFIX, MessageConstants.XENC_NS); cipherReference.setAttribute("URI", uri); getCipherData(create).addChildElement(cipherReference); } catch (SOAPException e) { // log throw new XWSSecurityException(e); } } else { if (cipherData == null) { // log throw new XWSSecurityException("CipherData is not present"); } // need to check //Iterator i = cipherData.getChildElements(); //cipherReference = (SOAPElement)i.next(); NodeList nl = cipherData.getElementsByTagNameNS(MessageConstants.XENC_NS, "CipherReference"); if(nl.getLength() > 0)return (SOAPElement)nl.item(0); } return cipherReference; }
public void addTransform(String algorithmURI) throws XWSSecurityException { SOAPElement cipherReference = getCipherReference(false, null); try { SOAPElement dsTransform = getSoapFactory().createElement( "Transform", MessageConstants.DSIG_PREFIX, MessageConstants.DSIG_NS); dsTransform.setAttribute("Algorithm", algorithmURI); // need to check SOAPElement xencTransforms = null; Iterator i = cipherReference.getChildElements(); if (i==null || !i.hasNext()) { xencTransforms = getSoapFactory().createElement( "Transforms", MessageConstants.XENC_PREFIX, MessageConstants.XENC_NS); xencTransforms = cipherReference.addChildElement(xencTransforms); } else xencTransforms = (SOAPElement)i.next(); xencTransforms.addChildElement(dsTransform); } catch (SOAPException e) { // log throw new XWSSecurityException(e); } }
password.setAttribute("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"); password.addTextNode(dig);