Package org.apache.axis.message

Examples of org.apache.axis.message.SOAPEnvelope.addBodyElement()


                serverContext.setResponseMessage(respMsg);
            } else {
                SOAPFault faultEl = new SOAPFault(fault);
                SOAPEnvelope env = respMsg.getSOAPEnvelope();
                env.clearBody();
                env.addBodyElement(faultEl);
            }
        }

        // copy back the response, and force its format to String in order to
        // exercise the deserializers.
View Full Code Here


      // this child to the soap response body.

      response = (Element)element.getFirstChild();     
      SOAPBodyElement soapRespBody = new SOAPBodyElement(response);
      SOAPEnvelope soapRespEnv = soapResponse.getSOAPEnvelope();
      soapRespEnv.addBodyElement(soapRespBody);      
    }
    catch(Exception ex)
    {
      log.error(ex.getMessage(),ex);
View Full Code Here

    public void output(SerializationContext context) throws Exception {

        SOAPEnvelope envelope = new SOAPEnvelope();

        SOAPFault fault = new SOAPFault(this);
        envelope.addBodyElement(fault);

        // add any headers we need
        if (faultHeaders != null) {
            for (Iterator i = faultHeaders.iterator(); i.hasNext();) {
                SOAPHeaderElement header = (SOAPHeaderElement) i.next();
View Full Code Here

                    responseMsg = new Message(af);
                } else {
                    try {
                        SOAPEnvelope env = responseMsg.getSOAPEnvelope();
                        env.clearBody();
                        env.addBodyElement(new SOAPFault((AxisFault) e));
                    } catch (AxisFault fault) {
                        // Should never reach here!
                    }
                }
            }
View Full Code Here

       Element operationWrapper = doc.createElementNS("urn:operationNS","operation");
       doc.appendChild(operationWrapper);
       Node node = doc.importNode(element,true);
       operationWrapper.appendChild(node);

       message.addBodyElement(new SOAPBodyElement(operationWrapper));
      
       StringWriter stringWriter = new StringWriter();
       SerializationContext context = new SerializationContextImpl(stringWriter, messageContext);
       context.setDoMultiRefs(false);
       message.output(context);
View Full Code Here

        if (currentForm == FORM_BODYINSTREAM) {
            InputStreamBody bodyEl =
                             new InputStreamBody((InputStream)currentMessage);
            SOAPEnvelope env = new SOAPEnvelope();
            env.addBodyElement(bodyEl);
            setCurrentForm(env, FORM_SOAPENVELOPE);
            return env;
        }

        InputSource is;
View Full Code Here

        data.stringMember = "String member";
        data.floatMember = new Float("4.54");

        RPCParam arg2 = new RPCParam("", "struct", data);
        RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[]{ arg1, arg2 });
        msg.addBodyElement(body);

        Writer stringWriter = new StringWriter();
        SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
        context.setDoMultiRefs(multiref);
View Full Code Here

        try {
            SOAPEnvelope env = new SOAPEnvelope();
            RPCElement method = new RPCElement("ns",
                                               "method",
                                               new Object [] { "argument" });
            env.addBodyElement(method);
            String soapStr = env.toString();
        } catch (Exception e) {
            fail(e.getMessage());
        }
View Full Code Here

            SOAPEnvelope msg = new SOAPEnvelope();
            RPCParam arg1 = new RPCParam("urn:myNamespace", "testParam", document.getFirstChild());
            arg1.setXSITypeGeneration(Boolean.FALSE);

            RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[] { arg1 });
            msg.addBodyElement(body);
            body.setEncodingStyle(Constants.URI_LITERAL_ENC);

            SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
            msg.output(context);
View Full Code Here

        String xml = "<m:testEnvelope xmlns:m=\"http://db.com\"></m:testEnvelope>";
        Document doc = XMLUtils.newDocument(new ByteArrayInputStream(xml.getBytes()));
        SOAPBodyElement body = new SOAPBodyElement(doc.getDocumentElement());
        SOAPEnvelope env = new SOAPEnvelope();
        env.addBodyElement(body);
        SOAPEnvelope result = call.invoke( env );
        assertNotNull("Return was null!", result);
        Vector headers = result.getHeaders();
        assertEquals("Had " + headers.size() + " headers, needed 1", 1, headers.size());
        SOAPHeaderElement firstHeader = (SOAPHeaderElement)headers.get(0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.