final SOAPElement userToken = security.addChildElement("UsernameToken", "wsse"); userToken.addChildElement("Username", "wsse").addTextNode("MyWSSUsername"); userToken.addChildElement("Password", "wsse").addTextNode("MyWSSPassword");
header.addChildElement("Security", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"); security.addChildElement("UsernameToken", "wsse"); usernameToken.addAttribute(new QName("xmlns:wsu"), "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"); usernameToken.addChildElement("Username", "wsse"); username.addTextNode("test"); usernameToken.addChildElement("Password", "wsse"); password.setAttribute("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"); password.addTextNode("test321");
SOAPElement soapBodyElem = soapBody.addChildElement("VerifyEmail", "example"); SOAPElement soapBodyElem1 = soapBodyElem.addChildElement("email", "example"); soapBodyElem1.addTextNode("mutantninja@gmail.com"); SOAPElement soapBodyElem2 = soapBodyElem.addChildElement("LicenseKey", "example"); soapBodyElem2.addTextNode("123");
SOAPElement soapBodyElem = soapBody.addChildElement("VerifyEmail", "example"); SOAPElement soapBodyElem1 = soapBodyElem.addChildElement("email", "example"); soapBodyElem1.addTextNode("mutantninja@gmail.com"); SOAPElement soapBodyElem2 = soapBodyElem.addChildElement("LicenseKey", "example"); soapBodyElem2.addTextNode("123");
SOAPElement soapBodyElem = soapBody.addChildElement("VerifyEmail", "example"); SOAPElement soapBodyElem1 = soapBodyElem.addChildElement("email", "example"); soapBodyElem1.addTextNode("mutantninja@gmail.com"); SOAPElement soapBodyElem2 = soapBodyElem.addChildElement("LicenseKey", "example"); soapBodyElem2.addTextNode("123");
public SOAPElement addChildElement(String arg0, String arg1, String arg2) throws SOAPException { return delegateHeader.addChildElement(arg0, arg1, arg2); }
public SOAPElement addChildElement(String arg0, String arg1, String arg2) throws SOAPException { return delegateElement.addChildElement(arg0, arg1, arg2); }
public SOAPElement addChildElement(String arg0, String arg1) throws SOAPException { return delegateHeader.addChildElement(arg0, arg1); }
SOAPElement sigInfo = sigElem.addChildElement(new QName("SignedInfo")); SOAPElement canon = sigInfo.addChildElement(new QName("CanonicalizationMethod")); canon.addAttribute(soapFactory.createName("Algorithm"), Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS); //[continue adding the other elements...] //canonicalize the entire, completed 'SignedInfo' block byte[] bytesToSign = canonizer.canonicalizeSubtree(sigInfo);
// SOAP Body SOAPBody soapBody = envelope.getBody(); SOAPElement GetNGPList = soapBody.addChildElement("GetNGPList", "", "http://www.sigvalue.com/acc"); SOAPElement UserData = GetNGPList.addChildElement("UserData"); ...
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");
@Override protected void populateMessage(SOAPMessage message) throws SOAPException { SOAPElement rootElement = addRootElement( message, new QName(ActiveBPELRequestEntityBase.NS_ACTIVEBPEL_ADMIN, "terminateProcessInput")); SOAPElement pidElement = rootElement.addChildElement( new QName(ActiveBPELRequestEntityBase.NS_ACTIVEBPEL_ADMIN, "pid")); pidElement.setTextContent(Integer.toString(pid)); }
SOAPBody soapBody = envelope.getBody(); SOAPElement soapBodyElem = soapBody.addChildElement("search", "example"); /*"example"*/ SOAPElement soapBodyElem0 = soapBodyElem.addChildElement("arg0"); SOAPElement soapBodyElem1 = soapBodyElem0.addChildElement("name"); soapBodyElem1.addTextNode("test"); SOAPElement soapBodyElem2 = soapBodyElem0.addChildElement("number"); soapBodyElem2.addTextNode("5"); MimeHeaders headers = soapMessage.getMimeHeaders(); headers.addHeader("SOAPAction", serverURI + "search");
String token = "authentication token given from service"; SOAPFactory sf = SOAPFactory.newInstance(); SOAPElement authElement = sf.createElement(new QName("urn:example.com", "Authentication")); SOAPElement tokenElement = sf.createElement(new QName(null, "AuthenticationToken")); tokenElement.addTextNode(token); authElement.addChildElement(tokenElement); List<Header> headers = new ArrayList<Header>(); Header dummyHeader = new Header(new QName("urn:example.com"), authElement); headers.add(dummyHeader);
SOAPBody soapBody = envelope.getBody(); SOAPElement soapBodyElem = soapBody.addChildElement( "GetUserInfo" ); SOAPElement soapBodyElem1 = soapBodyElem.addChildElement( "ArgComKey", "", "xsd:integer" ); soapBodyElem1.addTextNode( "ComKey" ); SOAPElement soapBodyElem2 = soapBodyElem.addChildElement( "Arg" ); soapBodyElem2.addTextNode( "123" );
public void elementToSOAPElement(Element element, SOAPElement parent) throws SOAPException { Name name = createName(element); SOAPElement newChild = parent.addChildElement(name); addChildElements(element, newChild); }
SOAPEnvelope envelope = soapPart.getEnvelope(); envelope.addNamespaceDeclaration("xsi","http://www.w3.org/2001/XMLSchema-instance"); SOAPBody soapBody = envelope.getBody(); SOAPElement soapBodyElem = soapBody.addChildElement( "GetUserInfo" ); SOAPElement soapBodyElem1 = soapBodyElem.addChildElement( "ArgComKey" ); soapBodyElem1.addTextNode( "ComKey" ).setAttribute("xsi:type","xsd:integer"); SOAPElement soapBodyElem2 = soapBodyElem.addChildElement( "Arg" ); soapBodyElem2.addTextNode( "123" );
@Override protected void runTest() throws Throwable { SOAPElement parent = newSOAPFactory().createElement(new QName("parent")); SOAPElement child1 = parent.addChildElement(new QName("child1")); SOAPElement child2 = (SOAPElement)parent.getOwnerDocument().createElementNS(null, "child2"); child2.setParentElement(parent); NodeList children = parent.getChildNodes(); assertEquals(2, children.getLength()); assertSame(child1, children.item(0)); assertSame(child2, children.item(1)); } }
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 void addReplyTo(SOAPHeader header, ActivityContext context) throws HeaderProcessingException { try { SOAPElement replyTo = header.addChildElement(wsaQName(WSA_TAG_REPLY_TO)); SOAPElement address = replyTo.addChildElement(wsaQName(WSA_TAG_ADDRESS)); address.setTextContent(context.getPartnerURL()); } catch (SOAPException e) { throw new HeaderProcessingException( "Could not add ReplyTo header to outgoing SOAP message.", e); } }