Package javax.xml.soap

Examples of javax.xml.soap.SOAPElement


           short nodeType = node != null ? node.getNodeType() : -100;
           if (Node.ELEMENT_NODE == nodeType)
           {
              Element el = (Element)node;
              Name name = factory.createName(el.getNodeName(), prefix,uddins);
              SOAPElement attachedEl = bodyElement.addChildElement(name);
              appendAttributes(attachedEl, el.getAttributes(), factory);
              appendElements(attachedEl, el.getChildNodes(), factory);
           } else if (nodeType == Node.TEXT_NODE)
           {
               bodyElement.addTextNode(node.getNodeValue());
View Full Code Here


           short nodeType = node != null ? node.getNodeType() : -100;
           if (Node.ELEMENT_NODE == nodeType)
           {
              Element el = (Element)node;
              Name name = factory.createName(el.getNodeName(), prefix,uddins);
              SOAPElement attachedEl = bodyElement.addChildElement(name);
              appendAttributes(attachedEl, el.getAttributes(), factory);
              appendElements(attachedEl, el.getChildNodes(), factory);
           } else if (nodeType == Node.TEXT_NODE)
           {
               bodyElement.addTextNode(node.getNodeValue());
View Full Code Here

                                           "ns1" );
            QName responseName = new QName( "http://soap.jax.drools.org/",
                                            "return",
                                            "ns1" );
            SOAPBodyElement payload = body.addBodyElement( payloadName );
            SOAPElement response = payload.addChildElement( responseName );
            //Bad Hack - Need to remote it and fix it in Camel (if it's a camel problem)
            // response.addTextNode( StringUtils.toString( is ) );
            response.addTextNode( results );
            exchange.getOut().setBody( soapMessage );
        }
    }
View Full Code Here

                                       "ns1" );
        QName responseName = new QName( "http://soap.jax.drools.org/",
                                        "return",
                                        "ns1" );
        SOAPBodyElement payload = soapBody.addBodyElement( payloadName );
        SOAPElement response = payload.addChildElement( responseName );
        response.addTextNode( StringUtils.toString( bais ) );

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        soapMessage.writeTo( baos );

        exchange.getOut().setBody( new String( baos.toByteArray() ) );
View Full Code Here

        if (omElement.getBuilder() == null) {
            reader = omElement.getXMLStreamReader();
        } else {
            reader = omElement.getXMLStreamReaderWithoutCaching();
        }
        SOAPElement env = parent;
        while (env != null && !(env instanceof SOAPEnvelope)) {
            env = env.getParentElement();
        }
        if (env == null) {
            throw ExceptionFactory
                    .makeWebServiceException(Messages.getMessage("SAAJConverterErr1"));
        }
View Full Code Here

        // Unfortunately, the SAAJ object is a product of both the
        // QName of the element and the parent object.  For example,
        // All element children of a SOAPBody must be object's that are SOAPBodyElements.
        // createElement creates the proper child element.
        QName qName = reader.getName();
        SOAPElement child = createElement(parent, qName);

        // Update the tag data on the child
        updateTagData(nc, child, reader, true);
        return child;
    }
View Full Code Here

     * @param name   Name
     * @return
     */
    protected SOAPElement createElement(SOAPElement parent, QName qName)
            throws SOAPException {
        SOAPElement child;
        if (parent instanceof SOAPEnvelope) {
            if (qName.getNamespaceURI().equals(parent.getNamespaceURI())) {
                if (qName.getLocalPart().equals("Body")) {
                    child = ((SOAPEnvelope)parent).addBody();
                } else {
View Full Code Here

             
              SOAPFault fault = body.getFault();
               
                Iterator itr = fault.getChildElements();
                while (itr.hasNext()) {
                    SOAPElement se = (SOAPElement) itr.next();
                    if (se.getLocalName().equals(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME)) {
                      if (log.isDebugEnabled()) {
                        log.debug("Converting: faultcode");
                      }
                      // Axis2 SAAJ stores the acutal faultcode text under a SOAPFaultValue object, so we have to
                        // get that and add it as a text node under the original element.
                        Node value = se.getFirstChild();
                        if (value != null && value instanceof org.apache.axis2.saaj.SOAPElementImpl) {
                            org.apache.axis2.saaj.SOAPElementImpl<?> valueElement = (org.apache.axis2.saaj.SOAPElementImpl<?>) value;
                            OMElement e = valueElement.getOMTarget();
                            String content = e.getText();
                           
                            SOAPElement child = fault.addChildElement(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME));
                            child.addTextNode(content);
                           
                            se.detachNode();
                        }
                    }
                    else if (se.getLocalName().equals(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME)) {
                      if (log.isDebugEnabled()) {
                        log.debug("Converting: detail");
                      }
                        se.setElementQName(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
                    }
                    else if (se.getLocalName().equals(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME)) {
                      if (log.isDebugEnabled()) {
                        log.debug("Converting: faultstring");
                      }
                        se.setElementQName(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME));
                        // Axis2 SAAJ stores the acutal faultstring text under a SOAPFaultValue object, so we have to
                        // get that and add it as a text node under the original element.
                        Node value = se.getFirstChild();
                        if (value != null && value instanceof org.apache.axis2.saaj.SOAPElementImpl) {
                            org.apache.axis2.saaj.SOAPElementImpl<?> valueElement = (org.apache.axis2.saaj.SOAPElementImpl<?>) value;
                            OMElement e = valueElement.getOMTarget();
                            String content = e.getText();
                          
                            SOAPElement child = fault.addChildElement(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME));
                            child.addTextNode(content);
                           
                            se.detachNode();
                        }
                    }
                }
View Full Code Here

      Object responsePojo = null;
     
      while (iterator.hasNext()) {
        Object next = iterator.next();
        if (next instanceof SOAPElement) {
          SOAPElement soapElement = (SOAPElement) next;
          QName qname = soapElement.getElementQName();
            if (AUTHENTICATE_QNAME.equals(qname)) {
              authResponse = handleAuthRequest(soapElement);
              break;
            } else if (MYVILLAGE_SIGNUP_QNAME.equals(qname)) {
              responsePojo = handleMyVillageSignupRequest(soapElement);
View Full Code Here

        // Inform handler that subsequent elements come from
        // the header
        try {
            handler.setHeaderElement(true);
            // Get the soap envelope
            SOAPElement envelope = getParentElement();
            while (envelope != null &&
                   !(envelope instanceof SOAPEnvelope)) {
                envelope = envelope.getParentElement();
            }
            if (envelope == null)
                return;
           
            // Find parameters that have instance
View Full Code Here

TOP

Related Classes of javax.xml.soap.SOAPElement

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.