Package javax.xml.soap

Examples of javax.xml.soap.Node


                                                   attrNode.getNodeValue());               
        }

        NodeList childNodes = node.getChildNodes();
        for (int i = 0; i < childNodes.getLength(); i++) {
            Node childSAAJNode = toSAAJNode(childNodes.item(i), saajEle);
            if (childSAAJNode instanceof javax.xml.soap.Text) {
                saajEle.addTextNode(childSAAJNode.getValue());
            } else {
                saajEle.addChildElement((javax.xml.soap.SOAPElement)childSAAJNode);
            }
        }
        return saajEle;
View Full Code Here


    private Iterator getChildren(Iterator childIter) {
        Collection childElements = new ArrayList();
        while (childIter.hasNext()) {
            org.w3c.dom.Node domNode = (org.w3c.dom.Node)childIter.next();
            Node saajNode = toSAAJNode(domNode);
            if (saajNode instanceof javax.xml.soap.Text) {
                childElements.add(saajNode);
            } else if (!(saajNode instanceof SOAPBodyElement)) {
                // silently replace node, as per saaj 1.2 spec
                if (domNode instanceof ElementImpl) {
View Full Code Here

   {
      log.trace("removeContents");
      Iterator it = getChildElements();
      while (it.hasNext())
      {
         Node el = (Node)it.next();
         el.detachNode();
      }
   }
View Full Code Here

      Iterator it = getChildElements();
      if (it.hasNext())
      {
         while (it.hasNext())
         {
            Node node = (Node)it.next();
            if (node instanceof SOAPElementImpl)
            {
               ((SOAPElementImpl)node).writeElement(out);
            }
            else if (node instanceof TextImpl)
            {
               ((TextImpl)node).writeNode(out);
            }
            else
            {
               throw new WSException("Unhandled soap node: " + node.getClass().getName());
            }
         }
      }
      else
      {
View Full Code Here

                String userName = null;
                String password = null;

                while (it.hasNext()) {
                    Node node = (Node) it.next();
                    if (node.getNamespaceURI() != null && node.getNamespaceURI().equals(NAMESPACE)) {
                        if (node.getNodeName().equals(userNameFieldName)) {
                            userName = node.getTextContent();
                        }
                        if (node.getNodeName().equals(passwordFieldName)) {
                            password = node.getTextContent();
                        }
                    }
                }
                if (userName == null || password == null) {
                    generateSOAPErrMessage(soapMsg,"As credenciais não foram encontradas na requisição");
View Full Code Here

       
        final NodeList digestMethodNodes =
            (NodeList) digestAlgoExpr.evaluate(signedDoc, XPathConstants.NODESET);
       
        for (int i = 0; i < digestMethodNodes.getLength(); i++) {
            Node node = (Node)digestMethodNodes.item(i);
            String digestAlgorithm = node.getAttributes().getNamedItem("Algorithm").getNodeValue();
            assertEquals(expectedDigestAlgorithm, digestAlgorithm);
        }
       
        // Canonicalization Algorithm
        final XPathExpression canonAlgoExpr =
View Full Code Here

        final NodeList strKeyIdNodes =
            (NodeList) strExpr.evaluate(signedDoc, XPathConstants.NODESET);
       
        String strId = null;
        for (int i = 0; i < strKeyIdNodes.getLength(); i++) {
            Node keyIdNode = (Node) strKeyIdNodes.item(i);
            String strKey = keyIdNode.getTextContent();
            if (strKey.equals(assertionId)) {
                Node strNode = (Node) keyIdNode.getParentNode();
                strId = strNode.getAttributes().
                    getNamedItemNS(nsContext.getNamespaceURI("wsu"), "Id").getNodeValue();
                break;
            }
        }
        assertNotNull("SecurityTokenReference for " + assertionId + " not found in security header.", strId);
       
        // Verify STR is included in the signature references
        final XPathExpression sigRefExpr = xpath.compile(
            "/s:Envelope/s:Header/wsse:Security/ds:Signature/ds:SignedInfo/ds:Reference");
       
        final NodeList sigReferenceNodes =
            (NodeList) sigRefExpr.evaluate(signedDoc, XPathConstants.NODESET);
       
        boolean foundStrReference = false;
        for (int i = 0; i < sigReferenceNodes.getLength(); i++) {
            Node sigRefNode = (Node) sigReferenceNodes.item(i);
            String sigRefURI = sigRefNode.getAttributes().getNamedItem("URI").getNodeValue();
            if (sigRefURI.equals("#" + strId)) {
                foundStrReference = true;
                break;
            }
        }
View Full Code Here

        assertSame(z1, z2)// should be same SAAJ Node

        assertEquals(((javax.xml.soap.Text)z1).getValue(),
                     ((javax.xml.soap.Text)z2).getValue());

        Node lastChildNode = (Node)soapEle.getLastChild();
        SOAPElement lastChildSOAPEle = (SOAPElement)lastChildNode;

        assertEquals("Child2", lastChildSOAPEle.getLocalName());
        assertEquals("http://test.apache.org/", lastChildSOAPEle.getNamespaceURI());
        assertEquals("ch", lastChildSOAPEle.getPrefix());
View Full Code Here

    private Text assertContainsText(SOAPElement soapElem) {
        assertTrue(soapElem.hasChildNodes());
        List childElems = toList(soapElem.getChildElements());
        assertTrue(childElems.size() == 1);
        Node node = (Node)childElems.get(0);
        assertTrue(node instanceof Text);
        return (Text)node;
    }
View Full Code Here

        Iterator childElements = soapEle.getChildElements(qname);


        int childCount = 0;
        while (childElements.hasNext()) {
            Node node = (Node)childElements.next();
            childCount++;
        }
        assertEquals(childCount, 2);
    }
View Full Code Here

TOP

Related Classes of javax.xml.soap.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.