Examples of RPCParam


Examples of org.apache.axis.message.RPCParam

        bean.setID(1.15F);
        bean.setMale(true);
        bean.company = "Majesty's Secret Service";
        bean.setName("James Bond");

        RPCParam arg = new RPCParam("", "struct", bean);
        RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[]{ arg });
        msg.addBodyElement(body);
        body.setEncodingStyle(null);

        Writer stringWriter = new StringWriter();
View Full Code Here

Examples of org.apache.axis.message.RPCParam

        bean.temp = temp;

        MessageContext msgContext = new MessageContext(new AxisServer(new BasicServerConfig()));
        SOAPEnvelope msg = new SOAPEnvelope();

        RPCParam arg = new RPCParam("", "simple", bean);
        RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[]{ arg });
        msg.addBodyElement(body);
        body.setEncodingStyle(null);

        StringWriter writer = new StringWriter();
View Full Code Here

Examples of org.apache.axis.message.RPCParam

        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);
        return param.getValue();
    }
View Full Code Here

Examples of org.apache.axis.message.RPCParam

        // Don't serialize xsi:type attributes
        msgContext.setProperty(Call.SEND_TYPE_ATTR, "false" );

        SOAPEnvelope msg = new SOAPEnvelope();
        RPCParam arg1 = new RPCParam("urn:myNamespace",
                                     "testParam",
                                     "this is a string");
        RPCElement body = new RPCElement("urn:myNamespace",
                                         "method1",
                                         new Object[]{ arg1 });
View Full Code Here

Examples of org.apache.axis.message.RPCParam

            ParameterDesc param = (ParameterDesc)parameters.get(i);
            if (param.getMode() != ParameterDesc.OUT) {
                QName paramQName = param.getQName();

                // Create an RPCParam if param isn't already an RPCParam.
                RPCParam rpcParam = null;
                Object p = params[j++];
                if(p instanceof RPCParam) {
                    rpcParam = (RPCParam)p;
                } else {
                    rpcParam = new RPCParam(paramQName.getNamespaceURI(),
                                            paramQName.getLocalPart(),
                                            p);
                }
                // Attach the ParameterDescription to the RPCParam
                // so that the serializer can use the (javaType, xmlType)
                // information.
                rpcParam.setParamDesc(param);

                // Add the param to the header or vector depending
                // on whether it belongs in the header or body.
                if (param.isInHeader()) {
                    addHeader(new RPCHeaderParam(rpcParam));
View Full Code Here

Examples of org.apache.axis.message.RPCParam

                if (operation != null) operation.getReturnQName();

                if (!XMLType.AXIS_VOID.equals(getReturnType())) {
                    if (returnParamQName == null) {
                        // Assume the first param is the return
                        RPCParam param = (RPCParam)resArgs.get(0);
                        result = param.getValue();
                        outParamStart = 1;
                    } else {
                        // If the QName of the return value was given to us, look
                        // through the result arguments to find the right name
                        findReturnParam = true;
                    }
                }

                // The following loop looks at the resargs and
                // converts the value to the appropriate return/out parameter
                // value.  If the return value is found, is value is
                // placed in result.  The remaining resargs are
                // placed in the outParams list (note that if a resArg
                // is found that does not match a operation parameter qname,
                // it is still placed in the outParms list).
                for (int i = outParamStart; i < resArgs.size(); i++) {
                    RPCParam param = (RPCParam) resArgs.get(i);

                    Class javaType = getJavaTypeForQName(param.getQName());
                    Object value = param.getValue();

                    // Convert type if needed
                    if (javaType != null && value != null &&
                           !javaType.isAssignableFrom(value.getClass())) {
                        value = JavaUtils.convert(value, javaType);
                    }

                    // Check if this parameter is our return
                    // otherwise just add it to our outputs
                    if (findReturnParam &&
                          returnParamQName.equals(param.getQName())) {
                        // found it!
                        result = value;
                        findReturnParam = false;
                    } else {
                        outParams.put(param.getQName(), value);
                        outParamsList.add(value);
                    }
                }

                // added by scheu:
View Full Code Here

Examples of org.apache.axis.message.RPCParam

        tab_items[0] = "table item 1";
        tab_items[1] = "table item 2";
        tab_items[2] = "table item 3";
        tab_items[3] = "table item 4";

        RPCParam in_table = new RPCParam("http://local_service.com/", "Input_Array", tab_items);
        RPCElement input = new RPCElement("http://localhost:8000/tester", "echoString",
                                  new Object[]{in_table});
        SOAPEnvelope env = new SOAPEnvelope();
        env.addBodyElement(input);
        String text = env.toString();
View Full Code Here

Examples of org.apache.axis.message.RPCParam

       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);

       Object result = param.getValue();
       if (!equals(result, expected)) {
           // Try to convert to the expected class
           if (tryConvert) {
               Object result2 = JavaUtils.convert(result, expected.getClass());
               if (!equals(result2, expected)) {
View Full Code Here

Examples of org.apache.axis.message.RPCParam

    }

    public void doTestData (boolean multiref) throws Exception {
        MessageContext msgContext = new MessageContext(new AxisServer());
        SOAPEnvelope msg = new SOAPEnvelope();
        RPCParam arg1 = new RPCParam("urn:myNamespace", "testParam", "this is a string");

        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_DEFAULT_SOAP_ENC});
        reg.register(Constants.URI_DEFAULT_SOAP_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);

        assertEquals("Data and Val string members are not equal", data.stringMember, val.stringMember);
        assertEquals("Data and Val float members are not equal",data.floatMember.floatValue(),
                     val.floatMember.floatValue(), 0.00001F);
View Full Code Here

Examples of org.apache.axis.message.RPCParam

        Document document = XMLUtils.newDocument(reqSource);
       
        String msgString = null;
       
        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);
       
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.