Package org.apache.axis2.client

Examples of org.apache.axis2.client.Options


      AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();

      MessageContext newMessageContext = new MessageContext();
      newMessageContext.setConfigurationContext(configContext);
     
      Options newOptions = new Options ();
     
      newMessageContext.setOptions(newOptions);
     
      if (referenceMessage.getAxisServiceGroup() != null) {
        newMessageContext.setAxisServiceGroup(referenceMessage.getAxisServiceGroup());
View Full Code Here


    return phases;
  }
 
  public static MessageContext cloneMessageContext (MessageContext oldMsg) throws AxisFault {
    MessageContext newMsg = new MessageContext ();
    newMsg.setOptions(new Options (oldMsg.getOptions()));
   
   
    //TODO hd to use following hack since a 'clone' method was not available for SOAPEnvelopes.
    //Do it the correct way when that becomes available.
    OMElement newElement = oldMsg.getEnvelope().cloneOMElement();
View Full Code Here

      log.debug("Exit: CloseSequenceProcessor::processOutMessage " + Boolean.FALSE);
    }
   
    MessageContext msgContext = rmMsgCtx.getMessageContext();
    ConfigurationContext configurationContext = msgContext.getConfigurationContext();
    Options options = msgContext.getOptions();

    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,
        configurationContext.getAxisConfiguration());

    SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();

    String toAddress = rmMsgCtx.getTo().getAddress();
    String sequenceKey = (String) options.getProperty(SandeshaClientConstants.SEQUENCE_KEY);
    String internalSeqenceID = SandeshaUtil.getInternalSequenceID(toAddress, sequenceKey);

    String outSequenceID = SandeshaUtil.getSequenceProperty(internalSeqenceID,
        Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID, storageManager);
    if (outSequenceID == null)
View Full Code Here

        // get a reference to the DYNAMIC operation of the Anonymous Axis2 service
        AxisOperation axisAnonymousOperation = anoymousService.getOperation(
            new QName(AnonymousServiceFactory.DYNAMIC_OPERATION));

        Options clientOptions = new Options();
        clientOptions.setUseSeparateListener(separateListener);
        // if RM is requested,
        if (wsRMEnabled) {
            // if a WS-RM policy is specified, use it
            if (wsRMPolicyKey != null) {
                clientOptions.setProperty(
                    org.apache.synapse.config.xml.Constants.SANDESHA_POLICY,
                    getPolicy(synapseOutMessageContext, wsRMPolicyKey));
            }
            copyRMOptions(originalInMsgCtx, clientOptions);

            // always send each and every message in a new sequence and terminate sequence
            //clientOptions.setProperty("Sandesha2LastMessage", "true");
        }

        // if security is enabled,
        if (wsSecurityEnabled) {
            // if a WS-Sec policy is specified, use it
            if (wsSecPolicyKey != null) {
                clientOptions.setProperty(
                    org.apache.synapse.config.xml.Constants.RAMPART_POLICY,
                    getPolicy(synapseOutMessageContext, wsSecPolicyKey));
            }
        }
        OperationClient mepClient = axisAnonymousOperation.createClient(
            serviceCtx, clientOptions);
        mepClient.addMessageContext(axisOutMsgCtx);

        if (clientOptions.isUseSeparateListener()) {
            mepClient.setCallback(new AsyncCallback(synapseOutMessageContext));
            axisOutMsgCtx.getOperationContext().setProperty(
                org.apache.axis2.Constants.RESPONSE_WRITTEN, "SKIP");
            mepClient.execute(false);
            return null;
View Full Code Here

        newMC.setEnvelope(removeAddressingHeaders(ori));
        return newMC;
    }
   
    private static void copyRMOptions(MessageContext oriContext, Options targetOptions) {
        Options oriOptions = oriContext.getOptions();
        if(oriOptions.getProperty(Constants.SANDESHA_LAST_MESSAGE) != null) {
            targetOptions.setProperty(Constants.SANDESHA_LAST_MESSAGE,
                    oriOptions.getProperty(Constants.SANDESHA_LAST_MESSAGE));
        }
        if(oriOptions.getProperty(Constants.SANDESHA_SPEC_VERSION) != null) {
            targetOptions.setProperty(Constants.SANDESHA_SPEC_VERSION,
                    oriOptions.getProperty(Constants.SANDESHA_SPEC_VERSION));
        }
        if(oriOptions.getProperty(Constants.SANDESHA_SEQUENCE_KEY) != null) {
            targetOptions.setProperty(Constants.SANDESHA_SEQUENCE_KEY,
                    oriOptions.getProperty(Constants.SANDESHA_SEQUENCE_KEY));
        }
    }
View Full Code Here

    public static void main(String[] args) {
        try {
            OMElement getPricePayload = getPricePayload("WSO");
            OMElement updatePayload = updatePayload("WSO", 123.42);
            Options options = new Options();
            options.setTo(targetEPR);
            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

            ServiceClient sender = new ServiceClient();
            sender.setOptions(options);

            sender.fireAndForget(updatePayload);
View Full Code Here

        OperationClient operationClient = createOperationClient(msg);

        // ensure connections are tracked so that they can be closed by the reference binding
        MessageContext requestMC = operationClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
        //requestMC.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
        Options opt = requestMC.getOptions();
        opt.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
        opt.setUseSeparateListener(true);
        opt.setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION,Boolean.TRUE);       

        operationClient.execute(false);

        // REVIEW it seems ok to return null
        return null;
View Full Code Here

            // The service and port can be set by the above call
            QName serviceQName =
                wsBinding.getService() != null ? wsBinding.getService().getQName() : wsBinding.getServiceName();
            String portName = wsBinding.getPort() != null ? wsBinding.getPort().getName() : wsBinding.getPortName();
            AxisService axisService =
                createClientSideAxisService(wsdlDefinition, serviceQName, portName, new Options());

            HttpClient httpClient = (HttpClient)configContext.getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
            if (httpClient == null) {
                MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
                HttpConnectionManagerParams connectionManagerParams = new HttpConnectionManagerParams();
View Full Code Here

    /**
     * Create and configure an Axis2BindingInvoker for each operation
     */
    protected Invoker createInvoker(Operation operation) {
        Options options = new Options();
        EndpointReference epTo = getWSATOEPR(wsBinding);
        if (epTo != null) {
            options.setTo(epTo);
        }
        options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);

        String operationName = operation.getName();

        String soapAction = getSOAPAction(operationName);
        if (soapAction != null && soapAction.length() > 1) {
            options.setAction(soapAction);
        }

        options.setTimeOutInMilliSeconds(30 * 1000); // 30 seconds

        SOAPFactory soapFactory =
            requiresSOAP12() ? OMAbstractFactory.getSOAP12Factory() : OMAbstractFactory.getSOAP11Factory();
        QName wsdlOperationQName = new QName(operationName);

View Full Code Here

    public void testN2N() throws Exception {
        // Creating the Simple Commodity Client
        System.getProperties().remove(org.apache.axis2.Constants.AXIS2_CONF);
        ServiceClient businessClient = new ServiceClient(null, null);
        Options options = new Options();
        options.setTo(
                new EndpointReference("http://127.0.0.1:10000/CommodityQuote"));
        businessClient.setOptions(options);

        OMElement response = businessClient.sendReceive(commodityPayload());
View Full Code Here

TOP

Related Classes of org.apache.axis2.client.Options

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.