Package javax.xml.soap

Examples of javax.xml.soap.SOAPBody


        return message;
    }

    public SOAPMessage generateResponse(Operation op, Object result) throws SOAPException {
        SOAPMessage message = messageFactory.createMessage();
        SOAPBody body = message.getSOAPPart().getEnvelope().getBody();

        XMLDescriptor descriptor = resultDescriptors.get(op.getName());
        SOAPResponse response = null;
        try {
            response = (SOAPResponse) descriptor.getJavaClass().newInstance();
View Full Code Here


            SOAPEnvelope responseEnvelope = getResponseEnvelope( (SOAPMessageContext) messageContext );
            List responseBodyElems = (List) messageContext.getProperty( WSRF_RESPONSE_XMLOBJECT_LIST );
            LOG.debug( MSG.getMessage( Keys.FOUND_RESP_ELEMS, Integer.toString( responseBodyElems.size() ) ) );
            if ( responseBodyElems != null )
            {
                SOAPBody responseBody = responseEnvelope.getBody();
                for ( int i = 0; i < responseBodyElems.size(); i++ )
                {
                    XmlObject responseBodyElem = (XmlObject) responseBodyElems.get( i );
                    SOAPBodyElement[] soapBodyElements = createSOAPBodyElements( responseBodyElem );
                    for ( int j = 0; j < soapBodyElements.length; j++ )
                    {
                        SOAPBodyElement soapBodyElement = soapBodyElements[j];
                        responseBody.addChildElement( soapBodyElement );
                    }
                }
            }
            if ( LOG.isDebugEnabled() )
            {
View Full Code Here

                     * msg.writeTo(System.out);
                     * System.out.println("-----------soap---------");
                     */

                    SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
                    SOAPBody body = env.getBody();
                    Iterator it = body.getChildElements();
                    while (it.hasNext()) {
                       
                        Object elem = it.next();
                        if (elem instanceof SOAPElement) {

                            Iterator it2 = ((SOAPElement)elem).getChildElements();
                            while (it2.hasNext()) {
                                Object elem2 = it2.next();
                                if (elem2 instanceof SOAPElement) {
                                    String value = ((SOAPElement)elem2).getValue();
                                    String name = ((SOAPElement)elem2).getLocalName();
                                    if (name.indexOf("arg0") >= 0 && value.equalsIgnoreCase("11")) {
                                        value = "12";
                                        ((SOAPElement)elem2).setValue(value);
                                    }
                                    if (name.indexOf("arg1") >= 0 && value.equalsIgnoreCase("21")) {
                                        value = "22";
                                        ((SOAPElement)elem2).setValue(value);
                                    }
                                }
                            }
                        }
                    }
                    msg.saveChanges();          
                } else {
                    SOAPMessage msg = ctx.getMessage();
                    /*
                     * System.out.println("-----------soap---------");
                     * msg.writeTo(System.out);
                     * System.out.println("-----------soap---------");
                     */

                    SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
                    SOAPBody body = env.getBody();
                    Iterator it = body.getChildElements();
                    while (it.hasNext()) {
                       
                        Object elem = it.next();
                        if (elem instanceof SOAPElement) {

View Full Code Here

      children = new ArrayList(  );

      SOAPEnvelope soap_env = (SOAPEnvelope) soap_elem;
      SOAPHeader   header = null;
      SOAPBody     body   = null;

      try
      {
         header    = soap_env.getHeader(  );
         body      = soap_env.getBody(  );
View Full Code Here

            throw new RuntimeException("No Operation Name");
        }
       
        SOAPMessage response = null;       
        try {
            SOAPBody body = request.getSOAPBody();
            Node n = body.getFirstChild();

            while (n.getNodeType() != Node.ELEMENT_NODE) {
                n = n.getNextSibling();
            }
            if (n.getLocalName().equals(sayHi.getLocalPart())) {
View Full Code Here

            msg.put(WSHandlerConstants.RECV_RESULTS, results);
        }
        WSHandlerResult rResult = new WSHandlerResult(actor, wsResult);
        results.add(0, rResult);

        SOAPBody body = doc.getSOAPBody();

        XMLStreamReader reader = StaxUtils.createXMLStreamReader(new DOMSource(body));
        // advance just past body
        int evt = reader.next();
        int i = 0;
View Full Code Here

            SOAPMessage message = ((SOAPMessageContext) soapMessage).getMessage();
            if (message == null || message.getSOAPPart() == null) {
                operationName = null;
                parameterNames = null;
            } else {
                SOAPBody body = getBody(message);

                SOAPElement operation = ((SOAPElement) body.getChildElements().next());
                this.operationName = operation.getElementName().toString();

                this.parameterNames = new ArrayList();
                for (Iterator i = operation.getChildElements(); i.hasNext();) {
                    SOAPElement parameter = (SOAPElement) i.next();
View Full Code Here

            if (operationName == null) {
                return message == null || message.getSOAPPart() == null;
            }

            SOAPBody body = getBody(message);

            // Handlers can't change the operation
            SOAPElement operation = ((SOAPElement) body.getChildElements().next());
            if (!this.operationName.equals(operation.getElementName().toString())) {
                return false;
            }

            Iterator parameters = operation.getChildElements();
View Full Code Here

    }
   
    public SOAPMessage invoke(SOAPMessage request) {
        SOAPMessage response = null;       
        try {
            SOAPBody body = request.getSOAPBody();
            Node n = body.getFirstChild();

            while (n.getNodeType() != Node.ELEMENT_NODE) {
                n = n.getNextSibling();
            }
            if (n.getLocalName().equals(sayHi.getLocalPart())) {
View Full Code Here

        try {
            SOAPMessage msg = sm.getMessage();
            if (msg == null) {
                return null;
            }
            SOAPBody body = msg.getSOAPBody();
            if (body == null) {
                return null;
            }
            org.w3c.dom.Node nd = body.getFirstChild();
            while (nd != null && !(nd instanceof org.w3c.dom.Element)) {
                nd = nd.getNextSibling();
            }
            if (nd != null) {
                return new QName(nd.getNamespaceURI(), nd.getLocalName());
View Full Code Here

TOP

Related Classes of javax.xml.soap.SOAPBody

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.