Package org.apache.axis.message

Examples of org.apache.axis.message.RPCElement


        context.setProperty(Constants.MC_NO_OPERATION_OK, Boolean.TRUE);

        SOAPEnvelope envelope = (SOAPEnvelope)message.getSOAPEnvelope();
        assertNotNull("SOAP envelope should not be null", envelope);

        RPCElement body = (RPCElement)envelope.getFirstBody();
        assertNotNull("SOAP body should not be null", body);

        Vector arglist = body.getParams();
        assertNotNull("arglist", arglist);
        assertTrue("SOAP param.size()<=0 {Should be > 0}", arglist.size()>0);

        RPCParam param = (RPCParam) arglist.get(pos);
        assertNotNull("SOAP param should not be null", param);
View Full Code Here


        assertNotNull("Response message was null!", message);
        SOAPEnvelope envelope = message.getSOAPEnvelope();
        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

       message.setMessageContext(new MessageContext(new AxisServer()));

       SOAPEnvelope envelope = (SOAPEnvelope)message.getSOAPEnvelope();
       assertNotNull("SOAP envelope should not be null", envelope);

       RPCElement body = (RPCElement)envelope.getFirstBody();
       assertNotNull("SOAP body should not be null", body);

       Vector arglist = body.getParams();
       assertNotNull("arglist", arglist);
       assertTrue("SOAP param.size()<=0 {Should be > 0}", arglist.size()>0);

       RPCParam param = (RPCParam) arglist.get(0);
       assertNotNull("SOAP param should not be null", param);
View Full Code Here

        message.setMessageContext(new MessageContext(server));

        SOAPEnvelope envelope = (SOAPEnvelope) message.getSOAPEnvelope();
        assertNotNull("SOAP envelope should not be null", envelope);

        RPCElement body = (RPCElement) envelope.getFirstBody();
        assertNotNull("SOAP body should not be null", body);

        Vector arglist = body.getParams();
        assertNotNull("arglist", arglist);
        assertTrue("param.size()<=0 {Should be > 0}", arglist.size() > 0);

        RPCParam param = (RPCParam) arglist.get(0);
        assertNotNull("SOAP param should not be null", param);
View Full Code Here

        Data data = new Data();
        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);

        // Create a TypeMapping and register the specialized Type Mapping
        TypeMappingRegistry reg = context.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) reg.createTypeMapping();
        tm.setSupportedEncodings(new String[] {Constants.URI_SOAP12_ENC});
        reg.register(Constants.URI_SOAP12_ENC, tm);

        QName dataQName = new QName("typeNS", "Data");
        tm.register(Data.class, dataQName, new DataSerFactory(), new DataDeserFactory());

        msg.output(context);

        String msgString = stringWriter.toString();

        log.debug("---");
        log.debug(msgString);
        log.debug("---");

        StringReader reader = new StringReader(msgString);

        DeserializationContext dser = new DeserializationContextImpl(
            new InputSource(reader), msgContext, org.apache.axis.Message.REQUEST);
        dser.parse();

        SOAPEnvelope env = dser.getEnvelope();
        RPCElement rpcElem = (RPCElement)env.getFirstBody();
        RPCParam struct = rpcElem.getParam("struct");
        assertNotNull("No <struct> param", struct);

        Data val = (Data)struct.getValue();
        assertNotNull("No value for struct param", val);
View Full Code Here

     */
    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

            SOAPEnvelope msg = new SOAPEnvelope(SOAPConstants.SOAP12_CONSTANTS);
            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);

            msgString = stringWriter.toString();
View Full Code Here

        transport.setRemoteService("testOmittedValue");

        call.setTransport(transport);

        SOAPEnvelope resEnv = call.invoke(message.getSOAPEnvelope());
        RPCElement rpcElem = (RPCElement)resEnv.getFirstBody();
        RPCParam param = (RPCParam)rpcElem.getParams().get(0);
        assertEquals("OK!", param.getValue());
    }
View Full Code Here

        msgContext.setTargetService(SERVICE_NAME);

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

        envelope.addBodyElement(body);

        server.invoke(msgContext);
View Full Code Here

        return body;
    }

    public void testRPCReturn() throws Exception {

        RPCElement body = rpc("echo", new Object[] {"abc"});
        assertNotNull("SOAP body was null", body);

        // Check RPC result
        Vector arglist = body.getParams();
        assertNotNull("SOAP argument list was null", arglist);
        RPCParam param = (RPCParam) arglist.get(1);
        assertTrue("Not expected result", ((String)param.getValue()).equals("abc"));

        // Check DOM
        Element e = body.getAsDOM();
        NodeList l = e.getElementsByTagNameNS("http://www.w3.org/2003/05/soap-rpc","result");
        assertTrue("No result element was fount", l.getLength() == 1);
        String ptr = l.item(0).getFirstChild().getNodeValue();
        assertNotNull("Ptr to the result value was null", ptr);
        l = e.getElementsByTagName(ptr);
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.