Package org.apache.axis.message

Examples of org.apache.axis.message.RPCElement


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


        msgContext.setTargetService(SOAPAction);

        // Construct the soap request
        SOAPEnvelope envelope = new SOAPEnvelope();
        msgContext.setRequestMessage(new Message(envelope));
        RPCElement body = new RPCElement(methodNS, method, parms);
        envelope.addBodyElement(body);

        // Invoke the Axis engine
        engine.invoke(msgContext);

        // Extract the response Envelope
        Message message = msgContext.getResponseMessage();
        envelope = (SOAPEnvelope)message.getSOAPPart().getAsSOAPEnvelope();
        assertNotNull("SOAP envelope was null", envelope);

        // Extract the body from the envelope
        body = (RPCElement)envelope.getFirstBody();
        assertNotNull("SOAP body was null", body);

        // Extract the list of parameters from the body
        Vector arglist = body.getParams();
        assertNotNull("SOAP argument list was null", arglist);
        if (arglist.size()==0) return null;

        // Return the first parameter
        RPCParam param = (RPCParam) arglist.get(0);
View Full Code Here

     */
    public String argAsDOM(Data input) throws Exception {

       // get the first parameter
       Message message = MessageContext.getCurrentContext().getRequestMessage();
       RPCElement body = (RPCElement)message.getSOAPPart().getAsSOAPEnvelope().getFirstBody();
       NodeList parms = body.getAsDOM().getChildNodes();
       Node parm1 = null;
       for (int i=0; i<parms.getLength(); i++) {
           parm1 = parms.item(i);
           if (parm1.getNodeType() == Node.ELEMENT_NODE) break;
       }
View Full Code Here

        assertNotNull("Response message was null!", message);
        SOAPEnvelope envelope = (SOAPEnvelope)message.getSOAPPart().getAsSOAPEnvelope();
        assertNotNull("SOAP envelope was null", envelope);

        // Extract the body from the envelope
        RPCElement body = (RPCElement)envelope.getFirstBody();
        assertNotNull("SOAP body was null", body);

        // Extract the list of parameters from the body
        Vector arglist = body.getParams();
        assertNotNull("SOAP argument list was null", arglist);
        assertTrue("param.size()<=0 {Should be > 0}", arglist.size()>0);

        // Return the first parameter
        RPCParam param = (RPCParam) arglist.get(0);
View Full Code Here

        this.handlerInfos = handlerInfos;
    }

    public void processMessage(final MessageContext msgContext, final SOAPEnvelope reqEnv, final SOAPEnvelope resEnv, final Object obj) throws Exception {

        final RPCElement body = getBody(reqEnv, msgContext);
        final OperationDesc operation = getOperationDesc(msgContext, body);

        final AxisRpcInterceptor interceptor = new AxisRpcInterceptor(operation, msgContext);
        final SOAPMessage message = msgContext.getMessage();
View Full Code Here

            }

            try {
                final Message reqMsg = messageContext.getRequestMessage();
                final SOAPEnvelope requestEnvelope = reqMsg.getSOAPEnvelope();
                final RPCElement body = getBody(requestEnvelope, messageContext);
                body.setNeedDeser(true);
                Vector args = null;
                try {
                    args = body.getParams();
                } catch (final SAXException e) {
                    if (e.getException() != null) {
                        throw e.getException();
                    }
                    throw e;
View Full Code Here

            }

            Object result = null;

            if (bodyEl instanceof RPCElement) {
                final RPCElement body = (RPCElement) bodyEl;
                body.setNeedDeser(true);
                Vector args = null;
                try {
                    args = body.getParams();
                } catch (final SAXException e) {
                    if (e.getException() != null) {
                        throw e.getException();
                    }
                    throw e;
View Full Code Here

        public void createResult(final Object object) {
            messageContext.setPastPivot(true);
            try {
                final Message requestMessage = messageContext.getRequestMessage();
                final SOAPEnvelope requestEnvelope = requestMessage.getSOAPEnvelope();
                final RPCElement requestBody = getBody(requestEnvelope, messageContext);

                final Message responseMessage = messageContext.getResponseMessage();
                final SOAPEnvelope responseEnvelope = responseMessage.getSOAPEnvelope();
                final ServiceDesc serviceDescription = messageContext.getService().getServiceDescription();
                final RPCElement responseBody = createResponseBody(requestBody, messageContext, operation, serviceDescription, object, responseEnvelope, getInOutParams());

                responseEnvelope.removeBody();
                responseEnvelope.addBodyElement(responseBody);
            } catch (final Exception e) {
                throw new ServerRuntimeException("Failed while creating response message body", e);
View Full Code Here

        this.handlerInfos = handlerInfos;
    }

    public void processMessage(MessageContext msgContext, SOAPEnvelope reqEnv, SOAPEnvelope resEnv, Object obj) throws Exception {

        RPCElement body = getBody(reqEnv, msgContext);
        OperationDesc operation = getOperationDesc(msgContext, body);

        AxisRpcInterceptor interceptor = new AxisRpcInterceptor(operation, msgContext);
        SOAPMessage message = msgContext.getMessage();
View Full Code Here

            }

            try {
                Message reqMsg = messageContext.getRequestMessage();
                SOAPEnvelope requestEnvelope = reqMsg.getSOAPEnvelope();
                RPCElement body = getBody(requestEnvelope, messageContext);
                body.setNeedDeser(true);
                Vector args = null;
                try {
                    args = body.getParams();
                } catch (SAXException e) {
                    if (e.getException() != null) {
                        throw e.getException();
                    }
                    throw e;
View Full Code Here

TOP

Related Classes of org.apache.axis.message.RPCElement

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.