Examples of RPCElement


Examples of org.apache.axis.message.RPCElement

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

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

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

Examples of org.apache.axis.message.RPCElement

        data2.stringMember = "another str member";
        data2.floatMember = new Float("4.56");
        data2.dataMember = null// "data;" for loop-test of multi-refs
*/
        RPCParam arg2 = new RPCParam("", "struct", tokenResponse);
        RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[]{arg1, arg2});
        msg.addBodyElement(body);

        try {
            Reader reader = null;

            if (args.length == 0) {
                Writer stringWriter = new StringWriter();
                SerializationContext context = new SerializationContext(stringWriter, msgContext);

                TypeMappingRegistry reg = context.getTypeMappingRegistry();
                TypeMapping tm = (TypeMapping) reg.getTypeMapping(Constants.URI_SOAP11_ENC);
                if (tm == null) {
                    tm = (TypeMapping) reg.createTypeMapping();
                    reg.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
                }
                tm.register(RequestSecurityTokenResponse.class, TrustConstants.RESPONSE_NAME, new RSTResponseSerializerFactory(), new RSTResponseDeserializerFactory());

                msg.output(context);

                String msgString = stringWriter.toString();
                System.out.println("Serialized msg:");
                System.out.println(msgString);

                System.out.println("-------");
                System.out.println("Testing deserialization...");

                reader = new StringReader(msgString);
            } else {
                reader = new FileReader(args[0]);
            }

            DeserializationContext dser = new DeserializationContext(new InputSource(reader), msgContext, org.apache.axis.Message.REQUEST);
            dser.parse();
            SOAPEnvelope env = dser.getEnvelope();
            //System.out.println("********\n" + DOM2Writer.nodeToString(env, true) + "\n********");
           
            RPCElement rpcElem = (RPCElement) env.getFirstBody();
            RPCParam struct = rpcElem.getParam("struct");
            if (struct == null)
                throw new Exception("No <struct> param");

            if (!(struct.getObjectValue() instanceof RequestSecurityTokenResponse)) {
                System.out.println("Not a RST object! ");
View Full Code Here

Examples of org.apache.axis.message.RPCElement

        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

Examples of org.apache.axis.message.RPCElement

            }

            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

Examples of org.apache.axis.message.RPCElement

            }

            Object result = null;

            if (bodyEl instanceof RPCElement) {
                RPCElement body = (RPCElement)bodyEl;
                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

Examples of org.apache.axis.message.RPCElement

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

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

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

Examples of org.apache.axis.message.RPCElement

        // each is a different service call
        for (Object o: bodies) {

            if (o instanceof RPCElement) {
                RPCElement body = (RPCElement) o;
                String serviceName = body.getMethodName();
                List<RPCParam> params = null;
                try {
                    params = body.getParams();
                } catch (Exception e) {
                    sendError(response, e);
                    throw new EventHandlerException(e.getMessage(), e);
                }
                Map<String, Object> serviceContext = FastMap.newInstance();
                for (RPCParam param: params) {
                    if (Debug.verboseOn()) Debug.logVerbose("[Reading Param]: " + param.getName(), module);
                    serviceContext.put(param.getName(), param.getObjectValue());
                }
                try {
                    // verify the service is exported for remote execution and invoke it
                    ModelService model = dispatcher.getDispatchContext().getModelService(serviceName);

                    if (model != null && model.export) {
                        Map<String, Object> result = dispatcher.runSync(serviceName, serviceContext);

                        Debug.logVerbose("[EventHandler] : Service invoked", module);
                        RPCElement resBody = new RPCElement(serviceName + "Response");

                        resBody.setPrefix(body.getPrefix());
                        resBody.setNamespaceURI(body.getNamespaceURI());

                        for (Map.Entry<String, Object> entry: result.entrySet()) {
                            RPCParam par = new RPCParam(entry.getKey(), entry.getValue());

                            resBody.addParam(par);
                        }
                        resEnv.addBodyElement(resBody);
                        resEnv.setEncodingStyle(Constants.URI_LITERAL_ENC);
                    } else {
                        sendError(response, "Requested service not available");
View Full Code Here

Examples of org.apache.axis.message.RPCElement

            Iterator i = bodies.iterator();
            while (i.hasNext()) {
                Object o = i.next();

                if (o instanceof RPCElement) {
                    RPCElement body = (RPCElement) o;
                    List params = null;
                    params = body.getParams();

                    Iterator p = params.iterator();
                    while (p.hasNext()) {
                        RPCParam param = (RPCParam) p.next();
                        mRet.put(param.getName(), param.getValue());
View Full Code Here

Examples of org.apache.axis.message.RPCElement

      Object b = resEnv.getFirstBody();
      if (b instanceof SOAPFaultElement) {
        return new AxisFault(b.toString());
      }

      RPCElement body = (RPCElement) b;

      Object result = null;
      HashMap outParams;
      Vector resArgs = body.getParams();

      if (resArgs != null && resArgs.size() > 0) {
        RPCParam param = (RPCParam) resArgs.get(0);
        result = param.getValue();
View Full Code Here

Examples of org.apache.axis.message.RPCElement

    }

    Vector v = (Vector) axisResponse;
    for (int i = 0; i < v.size(); i++) {
      if (v.elementAt(i) instanceof RPCElement) {
        RPCElement rpcEl = (RPCElement) v.elementAt(i);

        QName qn = new QName(rpcEl.getNamespaceURI(), rpcEl.getName());
        Part p = findPart(outputSOAPParts, qn);
        if (p != null) {
          setSOAPPart(outMsg, rpcEl, p);
        } else {
          setAttachmentPart(outMsg, rpcEl);
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.