Package org.apache.axis2.clientapi

Examples of org.apache.axis2.clientapi.InOutMEPClient


        UtilServer.stop();
    }


    public void sendMessageWithHeader(SOAPEnvelope envelope) throws AxisFault {
        InOutMEPClient inOutMC = null;

        try {
            ConfigurationContext configContext = Utils.getNewConfigurationContext(org.apache.axis2.Constants.TESTING_REPOSITORY);

            ServiceContext serviceContext =
                    service.getParent().getServiceGroupContext(configContext).getServiceContext(service.getName().getLocalPart());
            inOutMC = new InOutMEPClient(serviceContext);

            MessageContext msgctx = new MessageContext(serviceContext.getEngineContext());

            msgctx.setEnvelope(envelope);

            inOutMC.setTo(targetEPR);
            inOutMC.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);

            MessageContext result =
                    inOutMC.invokeBlocking(
                            serviceContext.getServiceConfig().getOperation(operationName),
                            msgctx);
        } catch (Exception e) {
            e.printStackTrace();
            fail("Exception Occurred !! ." + e.getMessage() );
            throw new AxisFault(e);
        } finally {
            inOutMC.close();
        }
//        fail("Fix Me Deepal");
    }
View Full Code Here


        UtilServer.stop();
    }
   
   
    public void sendMessageWithHeader(SOAPEnvelope envelope) throws AxisFault{
        InOutMEPClient inOutMC;
        ServiceContext serviceContext =
            UtilServer.getConfigurationContext().createServiceContext(service.getName());
        inOutMC = new InOutMEPClient(serviceContext);
        try{
            MessageContext msgctx = new MessageContext(serviceContext.getEngineContext());

            msgctx.setEnvelope(envelope);

            inOutMC.setTo(targetEPR);
            inOutMC.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);

            MessageContext result =
                inOutMC.invokeBlocking(
                    serviceContext.getServiceConfig().getOperation(operationName),
                    msgctx);
        }finally{
            inOutMC.close();
        }
    }
View Full Code Here

    public void init(SynapseEnvironment synapseEnvironment) {
        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            // The check for clustering environment
            ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
            if (clusteringAgent != null && clusteringAgent.getStateManager() != null) {
                isClusteringEnabled = Boolean.TRUE;
            } else {
                isClusteringEnabled = Boolean.FALSE;
            }
View Full Code Here

        return lbMembershipHandler;
    }

    public void send(MessageContext synCtx) {
        SessionInformation sessionInformation = null;
        Member currentMember = null;
        ConfigurationContext configCtx =
                ((Axis2MessageContext) synCtx).getAxis2MessageContext().getConfigurationContext();
        if (lbMembershipHandler.getConfigurationContext() == null) {
            lbMembershipHandler.setConfigurationContext(configCtx);
        }
View Full Code Here

    }

    //----------------------- default method implementations and common code -----------------------

    public void init(SynapseEnvironment synapseEnvironment) {
        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            // The check for clustering environment
            ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
            if (clusteringAgent != null && clusteringAgent.getStateManager() != null) {
                isClusteringEnabled = Boolean.TRUE;
            } else {
                isClusteringEnabled = Boolean.FALSE;
            }
View Full Code Here

     */
    private AlgorithmContext algorithmContext;

    @Override
    public void init(SynapseEnvironment synapseEnvironment) {
        ConfigurationContext cc =
                ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
        if (!initialized) {
            super.init(synapseEnvironment);
            if (algorithmContext == null) {
                algorithmContext = new AlgorithmContext(isClusteringEnabled, cc, getName());
View Full Code Here

    }

    public void send(MessageContext synCtx) {
        SessionInformation sessionInformation = null;
        Member currentMember = null;
        ConfigurationContext configCtx =
                ((Axis2MessageContext) synCtx).getAxis2MessageContext().getConfigurationContext();
        if (lbMembershipHandler.getConfigurationContext() == null) {
            lbMembershipHandler.setConfigurationContext(configCtx);
        }
View Full Code Here

     */
    public static StatisticsCollector getStatisticsCollector(ServerContextInformation contextInfo) {
        if (contextInfo != null && contextInfo.getServerState() == ServerState.INITIALIZED) {
            Object o = contextInfo.getServerContext();
            if (o instanceof ConfigurationContext) {
                ConfigurationContext context = (ConfigurationContext) o;
                SynapseEnvironment environment =
                        (SynapseEnvironment) context.getAxisConfiguration().getParameterValue(
                                SynapseConstants.SYNAPSE_ENV);
                if (environment != null) {
                    return environment.getStatisticsCollector();
                }
            }
View Full Code Here

                    (preserveAddressingProperty != null &&
                            Boolean.parseBoolean(preserveAddressingProperty)));
        }


        ConfigurationContext axisCfgCtx = axisOutMsgCtx.getConfigurationContext();
        AxisConfiguration axisCfg       = axisCfgCtx.getAxisConfiguration();

        AxisService anoymousService =
            AnonymousServiceFactory.getAnonymousService(synapseOutMessageContext.getConfiguration(),
            axisCfg, wsAddressingEnabled, wsRMEnabled, wsSecurityEnabled);
        // mark the anon services created to be used in the client side of synapse as hidden
View Full Code Here

            MessageContext outMsgCtx = oc.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
      if (outMsgCtx == null) {
        throw new AxisFault(Messages.getMessage("outmsgctxnull"));
      }

            ConfigurationContext cfgCtx = sc.getConfigurationContext();

            // set ClientOptions to the current outgoing message
            outMsgCtx.setOptions(options);

      // do Target Resolution
      TargetResolver tr = cfgCtx.getAxisConfiguration().getTargetResolverChain();
            if (tr != null) {
                tr.resolveTarget(outMsgCtx);
            }

            // if the transport to use for sending is not specified, try to find it from the URL
      TransportOutDescription transportOut = options.getTransportOut();
      if (transportOut == null) {
        EndpointReference toEPR =
                    (options.getTo() != null) ? options.getTo() : outMsgCtx.getTo();
        transportOut =
                    ClientUtils.inferOutTransport(cfgCtx.getAxisConfiguration(), toEPR, outMsgCtx);
      }
      outMsgCtx.setTransportOut(transportOut);

      if (options.getTransportIn() == null && outMsgCtx.getTransportIn() == null) {
        outMsgCtx.setTransportIn(ClientUtils.inferInTransport(
                        cfgCtx.getAxisConfiguration(), options, outMsgCtx));
      } else if (outMsgCtx.getTransportIn() == null) {
        outMsgCtx.setTransportIn(options.getTransportIn());
      }

            // add reference parameters to To EPR
View Full Code Here

TOP

Related Classes of org.apache.axis2.clientapi.InOutMEPClient

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.